/* * SonarQube * Copyright (C) 2009-2022 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 * as React from 'react'; import { FormattedMessage } from 'react-intl'; import Link from '../../../components/common/Link'; import { Button } from '../../../components/controls/buttons'; import ListFooter from '../../../components/controls/ListFooter'; import SearchBox from '../../../components/controls/SearchBox'; import Tooltip from '../../../components/controls/Tooltip'; import CheckIcon from '../../../components/icons/CheckIcon'; import QualifierIcon from '../../../components/icons/QualifierIcon'; import { Alert } from '../../../components/ui/Alert'; import DeferredSpinner from '../../../components/ui/DeferredSpinner'; import { translate } from '../../../helpers/l10n'; import { getProjectUrl, queryToSearch } from '../../../helpers/urls'; import { GitlabProject } from '../../../types/alm-integration'; import { ComponentQualifier } from '../../../types/component'; import { Paging } from '../../../types/types'; import { CreateProjectModes } from './types'; export interface GitlabProjectSelectionFormProps { importingGitlabProjectId?: string; loadingMore: boolean; onImport: (gitlabProjectId: string) => void; onLoadMore: () => void; onSearch: (searchQuery: string) => void; projects?: GitlabProject[]; projectsPaging: Paging; searching: boolean; searchQuery: string; } export default function GitlabProjectSelectionForm(props: GitlabProjectSelectionFormProps) { const { importingGitlabProjectId, loadingMore, projects = [], projectsPaging, searching, searchQuery } = props; if (projects.length === 0 && searchQuery.length === 0 && !searching) { return ( {translate('onboarding.create_project.update_your_token')} ) }} /> ); } return (

{projects.length === 0 ? (
{translate('no_results')}
) : ( {projects.map(project => ( {project.sqProjectKey ? ( ) : ( )} ))}
{project.sqProjectKey ? ( {project.sqProjectName} ) : ( project.name )}
{project.pathName}
{translate('onboarding.create_project.gitlab.link')} {translate('onboarding.create_project.repository_imported')}
)}
); }