]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-11714 Update all badge definitions
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Wed, 17 Jul 2019 16:03:44 +0000 (18:03 +0200)
committerSonarTech <sonartech@sonarsource.com>
Fri, 2 Aug 2019 18:21:15 +0000 (20:21 +0200)
41 files changed:
server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenuItem.tsx
server/sonar-web/src/main/js/app/components/nav/component/ComponentNavWarnings.tsx
server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranchesMenuItem-test.tsx.snap
server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavWarnings-test.tsx.snap
server/sonar-web/src/main/js/app/components/notifications/NavLatestNotification.tsx
server/sonar-web/src/main/js/app/components/notifications/__tests__/__snapshots__/NavLatestNotification-test.tsx.snap
server/sonar-web/src/main/js/app/components/notifications/notifications.css
server/sonar-web/src/main/js/app/styles/components/badges.css
server/sonar-web/src/main/js/apps/account/organizations/OrganizationCard.tsx
server/sonar-web/src/main/js/apps/background-tasks/components/TaskStatus.tsx
server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskStatus-test.tsx.snap
server/sonar-web/src/main/js/apps/code/code.css
server/sonar-web/src/main/js/apps/code/components/ComponentName.tsx
server/sonar-web/src/main/js/apps/code/components/__tests__/__snapshots__/ComponentName-test.tsx.snap
server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsMeta.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx
server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/__snapshots__/RuleDetailsMeta-test.tsx.snap
server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentCell.tsx
server/sonar-web/src/main/js/apps/create/components/OrganizationSelect.tsx
server/sonar-web/src/main/js/apps/create/project/AlmRepositoryItem.tsx
server/sonar-web/src/main/js/apps/create/project/__tests__/__snapshots__/AlmRepositoryItem-test.tsx.snap
server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigationMeta.tsx
server/sonar-web/src/main/js/apps/projectBranches/components/BranchRow.tsx
server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/__snapshots__/BranchRow-test.tsx.snap
server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx
server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/BuiltInQualityGateBadge-test.tsx [new file with mode: 0644]
server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/__snapshots__/BuiltInQualityGateBadge-test.tsx.snap [new file with mode: 0644]
server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInQualityProfileBadge.tsx
server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/BuiltInQualityProfileBadge-test.tsx [new file with mode: 0644]
server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/__snapshots__/BuiltInQualityProfileBadge-test.tsx.snap [new file with mode: 0644]
server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx
server/sonar-web/src/main/js/apps/tutorials/analyzeProject/AnalyzeTutorialSonarCloud.tsx
server/sonar-web/src/main/js/apps/tutorials/analyzeProject/__tests__/__snapshots__/AnalyzeTutorialSonarCloud-test.tsx.snap
server/sonar-web/src/main/js/apps/web-api/components/InternalBadge.tsx
server/sonar-web/src/main/js/components/common/PrivacyBadgeContainer.tsx
server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/PrivacyBadgeContainer-test.tsx.snap
server/sonar-web/src/main/js/components/facet/FacetHeader.tsx
server/sonar-web/src/main/js/components/facet/__tests__/__snapshots__/FacetHeader-test.tsx.snap
server/sonar-web/src/main/js/components/issue/components/IssueMessage.tsx
server/sonar-web/src/main/js/components/ui/OrganizationListItem.tsx
server/sonar-web/src/main/js/components/ui/__tests__/__snapshots__/OrganizationListItem-test.tsx.snap

