From b815ace63bf5ad05778734bcfab9a8191d164098 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Thu, 2 Feb 2017 10:24:30 +0100 Subject: [PATCH] fix display of organizations --- .../components/nav/component/ComponentNav.css | 16 ------- .../components/nav/component/ComponentNav.js | 1 - .../nav/component/ComponentNavBreadcrumbs.js | 37 ++++++++++------ .../ComponentNavBreadcrumbs-test.js.snap | 40 ++++++++++-------- .../nav/templates/nav-search-item.hbs | 12 +++--- .../components/TaskComponent.js | 11 ++--- .../issues-workspace-list-component.hbs | 6 +-- .../navigation/OrganizationNavigation.js | 12 +++--- .../OrganizationNavigation-test.js.snap | 42 ++++++++++--------- .../src/main/less/components/navbar.less | 31 +++++++++++++- server/sonar-web/src/main/less/init/misc.less | 4 +- 11 files changed, 121 insertions(+), 91 deletions(-) delete mode 100644 server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.css diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.css b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.css deleted file mode 100644 index 59d210c9534..00000000000 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.css +++ /dev/null @@ -1,16 +0,0 @@ -.navbar-context { - position: static; - padding: 0; - height: 65px; -} - -.navbar-context-inner { - position: fixed; - z-index: 420; - left: 0; - right: 0; - height: 65px; - padding-top: 5px; - box-sizing: border-box; - background-color: #f3f3f3; -} diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.js b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.js index 303a45c6cc1..916dbe12726 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.js +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNav.js @@ -26,7 +26,6 @@ import RecentHistory from './RecentHistory'; import { TooltipsContainer } from '../../../../components/mixins/tooltips-mixin'; import { getTasksForComponent } from '../../../../api/ce'; import { STATUSES } from '../../../../apps/background-tasks/constants'; -import './ComponentNav.css'; export default React.createClass({ componentDidMount () { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBreadcrumbs.js b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBreadcrumbs.js index c787efb5bca..3f09a2c637b 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBreadcrumbs.js +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBreadcrumbs.js @@ -36,27 +36,40 @@ class ComponentNavBreadcrumbs extends React.Component { return null; } - const items = breadcrumbs.map(item => { + const lastItem = breadcrumbs[breadcrumbs.length - 1]; + + const items = breadcrumbs.map((item, index) => { return ( -
  • - - - {' '} - {item.name} + + + {index === breadcrumbs.length - 1 ? ( + {item.name} + ) : ( + {item.name} + )} -
  • + {index < breadcrumbs.length - 1 && ( + + )} + ); }); return ( - + ); } } diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBreadcrumbs-test.js.snap b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBreadcrumbs-test.js.snap index 19ad1cd2856..40c7c51d3b3 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBreadcrumbs-test.js.snap +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBreadcrumbs-test.js.snap @@ -1,8 +1,9 @@ exports[`test should not render breadcrumbs with one element 1`] = ` - + + `; exports[`test should render organization 1`] = ` - + + `; diff --git a/server/sonar-web/src/main/js/app/components/nav/templates/nav-search-item.hbs b/server/sonar-web/src/main/js/app/components/nav/templates/nav-search-item.hbs index 890643d9237..185169fdbda 100644 --- a/server/sonar-web/src/main/js/app/components/nav/templates/nav-search-item.hbs +++ b/server/sonar-web/src/main/js/app/components/nav/templates/nav-search-item.hbs @@ -8,6 +8,12 @@ {{/notNull}} + {{#if organization}} +
    + {{organization.name}} +
    + {{/if}} + {{#if icon}}{{/if}} {{#if q}}{{qualifierIcon q}}{{/if}} {{#eq q 'FIL'}} @@ -19,10 +25,4 @@ {{name}} {{/eq}} {{/eq}} - - {{#if organization}} -
    - {{organization.name}} -
    - {{/if}}
    diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.js b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.js index c76ad724cbb..b72f02ed758 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.js @@ -47,15 +47,16 @@ export default class TaskComponent extends React.Component { return ( + + + + {task.organization != null && ( )} - - - - - {task.componentName} + + {task.componentName} {types.length > 1 && ( diff --git a/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-list-component.hbs b/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-list-component.hbs index cd604d2a4a6..f1c12ffb491 100644 --- a/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-list-component.hbs +++ b/server/sonar-web/src/main/js/apps/issues/templates/issues-workspace-list-component.hbs @@ -7,18 +7,18 @@ {{/notNull}} - {{qualifierIcon "TRK"}}{{projectLongName}} + {{projectLongName}} {{#if subProject}} - {{qualifierIcon "TRK"}}{{subProjectLongName}} + {{subProjectLongName}} {{/if}} - {{qualifierIcon componentQualifier}}{{collapsePath componentLongName}} + {{collapsePath componentLongName}} diff --git a/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js b/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js index a167596b06f..eff625b4fac 100644 --- a/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js +++ b/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigation.js @@ -86,13 +86,11 @@ export default class OrganizationNavigation extends React.Component {