const visualization = query.visualization || 'risk';
const selectedSort = query.sort || 'name';
- const top = (organization ? 95 : 30) + (optionBarOpen ? 45 : 0);
+ const sideBarTop = (organization ? 95 : 30) + (optionBarOpen ? 45 : 0);
+ const contentTop = optionBarOpen ? 65 : 20;
return (
<div>
<div className="layout-page projects-page">
<div className="layout-page-side-outer">
- <div className="layout-page-side projects-page-side" style={{ top }}>
+ <div className="layout-page-side projects-page-side" style={{ top: sideBarTop }}>
<div className="layout-page-side-inner">
<div className="layout-page-filters">
<PageSidebar
</div>
</div>
- <div className="layout-page-main">
+ <div
+ className="layout-page-main projects-page-content"
+ style={{ paddingTop: contentTop }}>
<div className="layout-page-main-inner">
<PageHeaderContainer
query={query}
isFavorite={isFavorite}
organization={organization}
onOpenOptionBar={this.openOptionBar}
+ optionBarOpen={optionBarOpen}
/>
{view !== 'visualizations' &&
<ProjectsListContainer
isFavorite?: boolean,
loading: boolean,
onOpenOptionBar: () => void,
+ optionBarOpen?: boolean,
organization?: { key: string },
query: { [string]: string },
total?: number
query={props.query}
/>
<div className="page-actions projects-page-actions text-right">
- <div className="spacer-bottom">
- <a className="button js-projects-topbar-open" href="#" onClick={props.onOpenOptionBar}>
+ {!props.optionBarOpen &&
+ <a
+ className="button js-projects-topbar-open spacer-right"
+ href="#"
+ onClick={props.onOpenOptionBar}>
{translate('projects.view_settings')}
- </a>
- </div>
+ </a>}
{!!props.loading && <i className="spinner spacer-right" />}
//@flow
import React from 'react';
import classNames from 'classnames';
-import CloseIcon from '../../../components/icons-components/CloseIcon';
import Tooltip from '../../../components/controls/Tooltip';
import PerspectiveSelect from './PerspectiveSelect';
import ProjectsSortingSelect from './ProjectsSortingSelect';
return (
<div className="projects-topbar">
<div className={classNames('projects-topbar-actions', { open })}>
- <a className="projects-topbar-button button-icon" href="#" onClick={this.closeBar}>
- <CloseIcon />
- </a>
<div className="projects-topbar-actions-inner">
- <PerspectiveSelect
- className="projects-topbar-item js-projects-perspective-select"
- onChange={this.props.onPerspectiveChange}
- view={this.props.view}
- visualization={this.props.visualization}
- />
- {this.renderSortingSelect()}
+ <button className="projects-topbar-button" onClick={this.closeBar}>
+ {translate('close')}
+ </button>
+ <div className="projects-topbar-items">
+ <PerspectiveSelect
+ className="projects-topbar-item js-projects-perspective-select"
+ onChange={this.props.onPerspectiveChange}
+ view={this.props.view}
+ visualization={this.props.visualization}
+ />
+ {this.renderSortingSelect()}
+ </div>
</div>
</div>
</div>
it('should call close method correctly', () => {
const toggle = jest.fn();
const wrapper = shallow(<ProjectsOptionBar open={true} view="leak" onToggleOptionBar={toggle} />);
- click(wrapper.find('a.projects-topbar-button'));
+ click(wrapper.find('.projects-topbar-button'));
expect(toggle.mock.calls).toMatchSnapshot();
});
<div
className="page-actions projects-page-actions text-right"
>
- <div
- className="spacer-bottom"
+ <a
+ className="button js-projects-topbar-open spacer-right"
+ href="#"
>
- <a
- className="button js-projects-topbar-open"
- href="#"
- >
- projects.view_settings
- </a>
- </div>
+ projects.view_settings
+ </a>
<span>
<strong
id="projects-total"
<div
className="page-actions projects-page-actions text-right"
>
- <div
- className="spacer-bottom"
+ <a
+ className="button js-projects-topbar-open spacer-right"
+ href="#"
>
- <a
- className="button js-projects-topbar-open"
- href="#"
- >
- projects.view_settings
- </a>
- </div>
+ projects.view_settings
+ </a>
<i
className="spinner spacer-right"
/>
<div
className="projects-topbar-actions open"
>
- <a
- className="projects-topbar-button button-icon"
- href="#"
- onClick={[Function]}
- >
- <CloseIcon />
- </a>
<div
className="projects-topbar-actions-inner"
>
- <PerspectiveSelect
- className="projects-topbar-item js-projects-perspective-select"
- view="visualizations"
- visualization="coverage"
- />
- <Tooltip
- overlay="projects.sort.disabled"
- placement="bottom"
+ <button
+ className="projects-topbar-button"
+ onClick={[Function]}
+ >
+ close
+ </button>
+ <div
+ className="projects-topbar-items"
>
- <div>
- <ProjectsSortingSelect
- className="projects-topbar-item js-projects-sorting-select disabled"
- view="visualizations"
- />
- </div>
- </Tooltip>
+ <PerspectiveSelect
+ className="projects-topbar-item js-projects-perspective-select"
+ view="visualizations"
+ visualization="coverage"
+ />
+ <Tooltip
+ overlay="projects.sort.disabled"
+ placement="bottom"
+ >
+ <div>
+ <ProjectsSortingSelect
+ className="projects-topbar-item js-projects-sorting-select disabled"
+ view="visualizations"
+ />
+ </div>
+ </Tooltip>
+ </div>
</div>
</div>
</div>
<div
className="projects-topbar-actions"
>
- <a
- className="projects-topbar-button button-icon"
- href="#"
- onClick={[Function]}
- >
- <CloseIcon />
- </a>
<div
className="projects-topbar-actions-inner"
>
- <PerspectiveSelect
- className="projects-topbar-item js-projects-perspective-select"
- view="overall"
- />
- <ProjectsSortingSelect
- className="projects-topbar-item js-projects-sorting-select"
- view="overall"
- />
+ <button
+ className="projects-topbar-button"
+ onClick={[Function]}
+ >
+ close
+ </button>
+ <div
+ className="projects-topbar-items"
+ >
+ <PerspectiveSelect
+ className="projects-topbar-item js-projects-perspective-select"
+ view="overall"
+ />
+ <ProjectsSortingSelect
+ className="projects-topbar-item js-projects-sorting-select"
+ view="overall"
+ />
+ </div>
</div>
</div>
</div>
<div
className="projects-topbar-actions open"
>
- <a
- className="projects-topbar-button button-icon"
- href="#"
- onClick={[Function]}
- >
- <CloseIcon />
- </a>
<div
className="projects-topbar-actions-inner"
>
- <PerspectiveSelect
- className="projects-topbar-item js-projects-perspective-select"
- view="leak"
- visualization="risk"
- />
- <ProjectsSortingSelect
- className="projects-topbar-item js-projects-sorting-select"
- view="leak"
- />
+ <button
+ className="projects-topbar-button"
+ onClick={[Function]}
+ >
+ close
+ </button>
+ <div
+ className="projects-topbar-items"
+ >
+ <PerspectiveSelect
+ className="projects-topbar-item js-projects-perspective-select"
+ view="leak"
+ visualization="risk"
+ />
+ <ProjectsSortingSelect
+ className="projects-topbar-item js-projects-sorting-select"
+ view="leak"
+ />
+ </div>
</div>
</div>
</div>
transition: top 150ms ease-out;
}
+.projects-page-content {
+ transition: padding-top 150ms ease-out;
+}
+
.projects-topbar {
position: fixed;
width: 100%;
left: 0;
right: 0;
top: -50px;
- display: flex;
- flex-direction: row-reverse;
z-index: 50;
flex-grow: 0.000001;
+ border-bottom: 1px solid #e6e6e6;
background-color: #fff;
transition: top 150ms ease-out;
}
}
.projects-topbar-actions-inner {
+ position: relative;
+ margin: auto;
+ padding: 0 20px;
+ min-width: 1040px;
+ max-width: 1280px;
+}
+
+.projects-topbar-items {
display: flex;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
flex-grow: 1;
- border-bottom: 1px solid #e6e6e6;
+ height: 46px;
}
.projects-topbar-item {
}
.projects-topbar-button {
- box-sizing: border-box;
- float: right;
- padding: 11px;
- padding-top: 15px;
- border: none;
- border-left: 1px solid #e6e6e6;
- border-bottom: 1px solid #e6e6e6;
- width: 46px;
- height: 46px;
- text-align: center;
- text-decoration: none;
- cursor: pointer;
+ position: absolute;
+ right: 20px;
+ top: 10px;
}
.projects-sidebar {