@@ -17,13 +17,8 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
import { | |||
BasicSeparator, | |||
ClipboardIconButton, | |||
NumberedList, | |||
NumberedListItem, | |||
StandoutLink, | |||
} from 'design-system'; | |||
import { LinkStandalone } from '@sonarsource/echoes-react'; | |||
import { BasicSeparator, ClipboardIconButton, NumberedList, NumberedListItem } from 'design-system'; | |||
import * as React from 'react'; | |||
import { FormattedMessage } from 'react-intl'; | |||
import { translate } from '../../../helpers/l10n'; | |||
@@ -54,16 +49,15 @@ export default function RepositoryVariables(props: RepositoryVariablesProps) { | |||
values={{ | |||
repository_variables: | |||
almBinding?.url && projectBinding?.repository ? ( | |||
<StandoutLink | |||
<LinkStandalone | |||
to={`${buildBitbucketCloudLink( | |||
almBinding, | |||
projectBinding, | |||
)}/admin/addon/admin/pipelines/repository-variables`} | |||
target="_blank" | |||
rel="noopener noreferrer" | |||
> | |||
{translate('onboarding.tutorial.with.bitbucket_pipelines.variables.intro.link')} | |||
</StandoutLink> | |||
</LinkStandalone> | |||
) : ( | |||
<span className="sw-body-sm-highlight"> | |||
{translate('onboarding.tutorial.with.bitbucket_pipelines.variables.intro.link')} |
@@ -50,13 +50,13 @@ export default function GitHubActionTutorial(props: GitHubActionTutorialProps) { | |||
willRefreshAutomatically, | |||
} = props; | |||
const secretStepTitle = `onboarding.tutorial.with.github_action.create_secret.title${monorepo ? '.monorepo' : ''}`; | |||
return ( | |||
<> | |||
<Title>{translate('onboarding.tutorial.with.github_ci.title')}</Title> | |||
<TutorialStepList className="sw-mb-8"> | |||
<TutorialStep title={translate(secretStepTitle)}> | |||
<TutorialStep | |||
title={translate('onboarding.tutorial.with.github_action.create_secret.title')} | |||
> | |||
<SecretStep | |||
almBinding={almBinding} | |||
baseUrl={baseUrl} |
@@ -17,19 +17,21 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
import { Link, LinkStandalone } from '@sonarsource/echoes-react'; | |||
import { | |||
BasicSeparator, | |||
ClipboardIconButton, | |||
FlagMessage, | |||
NumberedList, | |||
NumberedListItem, | |||
StandoutLink, | |||
} from 'design-system'; | |||
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'; | |||
@@ -57,13 +59,12 @@ export default function SecretStep(props: SecretStepProps) { | |||
values={{ | |||
settings_secret: | |||
almBinding && projectBinding ? ( | |||
<StandoutLink | |||
<LinkStandalone | |||
to={`${buildGithubLink(almBinding, projectBinding)}/settings/secrets`} | |||
target="_blank" | |||
rel="noopener noreferrer" | |||
> | |||
{translate('onboarding.tutorial.with.github_action.secret.intro.link')} | |||
</StandoutLink> | |||
</LinkStandalone> | |||
) : ( | |||
<span className="sw-body-sm-highlight"> | |||
{translate('onboarding.tutorial.with.github_action.secret.intro.link')} | |||
@@ -85,6 +86,38 @@ export default function SecretStep(props: SecretStepProps) { | |||
/> | |||
<InlineSnippet snippet="SONAR_TOKEN" className="sw-ml-1" /> | |||
<ClipboardIconButton copyValue="SONAR_TOKEN" className="sw-ml-2 sw-align-sub" /> | |||
{monorepo && ( | |||
<FlagMessage variant="info" className="sw-block sw-w-fit sw-mt-4"> | |||
<FormattedMessage | |||
defaultMessage={translate( | |||
'onboarding.tutorial.with.github_action.create_secret.monorepo_sonar_token', | |||
)} | |||
id="onboarding.tutorial.with.github_action.create_secret.monorepo_sonar_token" | |||
values={{ | |||
token_name: <InlineSnippet snippet="SONAR_TOKEN_1" className="sw-ml-1" />, | |||
global_secret: hasGlobalPermission(currentUser, Permissions.Scan) ? ( | |||
<FormattedMessage | |||
defaultMessage={translate( | |||
'onboarding.tutorial.with.github_action.create_secret.monorepo_create_global_token', | |||
)} | |||
id="onboarding.tutorial.with.github_action.create_secret.monorepo_create_global_token" | |||
values={{ | |||
link: ( | |||
<Link to="/account/security" target="_blank" className="sw-mx-1"> | |||
{translate( | |||
'onboarding.tutorial.with.github_action.create_secret.monorepo_create_global_token.link', | |||
)} | |||
</Link> | |||
), | |||
}} | |||
/> | |||
) : ( | |||
'' | |||
), | |||
}} | |||
/> | |||
</FlagMessage> | |||
)} | |||
</NumberedListItem> | |||
<NumberedListItem> | |||
<TokenStepGenerator component={component} currentUser={currentUser} /> |
@@ -50,7 +50,7 @@ export function getCommonNodes(ci: TutorialModes) { | |||
linkToRepo: byRole('link', { | |||
name: `onboarding.tutorial.with.${CI_TRANSLATE_MAP[ci]}.${ | |||
ci === TutorialModes.GitHubActions ? 'secret' : 'variables' | |||
}.intro.link`, | |||
}.intro.link open_in_new_window`, | |||
}), | |||
allSetSentence: byText('onboarding.tutorial.ci_outro.done'), | |||
}; |
@@ -4619,8 +4619,10 @@ onboarding.tutorial.with.bitbucket_pipelines.variables.secured.sentence.secured= | |||
onboarding.tutorial.with.github_ci.title=Analyze your project with GitHub CI | |||
onboarding.tutorial.with.github_action.create_secret.title=Create GitHub Secrets | |||
onboarding.tutorial.with.github_action.create_secret.title.monorepo=Create GitHub Secrets (once per monorepository) | |||
onboarding.tutorial.with.github_action.create_secret.monorepo_info=If the secrets were created already for one of the projects in the mono repository, please skip this step | |||
onboarding.tutorial.with.github_action.create_secret.monorepo_sonar_token=Monorepository token names will need to be unique per project (e.g. {token_name}) {global_secret} | |||
onboarding.tutorial.with.github_action.create_secret.monorepo_create_global_token=or create a {link} for the monorepository | |||
onboarding.tutorial.with.github_action.create_secret.monorepo_create_global_token.link=global token | |||
onboarding.tutorial.with.github_action.monorepo.pre_see_yaml_instructions=(once per monorepository) | |||
onboarding.tutorial.with.github_action.monorepo.see_yaml_instructions=See the documentation to create the Workflow YAML file at the root of your repository | |||
onboarding.tutorial.with.github_action.secret.intro=In your GitHub repository, go to {settings_secret} and create two new secrets: |