You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PublishSteps.tsx 3.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2022 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. import * as React from 'react';
  21. import { FormattedMessage } from 'react-intl';
  22. import { Link } from 'react-router';
  23. import withAppStateContext from '../../../../app/components/app-state/withAppStateContext';
  24. import { Alert } from '../../../../components/ui/Alert';
  25. import { ALM_DOCUMENTATION_PATHS } from '../../../../helpers/constants';
  26. import { translate } from '../../../../helpers/l10n';
  27. import { AlmKeys } from '../../../../types/alm-settings';
  28. import { AppState } from '../../../../types/appstate';
  29. import SentenceWithHighlights from '../../components/SentenceWithHighlights';
  30. export interface PublishStepsProps {
  31. appState: AppState;
  32. }
  33. export function PublishSteps(props: PublishStepsProps) {
  34. const {
  35. appState: { branchesEnabled }
  36. } = props;
  37. return (
  38. <>
  39. <li>
  40. <SentenceWithHighlights
  41. translationKey="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg"
  42. highlightKeys={['task']}
  43. />
  44. <Alert variant="info" className="spacer-top">
  45. {translate(
  46. 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.publish_qg.info.sentence1'
  47. )}
  48. </Alert>
  49. </li>
  50. <li>
  51. <SentenceWithHighlights
  52. translationKey={
  53. branchesEnabled
  54. ? 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration'
  55. : 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.continous_integration.no_branches'
  56. }
  57. highlightKeys={['tab', 'continuous_integration']}
  58. />
  59. </li>
  60. {branchesEnabled && (
  61. <>
  62. <hr />
  63. <FormattedMessage
  64. id="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection"
  65. defaultMessage={translate(
  66. 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection'
  67. )}
  68. values={{
  69. link: (
  70. <Link to={ALM_DOCUMENTATION_PATHS[AlmKeys.Azure]} target="_blank">
  71. {translate(
  72. 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.branch_protection.link'
  73. )}
  74. </Link>
  75. )
  76. }}
  77. />
  78. </>
  79. )}
  80. </>
  81. );
  82. }
  83. export default withAppStateContext(PublishSteps);