return <i className="spinner" />;
}
+ const isAzureAvailable =
+ projectBinding && [AlmKeys.Azure, AlmKeys.GitHub].includes(projectBinding.alm);
+
const jenkinsAvailable =
projectBinding &&
[AlmKeys.BitbucketCloud, AlmKeys.BitbucketServer, AlmKeys.GitHub, AlmKeys.GitLab].includes(
</button>
)}
- {projectBinding?.alm === AlmKeys.Azure && (
+ {isAzureAvailable && (
<button
className="button button-huge display-flex-column spacer-left spacer-right azure-pipelines"
onClick={() => props.onSelectTutorial(TutorialModes.AzurePipelines)}
click(wrapper.find('button.tutorial-mode-github'));
expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.GitHubActions);
+
+ click(wrapper.find('button.azure-pipelines'));
+ expect(onSelectTutorial).toHaveBeenLastCalledWith(TutorialModes.AzurePipelines);
});
it('should allow mode selection for GitLab', () => {
onboarding.tutorial.choose_method.github_action
</div>
</button>
+ <button
+ className="button button-huge display-flex-column spacer-left spacer-right azure-pipelines"
+ onClick={[Function]}
+ type="button"
+ >
+ <img
+ alt=""
+ height={80}
+ src="/images/tutorials/azure-pipelines.svg"
+ />
+ <div
+ className="medium big-spacer-top"
+ >
+ onboarding.tutorial.choose_method.azure_pipelines
+ </div>
+ </button>
<button
className="button button-huge display-flex-column spacer-left spacer-right tutorial-mode-jenkins"
onClick={[Function]}
import { translate } from 'sonar-ui-common/helpers/l10n';
import {
isProjectAzureBindingResponse,
+ isProjectGitHubBindingResponse,
ProjectAlmBindingResponse
} from '../../../types/alm-settings';
import Step from '../components/Step';
const [isCurrentStepValid, setIsCurrentStepValid] = React.useState(false);
// Failsafe; should never happen.
- if (!isProjectAzureBindingResponse(projectBinding)) {
+ if (
+ !isProjectAzureBindingResponse(projectBinding) &&
+ !isProjectGitHubBindingResponse(projectBinding)
+ ) {
return (
<Alert variant="error">
{translate('onboarding.tutorial.with.azure_pipelines.unsupported')}
import { click } from 'sonar-ui-common/helpers/testUtils';
import {
mockProjectAzureBindingResponse,
- mockProjectGithubBindingResponse
+ mockProjectGithubBindingResponse,
+ mockProjectGitLabBindingResponse
} from '../../../../helpers/mocks/alm-settings';
import { mockComponent, mockLoggedInUser } from '../../../../helpers/testMocks';
import Step from '../../components/Step';
.dive()
).toMatchSnapshot('last-step-wrapper');
expect(shallowRender({ projectBinding: mockProjectGithubBindingResponse() })).toMatchSnapshot(
+ 'for github'
+ );
+ expect(shallowRender({ projectBinding: mockProjectGitLabBindingResponse() })).toMatchSnapshot(
'wrong alm'
);
});
</div>
`;
+exports[`should render correctly: for github 1`] = `
+<Fragment>
+ <div
+ className="page-header big-spacer-bottom"
+ >
+ <h1
+ className="page-title"
+ >
+ onboarding.tutorial.with.azure_pipelines.title
+ </h1>
+ </div>
+ <Step
+ finished={false}
+ key="0"
+ onOpen={[Function]}
+ open={true}
+ renderForm={[Function]}
+ stepNumber={1}
+ stepTitle="onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.title"
+ />
+ <Step
+ finished={false}
+ key="1"
+ onOpen={[Function]}
+ open={false}
+ renderForm={[Function]}
+ stepNumber={2}
+ stepTitle="onboarding.tutorial.with.azure_pipelines.ServiceEndpoint.title"
+ />
+ <Step
+ finished={false}
+ key="2"
+ onOpen={[Function]}
+ open={false}
+ renderForm={[Function]}
+ stepNumber={3}
+ stepTitle="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.title"
+ />
+ <Step
+ finished={false}
+ key="3"
+ onOpen={[Function]}
+ open={false}
+ renderForm={[Function]}
+ stepNumber={4}
+ stepTitle="onboarding.tutorial.with.azure_pipelines.SaveAndRun.title"
+ />
+</Fragment>
+`;
+
exports[`should render correctly: last-step-wrapper 1`] = `
<div
className="boxed-group onboarding-step"
onboarding.tutorial.with.azure_pipelines.os=What is your agent host?
onboarding.tutorial.with.azure_pipelines.title=Analyze your project with Azure DevOps Pipelines
-onboarding.tutorial.with.azure_pipelines.unsupported=This tutorial is only available for projects bound to Azure DevOps.
+onboarding.tutorial.with.azure_pipelines.unsupported=This tutorial is only available for projects bound to Azure DevOps or GitHub.
onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.title=Install SonarQube extension for Azure DevOps
onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.sentence=From your Azure DevOps instance, navigate to the Visual Studio Marketplace and install the {link} by clicking the {button} button.
onboarding.tutorial.with.azure_pipelines.ExtensionInstallation.sentence.link=SonarQube extension