]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7227 improve overall rendering
authorStas Vilchik <vilchiks@gmail.com>
Wed, 27 Jan 2016 12:18:47 +0000 (13:18 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Thu, 28 Jan 2016 15:14:24 +0000 (16:14 +0100)
server/sonar-web/src/main/js/apps/account/app.js
server/sonar-web/src/main/js/apps/account/components/FavoriteIssueFilters.js
server/sonar-web/src/main/js/apps/account/components/FavoriteMeasureFilters.js
server/sonar-web/src/main/js/apps/account/components/Favorites.js
server/sonar-web/src/main/js/apps/account/components/Home.js
server/sonar-web/src/main/js/apps/account/components/Nav.js
server/sonar-web/src/main/js/apps/account/components/Notifications.js
server/sonar-web/src/main/js/apps/account/components/UserCard.js
server/sonar-web/src/main/js/apps/account/containers/AccountApp.js
server/sonar-web/src/main/js/apps/account/styles/account.css [new file with mode: 0644]

index fe969e8ad7d511f1ca537046f0288b2214ef6181..dc52a4fc013f50b11c87fddb45432e97f4b8bd77 100644 (file)
@@ -29,6 +29,8 @@ import Home from './components/Home';
 import NotificationsContainer from './containers/NotificationsContainer';
 import SecurityContainer from './containers/SecurityContainer';
 
+import './styles/account.css';
+
 window.sonarqube.appStarted.then(options => {
   const el = document.querySelector(options.el);
 
@@ -38,9 +40,6 @@ window.sonarqube.appStarted.then(options => {
 
   const store = configureStore();
 
-  document.querySelector('html').classList.add('dashboard-page');
-  document.querySelector('#container').classList.add('page-wrapper-context');
-
   render((
       <Provider store={store}>
         <Router history={history}>
index 80cbac9d451f59b620af8832fef3414beeeb13a6..2069cb15bc6e456316de7ca36cfd65339cd11519 100644 (file)
@@ -22,7 +22,7 @@ import React from 'react';
 import { translate } from '../../../helpers/l10n';
 
 const FavoriteIssueFilters = ({ issueFilters }) => (
-    <section className="big-spacer-bottom">
+    <section className="huge-spacer-top">
       <h2 className="spacer-bottom">
         {translate('my_account.favorite_issue_filters')}
       </h2>
index 3e528ed2cd9f1edfd60c89358ebf138ade0b5550..30ade911282522d7d270bcd7c3bf438e7039eabd 100644 (file)
@@ -22,7 +22,7 @@ import React from 'react';
 import { translate } from '../../../helpers/l10n';
 
 const FavoriteMeasureFilters = ({ measureFilters }) => (
-    <section className="big-spacer-bottom">
+    <section className="huge-spacer-top">
       <h2 className="spacer-bottom">
         {translate('my_account.favorite_measure_filters')}
       </h2>
index 5466066a8033510e9563328f8b3d79e6da2267c7..a4e4b0445202edcf1243b524fb64bee9607d60de 100644 (file)
@@ -25,7 +25,7 @@ import { translate } from '../../../helpers/l10n';
 import { getComponentUrl } from '../../../helpers/urls';
 
 const Favorites = ({ favorites }) => (
-    <section className="big-spacer-bottom">
+    <section>
       <h2 className="spacer-bottom">
         {translate('my_account.favorite_components')}
       </h2>
index f9a76bf27f92980c04cdaa357abc33aa99229f83..1c22bfb81a88c7140a872de646f3ed730762a74e 100644 (file)
  */
 import React from 'react';
 
-import UserCard from './UserCard';
 import Favorites from './Favorites';
 import FavoriteIssueFilters from './FavoriteIssueFilters';
 import FavoriteMeasureFilters from './FavoriteMeasureFilters';
+import { translate } from '../../../helpers/l10n';
 
 const Home = ({ user, favorites, issueFilters, measureFilters }) => (
     <div>
-      <UserCard user={user}/>
-      <div className="overflow-hidden">
-        <Favorites favorites={favorites}/>
-        {issueFilters && <FavoriteIssueFilters issueFilters={issueFilters}/>}
-        {measureFilters && <FavoriteMeasureFilters measureFilters={measureFilters}/>}
+      <div className="columns">
+        <div className="column-third">
+          <Favorites favorites={favorites}/>
+          {issueFilters && <FavoriteIssueFilters issueFilters={issueFilters}/>}
+          {measureFilters && <FavoriteMeasureFilters measureFilters={measureFilters}/>}
+        </div>
+
+        <div className="column-third">
+          <section>
+            <h2 className="spacer-bottom">{translate('issues.page')}</h2>
+            <p>Some cool issue widgets go here...</p>
+          </section>
+        </div>
+
+        <div className="column-third">
+          <section>
+            <h2 className="spacer-bottom">{translate('my_profile.groups')}</h2>
+            <ul id="groups">
+              {user.groups.map(group => (
+                  <li
+                      key={group}
+                      className="little-spacer-bottom text-ellipsis"
+                      title={group}>
+                    {group}
+                  </li>
+              ))}
+            </ul>
+          </section>
+
+          <section className="huge-spacer-top">
+            <h2 className="spacer-bottom">{translate('my_profile.scm_accounts')}</h2>
+            <ul id="scm-accounts">
+              {user.scmAccounts.map(scmAccount => (
+                  <li
+                      key={scmAccount}
+                      className="little-spacer-bottom text-ellipsis"
+                      title={scmAccount}>
+                    {scmAccount}
+                  </li>
+              ))}
+            </ul>
+          </section>
+        </div>
       </div>
     </div>
 );
index 4a49e1f752051a20b374033e99824bd09d265103..fe826c181845b7a1d62beb78a1b8f66f551135c8 100644 (file)
 import React from 'react';
 import { IndexLink } from 'react-router';
 
+import UserCard from './UserCard';
 import { translate } from '../../../helpers/l10n';
 
-const Nav = () => (
-    <nav className="navbar navbar-context page-container">
-      <div className="container">
-        <ul className="nav navbar-nav nav-crumbs">
-          <li>
-            <IndexLink to="/" activeClassName="active">
-              {translate('my_account.page')}
-            </IndexLink>
-          </li>
-        </ul>
+const Nav = ({ user }) => (
+    <header className="account-header">
+      <UserCard user={user}/>
+
+      <nav className="account-nav clearfix">
         <ul className="nav navbar-nav nav-tabs">
           <li>
             <IndexLink to="/" activeClassName="active">
@@ -49,8 +45,8 @@ const Nav = () => (
             </IndexLink>
           </li>
         </ul>
-      </div>
-    </nav>
+      </nav>
+    </header>
 );
 
 export default Nav;
index 45a9d5839ebd3502323fa3148f8efb7cefbd8fc5..75784ae9aa1caf924e5ccc09545f75f8c7fe5fae 100644 (file)
@@ -28,7 +28,7 @@ export default function Notifications ({ globalNotifications, projectNotificatio
 
   return (
       <div>
-        <p className="big-spacer-bottom">
+        <p className="spacer-top big-spacer-bottom">
           {translate('notification.dispatcher.information')}
         </p>
         <form id="notif_form" method="post" action={`${window.baseUrl}/account/update_notifications`}>
index 327ab9e5b0253b230385bcb4908cf70a25585131..74d120e79427ad8c73ddd97f8dee597f2f620a63 100644 (file)
 import React from 'react';
 
 import Avatar from '../../../components/shared/avatar';
-import { translate } from '../../../helpers/l10n';
 
-const UserCard = ({ user }) => (
-    <div className="pull-left big-spacer-right abs-width-240">
-      <div className="panel panel-white">
-        <div className="text-center">
-          <div id="avatar" className="big-spacer-bottom">
-            <Avatar email={user.email} size={100}/>
-          </div>
-          <h2 id="name" className="text-ellipsis" title={user.name}>{user.name}</h2>
-          <p id="login" className="note text-ellipsis" title={user.login}>{user.login}</p>
-          <div className="text-center spacer-top">
-            <p id="email" className="text-ellipsis" title={user.email}>{user.email}</p>
-          </div>
+export default function UserCard ({ user }) {
+  return (
+      <section className="account-user clearfix">
+        <div id="avatar" className="account-nav-avatar">
+          <Avatar email={user.email} size={48}/>
         </div>
-
-        <div className="big-spacer-top">
-          <h3 className="text-center">{translate('my_profile.groups')}</h3>
-          <ul id="groups">
-            {user.groups.map(group => (
-                <li key={group} className="text-ellipsis" title={group}>{group}</li>
-            ))}
-          </ul>
-        </div>
-
-        <div className="big-spacer-top">
-          <h3 className="text-center">{translate('my_profile.scm_accounts')}</h3>
-          <ul id="scm-accounts">
-            {user.scmAccounts.map(scmAccount => (
-                <li key={scmAccount} className="text-ellipsis" title={scmAccount}>{scmAccount}</li>
-            ))}
-          </ul>
+        <div>
+          <h1 id="name" className="display-inline-block">{user.name}</h1>
+          <span id="login" className="note big-spacer-left">{user.login}</span>
         </div>
-      </div>
-    </div>
-);
-
-export default UserCard;
+        <div id="email" className="little-spacer-top">{user.email}</div>
+      </section>
+  );
+}
index 6325b562420ae7564d2874d9cfad408ab8dde9bb..967e686843c63d4ed2aa96ad2b1de410bf56daa9 100644 (file)
@@ -48,7 +48,7 @@ export default class AccountApp extends Component {
 
     return (
         <div>
-          <Nav/>
+          <Nav user={user}/>
           <div className="page">
             {children}
           </div>
diff --git a/server/sonar-web/src/main/js/apps/account/styles/account.css b/server/sonar-web/src/main/js/apps/account/styles/account.css
new file mode 100644 (file)
index 0000000..e308d92
--- /dev/null
@@ -0,0 +1,20 @@
+.account-header {
+  background-color: #f3f3f3;
+}
+
+.account-nav {
+
+}
+
+.account-nav .nav-tabs {
+  width: 100%;
+}
+
+.account-user {
+  padding: 10px;
+}
+
+.account-nav-avatar {
+  float: left;
+  margin-right: 20px;
+}