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.

AllSet.tsx 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 withAppStateContext from '../../../app/components/app-state/withAppStateContext';
  22. import { translate } from '../../../helpers/l10n';
  23. import { getBaseUrl } from '../../../helpers/system';
  24. import { AlmKeys } from '../../../types/alm-settings';
  25. import { AppState } from '../../../types/appstate';
  26. import SentenceWithHighlights from './SentenceWithHighlights';
  27. export interface AllSetProps {
  28. alm: AlmKeys;
  29. appState: AppState;
  30. willRefreshAutomatically?: boolean;
  31. }
  32. export function AllSet(props: AllSetProps) {
  33. const {
  34. alm,
  35. appState: { branchesEnabled },
  36. willRefreshAutomatically
  37. } = props;
  38. return (
  39. <>
  40. <div className="abs-width-600">
  41. <p className="big-spacer-bottom">
  42. <SentenceWithHighlights
  43. highlightKeys={['all_set']}
  44. translationKey="onboarding.tutorial.ci_outro.all_set"
  45. />
  46. </p>
  47. <div className="display-flex-row big-spacer-bottom">
  48. <div>
  49. <img
  50. alt="" // Should be ignored by screen readers
  51. className="big-spacer-right"
  52. width={30}
  53. src={`${getBaseUrl()}/images/tutorials/commit.svg`}
  54. />
  55. </div>
  56. <div>
  57. <p className="little-spacer-bottom">
  58. <strong>{translate('onboarding.tutorial.ci_outro.commit')}</strong>
  59. </p>
  60. <p>
  61. {branchesEnabled
  62. ? translate('onboarding.tutorial.ci_outro.commit.why', alm)
  63. : translate('onboarding.tutorial.ci_outro.commit.why.no_branches')}
  64. </p>
  65. </div>
  66. </div>
  67. {willRefreshAutomatically && (
  68. <div className="display-flex-row">
  69. <div>
  70. <img
  71. alt="" // Should be ignored by screen readers
  72. className="big-spacer-right"
  73. width={30}
  74. src={`${getBaseUrl()}/images/tutorials/refresh.svg`}
  75. />
  76. </div>
  77. <div>
  78. <p className="little-spacer-bottom">
  79. <strong>{translate('onboarding.tutorial.ci_outro.refresh')}</strong>
  80. </p>
  81. <p>{translate('onboarding.tutorial.ci_outro.refresh.why')}</p>
  82. </div>
  83. </div>
  84. )}
  85. </div>
  86. {willRefreshAutomatically && (
  87. <div className="huge-spacer-bottom huge-spacer-top big-padded-top text-muted display-flex-center display-flex-justify-center">
  88. <i className="spinner spacer-right" />
  89. {translate('onboarding.tutorial.ci_outro.waiting_for_fist_analysis')}
  90. </div>
  91. )}
  92. </>
  93. );
  94. }
  95. export default withAppStateContext(AllSet);