Skip to content

Commit

Permalink
Merge pull request #974 from bjoernricks/unify-dashboards
Browse files Browse the repository at this point in the history
Unify dashboards
  • Loading branch information
swaterkamp authored Sep 25, 2018
2 parents 8c54792 + 2925bef commit 81aef58
Show file tree
Hide file tree
Showing 17 changed files with 473 additions and 874 deletions.
7 changes: 1 addition & 6 deletions gsa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ set (GSA_JS_SRC_FILES
${GSA_SRC_DIR}/src/web/components/sortable/item.js
${GSA_SRC_DIR}/src/web/components/sortable/resizer.js
${GSA_SRC_DIR}/src/web/components/sortable/row.js
${GSA_SRC_DIR}/src/web/components/sortable/utils.js
${GSA_SRC_DIR}/src/web/components/structure/footer.js
${GSA_SRC_DIR}/src/web/components/structure/header.js
${GSA_SRC_DIR}/src/web/components/structure/main.js
Expand Down Expand Up @@ -401,8 +402,6 @@ set (GSA_JS_SRC_FILES
${GSA_SRC_DIR}/src/web/pages/alerts/taskeventpart.js
${GSA_SRC_DIR}/src/web/pages/alerts/tippingpointmethodpart.js
${GSA_SRC_DIR}/src/web/pages/alerts/verinicemethodpart.js
${GSA_SRC_DIR}/src/web/pages/assets/page.js
${GSA_SRC_DIR}/src/web/pages/assets/dashboard.js
${GSA_SRC_DIR}/src/web/pages/credentials/component.js
${GSA_SRC_DIR}/src/web/pages/credentials/details.js
${GSA_SRC_DIR}/src/web/pages/credentials/detailspage.js
Expand Down Expand Up @@ -666,8 +665,6 @@ set (GSA_JS_SRC_FILES
${GSA_SRC_DIR}/src/web/pages/scanners/listpage.js
${GSA_SRC_DIR}/src/web/pages/scanners/row.js
${GSA_SRC_DIR}/src/web/pages/scanners/table.js
${GSA_SRC_DIR}/src/web/pages/scans/page.js
${GSA_SRC_DIR}/src/web/pages/scans/dashboard.js
${GSA_SRC_DIR}/src/web/pages/schedules/component.js
${GSA_SRC_DIR}/src/web/pages/schedules/dayselect.js
${GSA_SRC_DIR}/src/web/pages/schedules/details.js
Expand All @@ -691,8 +688,6 @@ set (GSA_JS_SRC_FILES
${GSA_SRC_DIR}/src/web/pages/secinfo/dashboard/loaders.js
${GSA_SRC_DIR}/src/web/pages/secinfo/dashboard/severityclassdisplay.js
${GSA_SRC_DIR}/src/web/pages/secinfo/dashboard/typedisplay.js
${GSA_SRC_DIR}/src/web/pages/securityinfo/dashboard.js
${GSA_SRC_DIR}/src/web/pages/securityinfo/page.js
${GSA_SRC_DIR}/src/web/pages/start/confirmremovedialog.js
${GSA_SRC_DIR}/src/web/pages/start/dashboard.js
${GSA_SRC_DIR}/src/web/pages/start/newdashboarddialog.js
Expand Down
123 changes: 57 additions & 66 deletions gsa/src/web/components/bar/menubar.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,33 +117,30 @@ const MenuBar = ({
</Menu>
{may_op_scans &&
<Menu title={_('Scans')}>
<MenuEntry title={_('Dashboard')} to="dashboards/scans"/>
<MenuSection>
{capabilities.mayAccess('tasks') &&
<MenuEntry
title={_('Tasks')}
to="tasks"
/>
}
{capabilities.mayAccess('reports') &&
<MenuEntry
title={_('Reports')}
to="reports"
/>
}
{capabilities.mayAccess('results') &&
<MenuEntry
title={_('Results')}
to="results"
/>
}
{capabilities.mayAccess('vulns') &&
<MenuEntry
title={_('Vulnerabilities')}
to="vulnerabilities"
/>
}
</MenuSection>
{capabilities.mayAccess('tasks') &&
<MenuEntry
title={_('Tasks')}
to="tasks"
/>
}
{capabilities.mayAccess('reports') &&
<MenuEntry
title={_('Reports')}
to="reports"
/>
}
{capabilities.mayAccess('results') &&
<MenuEntry
title={_('Results')}
to="results"
/>
}
{capabilities.mayAccess('vulns') &&
<MenuEntry
title={_('Vulnerabilities')}
to="vulnerabilities"
/>
}
<MenuSection>
{capabilities.mayAccess('notes') &&
<MenuEntry
Expand All @@ -163,49 +160,43 @@ const MenuBar = ({
}
{capabilities.mayAccess('assets') &&
<Menu title={_('Assets')}>
<MenuEntry title={_('Dashboard')} to="dashboards/assets"/>
<MenuSection>
<MenuEntry
section
title={_('Hosts')}
to="hosts"
/>
<MenuEntry
title={_('Operating Systems')}
to="operatingsystems"
/>
</MenuSection>
<MenuEntry
section
title={_('Hosts')}
to="hosts"
/>
<MenuEntry
title={_('Operating Systems')}
to="operatingsystems"
/>
</Menu>
}
{capabilities.mayAccess('info') &&
<Menu title={_('SecInfo')}>
<MenuEntry title={_('Dashboard')} to="dashboards/secinfo"/>
<MenuSection>
<MenuEntry
title={_('NVTs')}
to="nvts"
/>
<MenuEntry
title={_('CVEs')}
to="cves"
/>
<MenuEntry
title={_('CPEs')}
to="cpes"
/>
<MenuEntry
title={_('OVAL Definitions')}
to="ovaldefs"
/>
<MenuEntry
title={_('CERT-Bund Advisories')}
to="certbunds"
/>
<MenuEntry
title={_('DFN-CERT Advisories')}
to="dfncerts"
/>
</MenuSection>
<MenuEntry
title={_('NVTs')}
to="nvts"
/>
<MenuEntry
title={_('CVEs')}
to="cves"
/>
<MenuEntry
title={_('CPEs')}
to="cpes"
/>
<MenuEntry
title={_('OVAL Definitions')}
to="ovaldefs"
/>
<MenuEntry
title={_('CERT-Bund Advisories')}
to="certbunds"
/>
<MenuEntry
title={_('DFN-CERT Advisories')}
to="dfncerts"
/>
<MenuSection>
<MenuEntry
title={_('All SecInfo')}
Expand Down
11 changes: 4 additions & 7 deletions gsa/src/web/components/dashboard/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ import DashboardSettings from 'web/store/dashboard/settings/selectors';
import Loading from 'web/components/loading/loading';

import Grid, {
createRow,
createItem,
itemsPropType,
DEFAULT_ROW_HEIGHT,
} from 'web/components/sortable/grid';
import {
DEFAULT_ROW_HEIGHT,
convertDefaultContent,
} from 'web/components/sortable/utils';

import PropTypes from 'web/utils/proptypes';
import withGmp from 'web/utils/withGmp';
Expand Down Expand Up @@ -83,10 +84,6 @@ const RowPlaceHolder = styled.div`
align-items: center;
`;

const convertDefaultContent = defaultContent =>
defaultContent.map(row => createRow(
row.map(item => createItem({name: item}))));

const filterItems = (items, allowed) => items.map(row => {
const {items: rowItems = []} = row;
return {
Expand Down
Loading

0 comments on commit 81aef58

Please sign in to comment.