index 3a0987ed04219619da7c8641918edeeb21f6172d..d4f76e2761f67bf9d2d456be88402dd0610cb26f 100644 (file)
@@ -65,7 +65,7 @@ export default function ComponentNavBranchesMenuItem({ branchLike, ...props }: P
           />
           {displayName}
           {isMainBranch(branchLike) && (
-            <div className="outline-badge spacer-left">{translate('branches.main_branch')}</div>
+            <div className="badge spacer-left">{translate('branches.main_branch')}</div>
           )}
         </div>
         <div className="big-spacer-left note">
index d37b6f06ccd7590d1c8da90a497d15ec9a596a1f..08cdbbc097fdf26467ea124ed2889f6a6f713648 100644 (file)
@@ -51,7 +51,7 @@ export default class ComponentNavWarnings extends React.PureComponent<Props, Sta
   render() {
     return (
       <>
-        <div className="badge badge-focus badge-medium display-inline-flex-center js-component-analysis-warnings flex-1">
+        <div className="badge display-inline-flex-center js-component-analysis-warnings flex-1">
           <WarningIcon className="spacer-right" />
           <FormattedMessage
             defaultMessage={translate('component_navigation.last_analysis_had_warnings')}
index 04c1bf0c7919f83b18c048e26d9df4955123e538..9f65d7011e05ee1ac96806e9971f046ad37bc6f2 100644 (file)
@@ -34,7 +34,7 @@ exports[`renders main branch 1`] = `
       />
       master
       <div
-        className="outline-badge spacer-left"
+        className="badge spacer-left"
       >
         branches.main_branch
       </div>
index c4d0380903f1d9b39fca754b745b65ebe94cea85..5f49bd0b0390661560ac3f0c2830122ddd7470d8 100644 (file)
@@ -3,7 +3,7 @@
 exports[`should render 1`] = `
 <Fragment>
   <div
-    className="badge badge-focus badge-medium display-inline-flex-center js-component-analysis-warnings flex-1"
+    className="badge display-inline-flex-center js-component-analysis-warnings flex-1"
   >
     <WarningIcon
       className="spacer-right"
index df1cb34c9028fa9ef13103020bdeeb31ae69932e..872b159fc43f8c78357e92b5a7abba018db44901 100644 (file)
@@ -71,7 +71,7 @@ export default class NavLatestNotification extends React.PureComponent<Props> {
           <>
             <li className="navbar-latest-notification" onClick={this.props.onClick}>
               <div className="navbar-latest-notification-wrapper">
-                <span className="badge badge-new">{translate('new')}</span>
+                <span className="badge badge-info">{translate('new')}</span>
                 <span className="label">{lastNews.notification}</span>
               </div>
             </li>
index 4e32113a75ca87c2d1cc6ec1834ddf70834dafc1..c748dbfcf16e116f30783aaf23198792d115a659 100644 (file)
@@ -10,7 +10,7 @@ exports[`should render correctly if there are new features, and the user has not
       className="navbar-latest-notification-wrapper"
     >
       <span
-        className="badge badge-new"
+        className="badge badge-info"
       >
         new
       </span>
index 2f4b3a42ce304cf86950da9a77d4b0862d7fbdf2..be010caa722d58809e7cb8c3b367f089546b68dd 100644 (file)
   color: var(--sonarcloudBlack300);
 }
 
-.navbar-latest-notification-wrapper .badge-new {
+.navbar-latest-notification-wrapper .badge-info {
   position: absolute;
   margin-right: var(--gridSize);
-  left: calc(var(--gridSize) / 2);
-  top: 5px;
+  left: 6px;
+  top: 6px;
 }
 
 .navbar-latest-notification-wrapper .label {
index 89b735f3b7185d66a79157d36a5a46c4a9d9e194..02a9d1cd71c7e0d38f1a93b6227402ed6a317c54 100644 (file)
  */
 .badge {
   display: inline-block;
-  vertical-align: middle;
-  height: var(--smallControlHeight);
-  line-height: calc(var(--smallControlHeight) - 1px);
-  padding: 0 var(--gridSize);
-  border-radius: 10px;
+  padding: 2px 4px;
+  background-color: var(--barBorderColor);
+  border-radius: 3px;
   font-size: var(--smallFontSize);
-  min-width: 10px;
-  letter-spacing: 0.03em;
-  color: #ffffff;
+  font-weight: normal;
+  color: var(--baseFontColor);
+  text-transform: uppercase;
   white-space: nowrap;
-  text-align: center;
-  background-color: var(--blue);
+  line-height: 1;
 }
-
 .badge:empty {
   display: none;
 }
@@ -42,126 +38,44 @@ a.badge:focus,
 a.badge:active {
   color: #ffffff;
 }
-
 a.badge {
   border-bottom: none;
 }
 
-.badge-medium {
-  height: var(--controlHeight);
-  line-height: calc(var(--controlHeight));
-  letter-spacing: 0.01em;
-}
-
 .list-group-item > .badge,
 .list-group-item-heading > .badge {
   float: right;
   margin: 3px;
 }
-
 .list-group-item > .badge + .badge,
 .list-group-item-heading > .badge + .badge {
   margin-right: 5px;
 }
 
-.badge-normal-size {
-  font-size: inherit;
-  letter-spacing: inherit;
-}
-
-.badge-tiny-height {
-  height: var(--tinyControlHeight) !important;
-  line-height: var(--tinyControlHeight) !important;
+.badge-info {
+  background-color: var(--alertBackgroundInfo);
+  color: var(--alertTextInfo);
 }
 
-.badge-new {
-  height: 18px;
-  font-size: var(--verySmallFontSize);
-  text-transform: uppercase;
-  background-color: var(--lightBlue);
-  color: var(--veryDarkBlue);
-  font-weight: 600;
+.badge-success {
+  background-color: var(--alertBackgroundSuccess);
+  color: var(--alertTextSuccess);
 }
 
-.badge-muted {
-  background-color: var(--gray80);
-  color: var(--secondFontColor);
+.badge-warning {
+  background-color: var(--alertBackgroundWarning);
+  color: var(--alertTextWarning);
 }
 
-.badge-success,
-.badge-ok {
-  background-color: var(--green);
-}
-
-.badge-warning,
-.badge-warn {
-  background-color: var(--orange);
-}
-
-.badge-danger,
 .badge-error {
-  background-color: var(--red);
-}
-
-.badge-danger-light {
-  border: 1px solid var(--alertBorderError) !important;
   background-color: var(--alertBackgroundError);
-  color: #a94442;
-}
-
-a.badge-danger-light:hover,
-a.badge-danger-light:focus,
-a.badge-danger-light:active {
-  color: #a94442;
-}
-
-.badge-focus {
-  border: 1px solid #faebcc;
-  background-color: #fcf8e3;
-  color: #8a6d3b;
-  font-weight: 400;
-}
-
-a.badge-focus:hover,
-a.badge-focus:focus,
-a.badge-focus:active {
-  color: #8a6d3b;
-}
-
-.badge-secondary {
-  background-color: var(--gray71);
-}
-
-.outline-badge {
-  display: inline-block;
-  vertical-align: middle;
-  height: var(--smallControlHeight);
-  line-height: calc(var(--smallControlHeight) - 1px);
-  padding: 0 var(--gridSize);
-  border: 1px solid var(--gray80);
-  border-radius: 10px;
-  box-sizing: border-box;
-  background-color: var(--gray80);
-  font-size: var(--smallFontSize);
-  font-weight: 400;
-  white-space: nowrap;
+  color: var(--alertTextError);
 }
 
-.outline-badge.active {
-  color: var(--baseFontColor);
-  border-color: var(--blue);
-  background-color: var(--lightBlue);
-}
-
-.outline-badge.badge-info {
-  border-color: var(--blue);
-  background-color: var(--lightBlue);
-}
-
-.outline-badge.badge-icon {
+/* TODO: remove after SC fork */
+.badge-icon {
   padding-left: calc(var(--gridSize) / 2);
 }
-
-.outline-badge.badge-icon svg {
+.badge-icon svg {
   height: calc(var(--smallControlHeight) - 2px);
 }
index 29c9402ed0ca2130f8b92ecdc278d19b5936d414..6baaa79bb2fd9deaa2fbff5c41f82fc98fa8d9d5 100644 (file)
@@ -39,7 +39,7 @@ export default function OrganizationCard({ organization }: Props) {
         <OrganizationLink className="spacer-left text-middle" organization={organization}>
           {organization.name}
         </OrganizationLink>
-        {actions.admin && <span className="outline-badge spacer-left">{translate('admin')}</span>}
+        {actions.admin && <span className="badge spacer-left">{translate('admin')}</span>}
       </h3>
 
       {!!organization.description && (
index 192907dd60f660f7f40df4a7a882983cfb3d800d..52818dcb0ee3ad3667b5d700c98f6b4b46059ef5 100644 (file)
@@ -43,13 +43,11 @@ export default function TaskStatus({ status }: Props) {
       break;
     case STATUSES.FAILED:
       inner = (
-        <span className="badge badge-danger">{translate('background_task.status.FAILED')}</span>
+        <span className="badge badge-error">{translate('background_task.status.FAILED')}</span>
       );
       break;
     case STATUSES.CANCELED:
-      inner = (
-        <span className="badge badge-muted">{translate('background_task.status.CANCELED')}</span>
-      );
+      inner = <span className="badge">{translate('background_task.status.CANCELED')}</span>;
       break;
     default:
       inner = '';
index 02e803cd51058d6409ec9170c4126c1ffbd25bd2..d4df3ea096127e1bbc00dc4e148a16bd88467f32 100644 (file)
@@ -35,7 +35,7 @@ exports[`renders 4`] = `
   className="thin spacer-right"
 >
   <span
-    className="badge badge-danger"
+    className="badge badge-error"
   >
     background_task.status.FAILED
   </span>
@@ -47,7 +47,7 @@ exports[`renders 5`] = `
   className="thin spacer-right"
 >
   <span
-    className="badge badge-muted"
+    className="badge"
   >
     background_task.status.CANCELED
   </span>
index bb08188fd70d4f3d6996f1966054d0067942b772..bea6c0a78c53c1c04880df4af9865a89d392d998 100644 (file)
@@ -69,8 +69,7 @@
 }
 
 @media (max-width: 1200px) {
-  .code-name-cell .badge,
-  .code-name-cell .outline-badge {
+  .code-name-cell .badge {
     display: none;
   }
 }
index ab46a4ec50ff35a0839b2698b8ab78851e7b12b3..7b1777b019fcbc6f07b6c2c3c78545cde24a2bd4 100644 (file)
@@ -119,9 +119,7 @@ export default function ComponentName({
             <span className="note">{component.branch}</span>
           </span>
         ) : (
-          <span className="spacer-left outline-badge flex-1">
-            {translate('branches.main_branch')}
-          </span>
+          <span className="spacer-left badge flex-1">{translate('branches.main_branch')}</span>
         )}
       </span>
     );
index ff35466d366cf184079ea67946db3e3556371598..df54b7a90a71b713ea254a4ff193f9e043bb44a3 100644 (file)
@@ -132,7 +132,7 @@ foo:src/index.tsx"
     </span>
   </span>
   <span
-    className="spacer-left outline-badge flex-1"
+    className="spacer-left badge flex-1"
   >
     branches.main_branch
   </span>
index d48523fafb15720280c974af3aa6ab43578d9886..16b33c164d730b098e4d2d6b33df0eb0593d74b1 100644 (file)
@@ -80,9 +80,7 @@ export default class RuleDetailsMeta extends React.PureComponent<Props> {
     return (
       <Tooltip overlay={translate('status')}>
         <li className="coding-rules-detail-property" data-meta="status">
-          <span className="badge badge-normal-size badge-danger-light">
-            {translate('rules.status', ruleDetails.status)}
-          </span>
+          <span className="badge badge-error">{translate('rules.status', ruleDetails.status)}</span>
         </li>
       </Tooltip>
     );
@@ -223,7 +221,7 @@ export default class RuleDetailsMeta extends React.PureComponent<Props> {
     return (
       <Tooltip overlay={translateWithParameters('coding_rules.external_rule.engine', engine)}>
         <li className="coding-rules-detail-property">
-          <div className="outline-badge badge-tiny-height spacer-left text-text-top">{engine}</div>
+          <div className="badge spacer-left text-text-top">{engine}</div>
         </li>
       </Tooltip>
     );
index 5fdd95ec7d64f2d3b3e778bfcb30956590cab31b..4bed1a8943b771c7f43bcd1426c7089f4023a427 100644 (file)
@@ -213,7 +213,7 @@ export default class RuleListItem extends React.PureComponent<Props> {
                   </Link>
                   {rule.isTemplate && (
                     <Tooltip overlay={translate('coding_rules.rule_template.title')}>
-                      <span className="outline-badge spacer-left">
+                      <span className="badge spacer-left">
                         {translate('coding_rules.rule_template')}
                       </span>
                     </Tooltip>
@@ -224,7 +224,7 @@ export default class RuleListItem extends React.PureComponent<Props> {
               <td className="coding-rule-table-meta-cell">
                 <div className="display-flex-center coding-rule-meta">
                   {rule.status !== 'READY' && (
-                    <span className="spacer-left badge badge-normal-size badge-tiny-height badge-danger-light">
+                    <span className="spacer-left badge badge-error">
                       {translate('rules.status', rule.status)}
                     </span>
                   )}
index ed9ef8943529c36c54410209002702614dea3f79..be77ee6e3b214e6f1888b0a91f7c4101ce61df21 100644 (file)
@@ -265,7 +265,7 @@ exports[`should display right meta info 3`] = `
         className="coding-rules-detail-property"
       >
         <div
-          className="outline-badge badge-tiny-height spacer-left text-text-top"
+          className="badge spacer-left text-text-top"
         >
           xoo
         </div>
index 6e29e3a9095f462dc3ec483f477837d5e759e80b..4f8271724dd44ca13af3e89e221b230f95877de8 100644 (file)
@@ -80,7 +80,7 @@ export default class ComponentCell extends React.PureComponent<Props> {
                 <span className="note">{component.branch}</span>
               </>
             ) : (
-              <span className="spacer-left outline-badge">{translate('branches.main_branch')}</span>
+              <span className="spacer-left badge">{translate('branches.main_branch')}</span>
             )}
           </>
         )}
index af551bf825b5a0c338da214c4f5cb6eff1a42086..9ff35a2df0f9cb48e6587b44ed6830fdf54736d6 100644 (file)
@@ -77,9 +77,7 @@ export function getOptionRenderer(hideIcons?: boolean) {
           {organization.name}
           <span className="note little-spacer-left">{organization.key}</span>
         </span>
-        {isPaidOrg && (
-          <div className="outline-badge">{translate('organization.paid_plan.badge')}</div>
-        )}
+        {isPaidOrg && <div className="badge">{translate('organization.paid_plan.badge')}</div>}
       </div>
     );
   };
index 7063e40b4517245187cfe03e05cec47752d882eb..4b1964f7c05970e9f77c2ef5c65d24da1a041519 100644 (file)
@@ -95,7 +95,7 @@ export default class AlmRepositoryItem extends React.PureComponent<Props> {
               />
               <span className="spacer-left">{this.props.repository.label}</span>
               {repository.private && (
-                <div className="outline-badge spacer-left">{translate('visibility.private')}</div>
+                <div className="badge spacer-left">{translate('visibility.private')}</div>
               )}
             </div>
 
index 12bde76d9dc68098957f4aa15011c2b5c34b951f..4ac954219d5e40cdb737f9991ffd0cbecdb8ef92 100644 (file)
@@ -165,7 +165,7 @@ exports[`should render private repositories 1`] = `
           Awesome Project
         </span>
         <div
-          className="outline-badge spacer-left"
+          className="badge spacer-left"
         >
           visibility.private
         </div>
index 5dca58a6fcc153b926b18935e5863f2d778be9b6..893fae2e9f92324336ae2aece73731a9e8f228fc 100644 (file)
@@ -53,7 +53,7 @@ export default function OrganizationNavigationMeta({
           <DocTooltip
             className="spacer-right"
             doc={import(/* webpackMode: "eager" */ 'Docs/tooltips/organizations/subscription-paid-plan.md')}>
-            <div className="outline-badge">{translate('organization.paid_plan.badge')}</div>
+            <div className="badge">{translate('organization.paid_plan.badge')}</div>
           </DocTooltip>
         )}
       <div className="text-muted">
index 6dc8f5e82a8106d16c41bcfd4757588b8af3a2a8..b35f229419a8f5d027ca9e6430f764c9efd62bc5 100644 (file)
@@ -167,7 +167,7 @@ export default class BranchRow extends React.PureComponent<Props, State> {
           />
           {getBranchLikeDisplayName(branchLike)}
           {isMainBranch(branchLike) && (
-            <div className="outline-badge spacer-left">{translate('branches.main_branch')}</div>
+            <div className="badge spacer-left">{translate('branches.main_branch')}</div>
           )}
         </td>
         <td className="thin nowrap">
index 800b10d0601c756381f324f86d344e9b078d04e8..498bdbe9ab8b92804c164e401e3254cc039c100d 100644 (file)
@@ -14,7 +14,7 @@ exports[`renders main branch 1`] = `
     />
     master
     <div
-      className="outline-badge spacer-left"
+      className="badge spacer-left"
     >
       branches.main_branch
     </div>
index cca68961575467ff144c8405c7e29a0b9eed647e..9acb218d71c87ac08fe8fb24a79392c5735b2fd0 100644 (file)
@@ -27,16 +27,10 @@ interface Props {
 }
 
 export default function BuiltInQualityGateBadge({ className }: Props) {
-  const badge = (
-    <div className={classNames('outline-badge', className)}>
-      {translate('quality_gates.built_in')}
-    </div>
-  );
-
   return (
     <DocTooltip
       doc={import(/* webpackMode: "eager" */ 'Docs/tooltips/quality-gates/built-in-quality-gate.md')}>
-      {badge}
+      <div className={classNames('badge', className)}>{translate('quality_gates.built_in')}</div>
     </DocTooltip>
   );
 }
diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/BuiltInQualityGateBadge-test.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/__tests__/BuiltInQualityGateBadge-test.tsx
new file mode 100644 (file)
index 0000000..4998f68
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2019 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+import { shallow } from 'enzyme';
+import * as React from 'react';
+import BuiltInQualityGateBadge from '../BuiltInQualityGateBadge';
+
+it('should render correctly', () => {
+  expect(shallowRender()).toMatchSnapshot();
+});
+
+function shallowRender(props = {}) {
+  return shallow(<BuiltInQualityGateBadge {...props} />);
+}
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
new file mode 100644 (file)
index 0000000..76f55d5
--- /dev/null
@@ -0,0 +1,13 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<DocTooltip
+  doc={Promise {}}
+>
+  <div
+    className="badge"
+  >
+    quality_gates.built_in
+  </div>
+</DocTooltip>
+`;
index b8dcedb1c3f0fb513c1246bca67de390cd8d6dda..58afabbc5abac2bfbd8170ed1f5a1ea9f5277b5b 100644 (file)
@@ -29,7 +29,7 @@ interface Props {
 
 export default function BuiltInQualityProfileBadge({ className, tooltip = true }: Props) {
   const badge = (
-    <div className={classNames('outline-badge', className)}>
+    <div className={classNames('badge badge-info', className)}>
       {translate('quality_profiles.built_in')}
     </div>
   );
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/BuiltInQualityProfileBadge-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/BuiltInQualityProfileBadge-test.tsx
new file mode 100644 (file)
index 0000000..eaec6df
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2019 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+import { shallow } from 'enzyme';
+import * as React from 'react';
+import BuiltInQualityProfileBadge from '../BuiltInQualityProfileBadge';
+
+it('should render correctly', () => {
+  expect(shallowRender()).toMatchSnapshot();
+  expect(shallowRender({ tooltip: false })).toMatchSnapshot();
+});
+
+function shallowRender(props = {}) {
+  return shallow(<BuiltInQualityProfileBadge {...props} />);
+}
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/__snapshots__/BuiltInQualityProfileBadge-test.tsx.snap b/server/sonar-web/src/main/js/apps/quality-profiles/components/__tests__/__snapshots__/BuiltInQualityProfileBadge-test.tsx.snap
new file mode 100644 (file)
index 0000000..a5171e5
--- /dev/null
@@ -0,0 +1,21 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<DocTooltip
+  doc={Promise {}}
+>
+  <div
+    className="badge badge-info"
+  >
+    quality_profiles.built_in
+  </div>
+</DocTooltip>
+`;
+
+exports[`should render correctly 2`] = `
+<div
+  className="badge badge-info"
+>
+  quality_profiles.built_in
+</div>
+`;
index fbafb80a7de4ba8649758c912be3ff2d2cdc23d4..8c36db28cbce6857febfff646a1d401aac3bd870 100644 (file)
@@ -95,7 +95,7 @@ export default class ProfilesListRow extends React.PureComponent<Props> {
         {profile.activeDeprecatedRuleCount > 0 && (
           <span className="spacer-right">
             <Tooltip overlay={translate('quality_profiles.deprecated_rules')}>
-              <Link className="badge badge-normal-size badge-danger-light" to={deprecatedRulesUrl}>
+              <Link className="badge badge-error" to={deprecatedRulesUrl}>
                 {profile.activeDeprecatedRuleCount}
               </Link>
             </Tooltip>
index 94beebfeff4df767d82936e1c3ce6fb14c153597..a05106bf35165bc882bfccfb79ba0ff0bd871511 100644 (file)
@@ -288,7 +288,7 @@ export default class AnalyzeTutorialSonarCloud extends React.PureComponent<Props
             {isAutoScanEnabled && (
               <div className={`${getClassnames(autoScanMode)} huge-spacer-top huge-spacer-bottom`}>
                 <div className="icon">
-                  <div className="badge badge-new">BETA</div>
+                  <div className="badge badge-info">BETA</div>
                 </div>
                 <p>{autoScanMode.name}</p>
                 <button
index 777e9501b593ca94a77ad074a64490d585d30902..5a58e7ecf54328a76fedf9abe031a0f451d99d08 100644 (file)
@@ -103,7 +103,7 @@ exports[`renders for GitHub 1`] = `
           className="icon"
         >
           <div
-            className="badge badge-new"
+            className="badge badge-info"
           >
             BETA
           </div>
index 0259922365d06cd95589bc495ab9682cbae3b6ae..8c0e398274c61070d23b9fc86ae16f259c44974a 100644 (file)
@@ -24,7 +24,7 @@ import { translate } from 'sonar-ui-common/helpers/l10n';
 export default function InternalBadge() {
   return (
     <Tooltip overlay={translate('api_documentation.internal_tooltip')}>
-      <span className="badge badge-danger">{translate('internal')}</span>
+      <span className="badge badge-error">{translate('internal')}</span>
     </Tooltip>
   );
 }
index 4f8235b099f3b8340133c3979a0aa8afe2c8458a..00fa3a13c89798462b706f62c01f22f48e34c87f 100644 (file)
@@ -76,7 +76,7 @@ export function PrivacyBadge({
 
   const badge = (
     <div
-      className={classNames('outline-badge', className, {
+      className={classNames('badge', className, {
         'badge-info': Boolean(icon),
         'badge-icon': Boolean(icon)
       })}>
index 87309d6a317161be11edcda1361a4864ad825961..f6aec9bf389ae1da93a17ce09abe8fc467e5a2bf 100644 (file)
@@ -7,7 +7,7 @@ exports[`renders 1`] = `
   overlay="visibility.private.description.TRK"
 >
   <div
-    className="outline-badge"
+    className="badge"
   >
     visibility.private
   </div>
@@ -24,7 +24,7 @@ exports[`renders public 1`] = `
   }
 >
   <div
-    className="outline-badge"
+    className="badge"
   >
     visibility.public
   </div>
@@ -41,7 +41,7 @@ exports[`renders public with icon 1`] = `
   }
 >
   <div
-    className="outline-badge badge-info badge-icon"
+    className="badge badge-info badge-icon"
   >
     <VisibleIcon
       className="little-spacer-right"
index 9b50252859f56906f8134aaf7d45c4cefdbd8509..a1b3a15ece29515c4d142af19e7769aa7e5b2de9 100644 (file)
@@ -60,7 +60,7 @@ export default class FacetHeader extends React.PureComponent<Props> {
     const value =
       values.length === 1 ? values[0] : translateWithParameters('x_selected', values.length);
     return (
-      <span className="badge badge-secondary text-ellipsis" title={value}>
+      <span className="badge text-ellipsis" title={value}>
         {value}
       </span>
     );
index d0b3085bc686bb0d90fdde4a672411b308df98ae..04208a3c2decdb0bc8a0779a3a8f83d7328aa4d8 100644 (file)
@@ -22,7 +22,7 @@ exports[`should clear 1`] = `
     className="search-navigator-facet-header-value spacer-left spacer-right "
   >
     <span
-      className="badge badge-secondary text-ellipsis"
+      className="badge text-ellipsis"
       title="x_selected.3"
     >
       x_selected.3
@@ -59,7 +59,7 @@ exports[`should render closed facet with value 1`] = `
     className="search-navigator-facet-header-value spacer-left spacer-right "
   >
     <span
-      className="badge badge-secondary text-ellipsis"
+      className="badge text-ellipsis"
       title="foo"
     >
       foo
@@ -114,7 +114,7 @@ exports[`should render open facet with value 1`] = `
     className="search-navigator-facet-header-value spacer-left spacer-right "
   >
     <span
-      className="badge badge-secondary text-ellipsis"
+      className="badge text-ellipsis"
       title="foo"
     >
       foo
index dbc965ea924c5e3e717ba4781beddc281c92ce58..dba797fae45c99e19bff8e84d72e5a123c7fff77 100644 (file)
@@ -53,14 +53,12 @@ export default class IssueMessage extends React.PureComponent<Props> {
         {this.props.engine && (
           <Tooltip
             overlay={translateWithParameters('issue.from_external_rule_engine', this.props.engine)}>
-            <div className="outline-badge badge-tiny-height spacer-right text-top">
-              {this.props.engine}
-            </div>
+            <div className="badge spacer-right text-top">{this.props.engine}</div>
           </Tooltip>
         )}
         {this.props.manualVulnerability && (
           <Tooltip overlay={translate('issue.manual_vulnerability.description')}>
-            <div className="outline-badge badge-tiny-height spacer-right text-top">
+            <div className="badge spacer-right text-top">
               {translate('issue.manual_vulnerability')}
             </div>
           </Tooltip>
index 53285415dea2b0cf74180beb6cab8aa4b7532f5d..d72628271d182a4b33f4e018c42a6526e62d0eac 100644 (file)
@@ -35,7 +35,7 @@ export default function OrganizationListItem({ organization }: Props) {
           <OrganizationAvatar organization={organization} small={true} />
           <span className="spacer-left">{organization.name}</span>
         </div>
-        {actions.admin && <span className="outline-badge spacer-left">{translate('admin')}</span>}
+        {actions.admin && <span className="badge spacer-left">{translate('admin')}</span>}
       </OrganizationLink>
     </li>
   );
index da344815e73cd38f73bbbc6ecc57a9352dc870ce..a2f7dde9ca03c45cf2b146cfe496e71c1f7836c7 100644 (file)
@@ -36,7 +36,7 @@ exports[`renders 1`] = `
       </span>
     </div>
     <span
-      className="outline-badge spacer-left"
+      className="badge spacer-left"
     >
       admin
     </span>