diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps/quality-gates')
8 files changed, 107 insertions, 38 deletions
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx index b0a7b2a8c7f..b83d4572a43 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx @@ -19,8 +19,8 @@ */ import * as classNames from 'classnames'; import * as React from 'react'; +import Tooltip from 'sonar-ui-common/components/controls/Tooltip'; import { translate } from 'sonar-ui-common/helpers/l10n'; -import DocTooltip from '../../../components/docs/DocTooltip'; interface Props { className?: string; @@ -28,11 +28,8 @@ interface Props { export default function BuiltInQualityGateBadge({ className }: Props) { return ( - <DocTooltip - doc={import( - /* webpackMode: "eager" */ 'Docs/tooltips/quality-gates/built-in-quality-gate.md' - )}> + <Tooltip overlay={translate('quality_gates.built_in.help')}> <div className={classNames('badge', className)}>{translate('quality_gates.built_in')}</div> - </DocTooltip> + </Tooltip> ); } diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx index b7385ef07f7..d90c53ebe2a 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx @@ -24,7 +24,7 @@ import ModalButton from 'sonar-ui-common/components/controls/ModalButton'; import { Alert } from 'sonar-ui-common/components/ui/Alert'; import { getLocalizedMetricName, translate } from 'sonar-ui-common/helpers/l10n'; import { isDiffMetric } from 'sonar-ui-common/helpers/measures'; -import DocTooltip from '../../../components/docs/DocTooltip'; +import DocumentationTooltip from '../../../components/common/DocumentationTooltip'; import { withAppState } from '../../../components/hoc/withAppState'; import { MetricKey } from '../../../types/metrics'; import Condition from './Condition'; @@ -165,11 +165,15 @@ export class Conditions extends React.PureComponent<Props> { <header className="display-flex-center spacer-bottom"> <h3>{translate('quality_gates.conditions')}</h3> - <DocTooltip + <DocumentationTooltip className="spacer-left" - doc={import( - /* webpackMode: "eager" */ 'Docs/tooltips/quality-gates/quality-gate-conditions.md' - )} + content={translate('quality_gates.conditions.help')} + links={[ + { + href: '/documentation/user-guide/clean-as-you-code/', + label: translate('quality_gates.conditions.help.link') + } + ]} /> </header> diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx index 1c45dfad50a..5966b0cb1bc 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; +import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip'; import { translate } from 'sonar-ui-common/helpers/l10n'; -import DocTooltip from '../../../components/docs/DocTooltip'; import Conditions from './Conditions'; import Projects from './Projects'; @@ -56,11 +56,13 @@ export function DetailsContent(props: DetailsContentProps) { <div className="quality-gate-section" id="quality-gate-projects"> <header className="display-flex-center spacer-bottom"> <h3>{translate('quality_gates.projects')}</h3> - <DocTooltip + <HelpTooltip className="spacer-left" - doc={import( - /* webpackMode: "eager" */ 'Docs/tooltips/quality-gates/quality-gate-projects.md' - )} + overlay={ + <div className="big-padded-top big-padded-bottom"> + {translate('quality_gates.projects.help')} + </div> + } /> </header> {isDefault ? ( diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/ListHeader.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/ListHeader.tsx index f9858b45947..8fc6c24c0b3 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/ListHeader.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/ListHeader.tsx @@ -21,7 +21,7 @@ import * as React from 'react'; import { Button } from 'sonar-ui-common/components/controls/buttons'; import ModalButton from 'sonar-ui-common/components/controls/ModalButton'; import { translate } from 'sonar-ui-common/helpers/l10n'; -import DocTooltip from '../../../components/docs/DocTooltip'; +import DocumentationTooltip from '../../../components/common/DocumentationTooltip'; import CreateQualityGateForm from './CreateQualityGateForm'; interface Props { @@ -54,9 +54,15 @@ export default function ListHeader({ canCreate, refreshQualityGates, organizatio <div className="display-flex-center"> <h1 className="page-title">{translate('quality_gates.page')}</h1> - <DocTooltip + <DocumentationTooltip className="spacer-left" - doc={import(/* webpackMode: "eager" */ 'Docs/tooltips/quality-gates/quality-gate.md')} + content={translate('quality_gates.help')} + links={[ + { + href: '/documentation/user-guide/quality-gates/', + label: translate('learn_more') + } + ]} /> </div> </header> diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/BuiltInQualityGateBadge-test.tsx.snap b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/BuiltInQualityGateBadge-test.tsx.snap index 76f55d531f8..04bf352dbe8 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/BuiltInQualityGateBadge-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/BuiltInQualityGateBadge-test.tsx.snap @@ -1,13 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`should render correctly 1`] = ` -<DocTooltip - doc={Promise {}} +<Tooltip + overlay="quality_gates.built_in.help" > <div className="badge" > quality_gates.built_in </div> -</DocTooltip> +</Tooltip> `; diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/Conditions-test.tsx.snap b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/Conditions-test.tsx.snap index 14bf9466228..cb7ff83d304 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/Conditions-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/Conditions-test.tsx.snap @@ -10,9 +10,17 @@ exports[`should render correctly 1`] = ` <h3> quality_gates.conditions </h3> - <DocTooltip + <DocumentationTooltip className="spacer-left" - doc={Promise {}} + content="quality_gates.conditions.help" + links={ + Array [ + Object { + "href": "/documentation/user-guide/clean-as-you-code/", + "label": "quality_gates.conditions.help.link", + }, + ] + } /> </header> <div @@ -129,9 +137,17 @@ exports[`should render correctly for no conditions 1`] = ` <h3> quality_gates.conditions </h3> - <DocTooltip + <DocumentationTooltip className="spacer-left" - doc={Promise {}} + content="quality_gates.conditions.help" + links={ + Array [ + Object { + "href": "/documentation/user-guide/clean-as-you-code/", + "label": "quality_gates.conditions.help.link", + }, + ] + } /> </header> <div @@ -152,9 +168,17 @@ exports[`should render correctly with an updated condition 1`] = ` <h3> quality_gates.conditions </h3> - <DocTooltip + <DocumentationTooltip className="spacer-left" - doc={Promise {}} + content="quality_gates.conditions.help" + links={ + Array [ + Object { + "href": "/documentation/user-guide/clean-as-you-code/", + "label": "quality_gates.conditions.help.link", + }, + ] + } /> </header> <div @@ -271,9 +295,17 @@ exports[`should render correctly with new code conditions 1`] = ` <h3> quality_gates.conditions </h3> - <DocTooltip + <DocumentationTooltip className="spacer-left" - doc={Promise {}} + content="quality_gates.conditions.help" + links={ + Array [ + Object { + "href": "/documentation/user-guide/clean-as-you-code/", + "label": "quality_gates.conditions.help.link", + }, + ] + } /> </header> <div @@ -500,9 +532,17 @@ exports[`should render the add conditions button and modal 1`] = ` <h3> quality_gates.conditions </h3> - <DocTooltip + <DocumentationTooltip className="spacer-left" - doc={Promise {}} + content="quality_gates.conditions.help" + links={ + Array [ + Object { + "href": "/documentation/user-guide/clean-as-you-code/", + "label": "quality_gates.conditions.help.link", + }, + ] + } /> </header> <div diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/DetailsContent-test.tsx.snap b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/DetailsContent-test.tsx.snap index c98a62ada70..59ba0ebfd65 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/DetailsContent-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/DetailsContent-test.tsx.snap @@ -27,9 +27,15 @@ exports[`should render correctly: is default 1`] = ` <h3> quality_gates.projects </h3> - <DocTooltip + <HelpTooltip className="spacer-left" - doc={Promise {}} + overlay={ + <div + className="big-padded-top big-padded-bottom" + > + quality_gates.projects.help + </div> + } /> </header> quality_gates.projects_for_default @@ -64,9 +70,15 @@ exports[`should render correctly: is not default 1`] = ` <h3> quality_gates.projects </h3> - <DocTooltip + <HelpTooltip className="spacer-left" - doc={Promise {}} + overlay={ + <div + className="big-padded-top big-padded-bottom" + > + quality_gates.projects.help + </div> + } /> </header> <Projects diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/ListHeader-test.tsx.snap b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/ListHeader-test.tsx.snap index f12ac9a8ce6..0913eca851b 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/ListHeader-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/ListHeader-test.tsx.snap @@ -12,9 +12,17 @@ exports[`should render correctly 1`] = ` > quality_gates.page </h1> - <DocTooltip + <DocumentationTooltip className="spacer-left" - doc={Promise {}} + content="quality_gates.help" + links={ + Array [ + Object { + "href": "/documentation/user-guide/quality-gates/", + "label": "learn_more", + }, + ] + } /> </div> </header> |