From df4b2cacab25e01c608dbf865f57f8ef8868f984 Mon Sep 17 00:00:00 2001 From: Ambroise C Date: Wed, 10 Apr 2024 18:57:32 +0200 Subject: SONAR-21822 Fix GitHub scan onboarding tutorial for monorepo --- .../tutorials/__tests__/TutorialSelection-it.tsx | 4 +- .../tutorials/components/DefaultProjectKey.tsx | 10 +++- .../tutorials/github-action/SecretStep.tsx | 60 ++++++++-------------- .../commands/MonorepoDocLinkFallback.tsx | 3 +- 4 files changed, 33 insertions(+), 44 deletions(-) (limited to 'server/sonar-web/src/main/js') diff --git a/server/sonar-web/src/main/js/components/tutorials/__tests__/TutorialSelection-it.tsx b/server/sonar-web/src/main/js/components/tutorials/__tests__/TutorialSelection-it.tsx index 285dc145251..d701224a491 100644 --- a/server/sonar-web/src/main/js/components/tutorials/__tests__/TutorialSelection-it.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/__tests__/TutorialSelection-it.tsx @@ -70,7 +70,9 @@ beforeEach(() => { const ui = { loading: byText('loading'), noScanRights: byText('onboarding.tutorial.no_scan_rights'), - monoRepoSecretInfo: byText('onboarding.tutorial.with.github_action.create_secret.monorepo_info'), + monoRepoSecretInfo: byText( + 'onboarding.tutorial.with.github_action.create_secret.monorepo_project_level_token_info.link', + ), monoRepoYamlDocLink: byRole('link', { name: 'onboarding.tutorial.with.github_action.monorepo.see_yaml_instructions', }), diff --git a/server/sonar-web/src/main/js/components/tutorials/components/DefaultProjectKey.tsx b/server/sonar-web/src/main/js/components/tutorials/components/DefaultProjectKey.tsx index c059bc3de82..b8e4cb95a09 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/DefaultProjectKey.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/DefaultProjectKey.tsx @@ -17,8 +17,9 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { CodeSnippet, NumberedListItem } from 'design-system'; +import { CodeSnippet, FlagMessage, NumberedListItem } from 'design-system'; import * as React from 'react'; +import { FormattedMessage } from 'react-intl'; import { Component } from '../../../types/types'; import SentenceWithFilename from './SentenceWithFilename'; @@ -33,12 +34,17 @@ export default function DefaultProjectKey(props: DefaultProjectKeyProps) { const { component, monorepo } = props; return ( - + +
+ + + +
); } diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/SecretStep.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/SecretStep.tsx index 385105e5179..26fb3f005d9 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/SecretStep.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/SecretStep.tsx @@ -28,10 +28,8 @@ import { import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { translate } from '../../../helpers/l10n'; -import { hasGlobalPermission } from '../../../helpers/users'; import { useProjectBindingQuery } from '../../../queries/devops-integration'; import { AlmSettingsInstance } from '../../../types/alm-settings'; -import { Permissions } from '../../../types/permissions'; import { Component } from '../../../types/types'; import { LoggedInUser } from '../../../types/users'; import { InlineSnippet } from '../components/InlineSnippet'; @@ -86,38 +84,6 @@ export default function SecretStep(props: SecretStepProps) { /> - {monorepo && ( - - , - global_secret: hasGlobalPermission(currentUser, Permissions.Scan) ? ( - - {translate( - 'onboarding.tutorial.with.github_action.create_secret.monorepo_create_global_token.link', - )} - - ), - }} - /> - ) : ( - '' - ), - }} - /> - - )}
@@ -127,6 +93,27 @@ export default function SecretStep(props: SecretStepProps) { translationKey="onboarding.tutorial.with.github_action.secret.add" highlightKeys={['add_secret']} /> + {monorepo && ( + +
+
+ + + + ), + }} + /> +
+
+ +
+
+
+ )}
@@ -167,11 +154,6 @@ export default function SecretStep(props: SecretStepProps) { /> - {monorepo && ( - - {translate('onboarding.tutorial.with.github_action.create_secret.monorepo_info')} - - )} ); } diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/MonorepoDocLinkFallback.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/MonorepoDocLinkFallback.tsx index 6c0d3ebffb5..0ae8b529271 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/MonorepoDocLinkFallback.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/MonorepoDocLinkFallback.tsx @@ -30,8 +30,7 @@ export default function MonorepoDocLinkFallback() { {translate('onboarding.tutorial.with.github_action.monorepo.see_yaml_instructions')} - {' '} - {translate('onboarding.tutorial.with.github_action.monorepo.pre_see_yaml_instructions')} + ); } -- cgit v1.2.3