/*
* SonarQube
* Copyright (C) 2009-2023 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import styled from '@emotion/styled';
import { themeBorder } from 'design-system';
import * as React from 'react';
import EllipsisIcon from '../../components/icons/EllipsisIcon';
import { translate } from '../../helpers/l10n';
import { getBaseUrl } from '../../helpers/system';
import { AlmKeys, AlmSettingsInstance, ProjectAlmBindingResponse } from '../../types/alm-settings';
import { Component } from '../../types/types';
import { LoggedInUser } from '../../types/users';
import { Alert } from '../ui/Alert';
import AzurePipelinesTutorial from './azure-pipelines/AzurePipelinesTutorial';
import BitbucketPipelinesTutorial from './bitbucket-pipelines/BitbucketPipelinesTutorial';
import GitHubActionTutorial from './github-action/GitHubActionTutorial';
import GitLabCITutorial from './gitlabci/GitLabCITutorial';
import JenkinsTutorial from './jenkins/JenkinsTutorial';
import OtherTutorial from './other/OtherTutorial';
import { TutorialModes } from './types';
export interface TutorialSelectionRendererProps {
almBinding?: AlmSettingsInstance;
baseUrl: string;
component: Component;
currentUser: LoggedInUser;
currentUserCanScanProject: boolean;
loading: boolean;
mainBranchName: string;
onSelectTutorial: (mode: TutorialModes) => void;
projectBinding?: ProjectAlmBindingResponse;
selectedTutorial?: TutorialModes;
willRefreshAutomatically?: boolean;
}
const DEFAULT_ICON_SIZE = 60;
const GH_ACTION_ICON_SIZE = 46;
function renderButton(
mode: TutorialModes,
onSelectTutorial: (mode: TutorialModes) => void,
icon: React.ReactNode
) {
return (
{translate('onboarding.tutorial.choose_method.devops_platform.description')}
{translate('onboarding.tutorial.choose_method.local.description')}