From 163878892bcb5241c72124c13b943ef4cca39993 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Fri, 4 Jun 2021 11:09:43 +0200 Subject: [PATCH 1/5] Allow to wrap HorizontalSep (cherry picked from commit 6bf8ea8da9c11f3061eed94f63a0aa9785efabed) --- gsa/src/web/components/layout/horizontalsep.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gsa/src/web/components/layout/horizontalsep.js b/gsa/src/web/components/layout/horizontalsep.js index d7b535b0f2..f81dac3647 100644 --- a/gsa/src/web/components/layout/horizontalsep.js +++ b/gsa/src/web/components/layout/horizontalsep.js @@ -17,11 +17,14 @@ */ import styled from 'styled-components'; +import {isDefined} from 'gmp/utils/identity'; + import PropTypes from 'web/utils/proptypes'; import Divider from './divider'; const HorizontalSep = styled(Divider)` + flex-wrap: ${props => (isDefined(props.wrap) ? props.wrap : null)}; & > *:not(:last-child)::after { content: ${({separator = '•'}) => `'${separator}'`}; margin-left: ${({spacing = '5px'}) => spacing}; @@ -31,6 +34,7 @@ const HorizontalSep = styled(Divider)` HorizontalSep.propTypes = { separator: PropTypes.string, spacing: PropTypes.string, + wrap: PropTypes.oneOf([true, 'wrap', 'nowrap']), }; export default HorizontalSep; From 4abe1374d87aaf72219e54471069cb81855be77b Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Fri, 4 Jun 2021 11:10:30 +0200 Subject: [PATCH 2/5] Add test for wrapping HorizontalSep (cherry picked from commit e0e7d18f1c779259065b4da8901159c0f4080616) --- .../__snapshots__/horizontalsep.js.snap | 77 +++++++++++++++++++ .../layout/__tests__/horizontalsep.js | 5 ++ 2 files changed, 82 insertions(+) diff --git a/gsa/src/web/components/layout/__tests__/__snapshots__/horizontalsep.js.snap b/gsa/src/web/components/layout/__tests__/__snapshots__/horizontalsep.js.snap index 1ff0d094af..e4c776bd12 100644 --- a/gsa/src/web/components/layout/__tests__/__snapshots__/horizontalsep.js.snap +++ b/gsa/src/web/components/layout/__tests__/__snapshots__/horizontalsep.js.snap @@ -1,5 +1,82 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`HorizontalSep tests should allow to wrap 1`] = ` +.c1 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-flex-wrap: wrap; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-box-pack: start; + -webkit-justify-content: start; + -ms-flex-pack: start; + justify-content: start; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + margin-left: -5px; +} + +.c1 > * { + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; +} + +.c1 > * { + margin-left: 5px; +} + +.c0 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-box-pack: start; + -webkit-justify-content: start; + -ms-flex-pack: start; + justify-content: start; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; +} + +.c2 { + -webkit-flex-wrap: true; + -ms-flex-wrap: true; + flex-wrap: true; +} + +.c2 > *:not(:last-child)::after { + content: '•'; + margin-left: 5px; +} + +
+
+
+`; + exports[`HorizontalSep tests should render 1`] = ` .c1 { display: -webkit-box; diff --git a/gsa/src/web/components/layout/__tests__/horizontalsep.js b/gsa/src/web/components/layout/__tests__/horizontalsep.js index 6a9072ce08..af991d0615 100644 --- a/gsa/src/web/components/layout/__tests__/horizontalsep.js +++ b/gsa/src/web/components/layout/__tests__/horizontalsep.js @@ -37,4 +37,9 @@ describe('HorizontalSep tests', () => { const {element} = render(); expect(element).toMatchSnapshot(); }); + + test('should allow to wrap', () => { + const {element} = render(); + expect(element).toMatchSnapshot(); + }); }); From c87642b86a34c471e6113828a3cb0c9a540b4f2b Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Fri, 4 Jun 2021 11:11:14 +0200 Subject: [PATCH 3/5] Use wrappable HorizontalSep in User row (cherry picked from commit f934fb0c6bf6a58a5b2f149f1bcf4a8712c73cf1) --- gsa/src/web/pages/users/row.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gsa/src/web/pages/users/row.js b/gsa/src/web/pages/users/row.js index 04f78f86e6..9e7b0a92b9 100644 --- a/gsa/src/web/pages/users/row.js +++ b/gsa/src/web/pages/users/row.js @@ -24,8 +24,8 @@ import {map} from 'gmp/utils/array'; import ExportIcon from 'web/components/icon/exporticon'; -import Divider from 'web/components/layout/divider'; import IconDivider from 'web/components/layout/icondivider'; +import HorizontalSeparator from 'web/components/layout/horizontalsep'; import DetailsLink from 'web/components/link/detailslink'; @@ -121,10 +121,10 @@ const Row = ({ onToggleDetailsClick={onToggleDetailsClick} /> - {roles} + {roles} - {groups} + {groups} {host_allow} {authMethod} From 79825c5ac4fe7278a59d9abec962a4a1affe6451 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp Date: Fri, 4 Jun 2021 11:14:07 +0200 Subject: [PATCH 4/5] Update Changelog (cherry picked from commit 7a5466ac42a1ae285b797c7f6d2296808f9fb856) # Conflicts: # CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6f500b5a9..7ab921cd9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Added the CVSS v3.1 BaseScore calculator to the `/cvsscalculator` page in the Help section. [#2536](https://github.com/greenbone/gsa/pull/2536) ### Changed +<<<<<<< HEAD - Don't show word cloud as default in result dashboard [#2883](https://github.com/greenbone/gsa/pull/2883) - Sort host, os and vulns listpage by descending severity [#2880](https://github.com/greenbone/gsa/pull/2880) - Revert the changes from integer `score` to a float `severity` [#2854](https://github.com/greenbone/gsa/pull/2854) @@ -66,6 +67,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - CVE Tables Page can now be used with the updated xml-format and CVSSv3(.1). [#2583](https://github.com/greenbone/gsa/pull/2583) - The CVSS v2 BaseScore calculator calculates the score on the client side now. [#2536](https://github.com/greenbone/gsa/pull/2536) +======= +- Properly space and linebreak roles and groups in users table row [#2949](https://github.com/greenbone/gsa/pull/2949) +- Make HorizontalSep component wrappable [#2949](https://github.com/greenbone/gsa/pull/2949) +- Use greenbone sensor as default scanner type when opening the dialog if available [#2867](https://github.com/greenbone/gsa/pull/2867) +>>>>>>> 7a5466ac4 (Update Changelog) ### Fixed - Fix dynamic severity checkbox not being checked upon clicking [#2882](https://github.com/greenbone/gsa/pull/2882) From 2760f2e3162414d490bf97ed6a30f8f3d830ae03 Mon Sep 17 00:00:00 2001 From: Steffen Waterkamp <32056637+swaterkamp@users.noreply.github.com> Date: Tue, 15 Jun 2021 09:26:51 +0200 Subject: [PATCH 5/5] Update CHANGELOG.md --- CHANGELOG.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ab921cd9c..926fb4b37e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,7 +50,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Added the CVSS v3.1 BaseScore calculator to the `/cvsscalculator` page in the Help section. [#2536](https://github.com/greenbone/gsa/pull/2536) ### Changed -<<<<<<< HEAD +- Properly space and linebreak roles and groups in users table row [#2949](https://github.com/greenbone/gsa/pull/2949) +- Make HorizontalSep component wrappable [#2949](https://github.com/greenbone/gsa/pull/2949) - Don't show word cloud as default in result dashboard [#2883](https://github.com/greenbone/gsa/pull/2883) - Sort host, os and vulns listpage by descending severity [#2880](https://github.com/greenbone/gsa/pull/2880) - Revert the changes from integer `score` to a float `severity` [#2854](https://github.com/greenbone/gsa/pull/2854) @@ -67,12 +68,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - CVE Tables Page can now be used with the updated xml-format and CVSSv3(.1). [#2583](https://github.com/greenbone/gsa/pull/2583) - The CVSS v2 BaseScore calculator calculates the score on the client side now. [#2536](https://github.com/greenbone/gsa/pull/2536) -======= -- Properly space and linebreak roles and groups in users table row [#2949](https://github.com/greenbone/gsa/pull/2949) -- Make HorizontalSep component wrappable [#2949](https://github.com/greenbone/gsa/pull/2949) -- Use greenbone sensor as default scanner type when opening the dialog if available [#2867](https://github.com/greenbone/gsa/pull/2867) ->>>>>>> 7a5466ac4 (Update Changelog) - ### Fixed - Fix dynamic severity checkbox not being checked upon clicking [#2882](https://github.com/greenbone/gsa/pull/2882) - Fixed result CVE parsing for result listpage and CVE reports [#2869](https://github.com/greenbone/gsa/pull/2869)