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.

CaycCompliantBanner.tsx 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2023 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 {
  21. CardWithPrimaryBackground,
  22. CheckIcon,
  23. LightLabel,
  24. SubHeadingHighlight,
  25. } from 'design-system';
  26. import React from 'react';
  27. import { FormattedMessage } from 'react-intl';
  28. import DocumentationLink from '../../../components/common/DocumentationLink';
  29. import { translate } from '../../../helpers/l10n';
  30. import { OPTIMIZED_CAYC_CONDITIONS } from '../utils';
  31. export default function CaycCompliantBanner() {
  32. return (
  33. <CardWithPrimaryBackground className="sw-mb-9 sw-p-8">
  34. <SubHeadingHighlight className="sw-mb-2">
  35. {translate('quality_gates.cayc.banner.title')}
  36. </SubHeadingHighlight>
  37. <div>
  38. <FormattedMessage
  39. id="quality_gates.cayc.banner.description1"
  40. values={{
  41. cayc_link: (
  42. <DocumentationLink to="/user-guide/clean-as-you-code/">
  43. {translate('quality_gates.cayc')}
  44. </DocumentationLink>
  45. ),
  46. }}
  47. />
  48. </div>
  49. <div className="sw-my-2">{translate('quality_gates.cayc.banner.description2')}</div>
  50. <ul className="sw-body-sm sw-flex sw-flex-col sw-gap-2">
  51. {Object.values(OPTIMIZED_CAYC_CONDITIONS).map((condition) => (
  52. <li key={condition.metric}>
  53. <CheckIcon className="sw-mr-1 sw-pt-1/2" />
  54. <LightLabel>{translate(`metric.${condition.metric}.description.positive`)}</LightLabel>
  55. </li>
  56. ))}
  57. </ul>
  58. </CardWithPrimaryBackground>
  59. );
  60. }