]> source.dussan.org Git - sonarqube.git/commitdiff
conditionally load component for sonarcloud notifications
authorStas Vilchik <stas.vilchik@sonarsource.com>
Fri, 28 Dec 2018 09:52:30 +0000 (10:52 +0100)
committerSonarTech <sonartech@sonarsource.com>
Mon, 7 Jan 2019 19:21:00 +0000 (20:21 +0100)
server/sonar-web/src/main/js/app/components/GlobalContainer.tsx
server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.css
server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx
server/sonar-web/src/main/js/app/components/notifications/notifications.css
server/sonar-web/src/main/js/app/styles/sonarcloud.css [deleted file]
server/sonar-web/src/main/js/apps/account/notifications/GlobalNotifications.tsx
server/sonar-web/src/main/js/apps/account/notifications/SonarCloudNotifications.tsx
server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/GlobalNotifications-test.tsx.snap
server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/SonarCloudNotifications-test.tsx.snap

index 98b5a1a9c889e6c75acea93ff928412aa83e8f1e..cd7623acb3da9d46cb7add7e557003d63d162866 100644 (file)
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
-import * as classNames from 'classnames';
 import GlobalNav from './nav/global/GlobalNav';
 import StartupModal from './StartupModal';
 import GlobalFooterContainer from './GlobalFooterContainer';
 import GlobalMessagesContainer from './GlobalMessagesContainer';
 import SuggestionsProvider from './embed-docs-modal/SuggestionsProvider';
 import Workspace from '../../components/workspace/Workspace';
-import { isSonarCloud } from '../../helpers/system';
-import '../styles/sonarcloud.css';
 
 interface Props {
   children: React.ReactNode;
@@ -40,7 +37,7 @@ export default function GlobalContainer(props: Props) {
   return (
     <SuggestionsProvider>
       <StartupModal>
-        <div className={classNames('global-container', { sonarcloud: isSonarCloud() })}>
+        <div className="global-container">
           <div className="page-wrapper" id="container">
             <div className="page-container">
               <Workspace>
index e68d2c3712b4a7e7e9734cf29026b39c910155d1..68a6d44e9ab1443f3f5daacb8778d070f5dedbe7 100644 (file)
 }
 
 .global-navbar-menu-right .navbar-search {
-  flex: 0 1 310px; /* Workaround for SONAR-10971 */
+  flex: 0 1 240px; /* Workaround for SONAR-10971 */
   min-width: 0;
 }
 
index c3c8b36cff57727b55a81a3169f5961071115737..732e536022a7200f5e8dbb27308cf75bb004ce3d 100644 (file)
@@ -23,8 +23,6 @@ import GlobalNavBranding, { SonarCloudNavBranding } from './GlobalNavBranding';
 import GlobalNavMenu from './GlobalNavMenu';
 import GlobalNavExplore from './GlobalNavExplore';
 import GlobalNavUserContainer from './GlobalNavUserContainer';
-import NotificationsSidebar from '../../notifications/NotificationsSidebar';
-import NavLatestNotification from '../../notifications/NavLatestNotification';
 import Search from '../../search/Search';
 import EmbedDocsPopupHelper from '../../embed-docs-modal/EmbedDocsPopupHelper';
 import * as theme from '../../../theme';
@@ -46,10 +44,18 @@ import { isSonarCloud } from '../../../../helpers/system';
 import { isLoggedIn } from '../../../../helpers/users';
 import { OnboardingContext } from '../../OnboardingContext';
 import { setCurrentUserSetting } from '../../../../store/users';
-import './GlobalNav.css';
 import { parseDate } from '../../../../helpers/dates';
+import './GlobalNav.css';
 
 const GlobalNavPlus = lazyLoad(() => import('./GlobalNavPlus'), 'GlobalNavPlus');
+const NotificationsSidebar = lazyLoad(
+  () => import('../../notifications/NotificationsSidebar'),
+  'NotificationsSidebar'
+);
+const NavLatestNotification = lazyLoad(
+  () => import('../../notifications/NavLatestNotification'),
+  'NavLatestNotification'
+);
 
 interface Props {
   accessToken?: string;
index 472732afabb6876f03a328aeb4a3e260ffab2ad0..0f2209127e4a22b95e8143b67e1fe01e40e968e4 100644 (file)
@@ -18,7 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 .navbar-latest-notification {
-  flex: 0 1 380px;
+  flex: 0 1 240px;
   text-align: right;
   overflow: hidden;
 }
diff --git a/server/sonar-web/src/main/js/app/styles/sonarcloud.css b/server/sonar-web/src/main/js/app/styles/sonarcloud.css
deleted file mode 100644 (file)
index 98a5a2d..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.
- */
-.sonarcloud .global-navbar-menu-right .navbar-search {
-  flex: 0 0 310px;
-}
-
-.sonarcloud table.form {
-  width: 100%;
-}
-
-.sonarcloud table.form tr,
-.sonarcloud table.form td {
-  vertical-align: middle;
-}
-
-.sonarcloud table.form tr:first-child,
-.sonarcloud table.form td:first-child {
-  width: 450px;
-}
-
-.sonarcloud table.form tbody tr:nth-child(2n) {
-  background: var(--sonarcloudBlack200);
-}
index 54618d37030fc47422706f31b3d3af65ea870e84..973f7c1f94b9b53dcd8fb9ddf3e7d617d689d791 100644 (file)
@@ -38,7 +38,7 @@ export default function GlobalNotifications(props: Props) {
         <h2>{translate('my_profile.overall_notifications.title')}</h2>
 
         <div className="boxed-group-inner">
-          <table className="form">
+          <table className="data zebra">
             <thead>
               <tr>
                 <th />
index 29a50549b52065fd46cd93e3a1b82bb18337f826..5eb942f8745af99f9abd26af895b3eab8e11e2b2 100644 (file)
@@ -42,7 +42,7 @@ export class SonarCloudNotifications extends React.PureComponent<Props> {
       <section className="boxed-group">
         <h2>{translate('my_profile.sonarcloud_feature_notifications.title')}</h2>
         <div className="boxed-group-inner">
-          <table className="form">
+          <table className="data zebra">
             <thead>
               <tr>
                 <th />
index ecd10ebc9feb5014662bf77540d1690c1e4efbe3..2eb1e232053879bf01031dd21fbb684c4eb00024 100644 (file)
@@ -12,7 +12,7 @@ exports[`should match snapshot 1`] = `
       className="boxed-group-inner"
     >
       <table
-        className="form"
+        className="data zebra"
       >
         <thead>
           <tr>
@@ -86,7 +86,7 @@ exports[`should show SonarCloud options if in SC context 1`] = `
       className="boxed-group-inner"
     >
       <table
-        className="form"
+        className="data zebra"
       >
         <thead>
           <tr>
index 571bf1aaca8027c59bdd435de3d9b209597f0013..f70cefb6e587c3aed1788bcd2bbabbf6bcea7bd9 100644 (file)
@@ -11,7 +11,7 @@ exports[`should match snapshot 1`] = `
     className="boxed-group-inner"
   >
     <table
-      className="form"
+      className="data zebra"
     >
       <thead>
         <tr>