* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { Button, ButtonVariety } from '@sonarsource/echoes-react';
+import {
+ Button,
+ ButtonVariety,
+ Heading,
+ IconQuestionMark,
+ Popover,
+} from '@sonarsource/echoes-react';
import * as React from 'react';
-import { HelperHintIcon, Title } from '~design-system';
-import DocHelpTooltip from '~sonar-aligned/components/controls/DocHelpTooltip';
+import { useIntl } from 'react-intl';
+import DocumentationLink from '../../../components/common/DocumentationLink';
import ModalButton, { ModalProps } from '../../../components/controls/ModalButton';
import { DocLink } from '../../../helpers/doc-links';
import { translate } from '../../../helpers/l10n';
<div>
<ModalButton modal={renderModal}>
{({ onClick }) => (
- <Button data-test="quality-gates__add" onClick={onClick} variety={ButtonVariety.Primary}>
+ <Button data-test="quality-gates__add" onClick={onClick} variety={ButtonVariety.Default}>
{translate('create')}
</Button>
)}
}
export default function ListHeader({ canCreate }: Readonly<Props>) {
+ const intl = useIntl();
return (
<div className="sw-flex sw-justify-between sw-pb-4">
- <div className="sw-flex sw-justify-between">
- <Title className="sw-flex sw-items-center sw-typo-lg-semibold sw-mb-0">
- {translate('quality_gates.page')}
- </Title>
- <DocHelpTooltip
- className="sw-ml-2"
- content={translate('quality_gates.help')}
- links={[
- {
- href: DocLink.QualityGates,
- label: translate('learn_more'),
- },
- ]}
+ <div className="sw-flex sw-items-center sw-gap-1 sw-justify-between">
+ <Heading as="h1" className="sw-flex sw-items-center sw-typo-lg-semibold sw-mb-0">
+ {intl.formatMessage({ id: 'quality_gates.page' })}
+ </Heading>
+ <Popover
+ title={intl.formatMessage({ id: 'quality_gates.help.title' })}
+ description={intl.formatMessage({ id: 'quality_gates.help.desc' })}
+ footer={
+ <DocumentationLink standalone to={DocLink.QualityGates}>
+ {intl.formatMessage({ id: 'learn_more' })}
+ </DocumentationLink>
+ }
>
- <HelperHintIcon />
- </DocHelpTooltip>
+ <Button
+ className="sw-p-0 sw-h-fit sw-min-h-fit"
+ aria-label={intl.formatMessage({ id: 'help' })}
+ variety={ButtonVariety.DefaultGhost}
+ >
+ <IconQuestionMark />
+ </Button>
+ </Popover>
</div>
{canCreate && <CreateQualityGateModal />}
</div>
quality_gates.built_in.description.1=This quality gate is provided by default.
quality_gates.built_in.description.2=It will automatically be updated with the latest recommendations.
quality_gates.status=Quality Gate status
-quality_gates.help=A Quality Gate is a set of measure-based, Boolean conditions. It helps you know immediately whether your projects are production-ready. Ideally, all projects will use the same quality gate. Each project's Quality Gate status is displayed prominently on its homepage.
+quality_gates.help.title=What is a quality gate?
+quality_gates.help.desc=It`s a set of measure-based, Boolean conditions. It helps you know immediately whether your projects are production-ready. Ideally, all projects will use the same quality gate. Each project's Quality Gate status is displayed prominently on its homepage.
quality_gates.permissions=Permissions
quality_gates.permissions.help=Users with the global "Administer quality gates" permission and those listed below can manage this quality gate.
quality_gates.permissions.grant=Grant permissions to a user or a group