Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added grow option to multiselect #1485

Merged
merged 6 commits into from
Jul 17, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]

### Added
- Added grow option to multiselect component [#1485](https://github.com/greenbone/gsa/pull/1485)
- Add LogoutIcon [#1481](https://github.com/greenbone/gsa/pull/1481)
- Added a component "SeverityValuesGroup" enabling user choose the relation they want [#1477](https://github.com/greenbone/gsa/pull/1477)
- Added filter keywords owner, host, cvss base score, vulnerability and location to filter dialog on results page [#1472](https://github.com/greenbone/gsa/pull/1472)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ exports[`MultiSelect component tests should render 1`] = `
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
position: relative;
-webkit-box-flex: position:relative;
-webkit-flex-grow: position:relative;
-ms-flex-positive: position:relative;
flex-grow: position:relative;
width: 250px;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ exports[`Select component tests should render 1`] = `
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
position: relative;
-webkit-box-flex: position:relative;
-webkit-flex-grow: position:relative;
-ms-flex-positive: position:relative;
flex-grow: position:relative;
width: 180px;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,10 @@ exports[`SelectContainer tests should render 1`] = `
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
position: relative;
-webkit-box-flex: position:relative;
-webkit-flex-grow: position:relative;
-ms-flex-positive: position:relative;
flex-grow: position:relative;
width: 100px;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ exports[`TimezoneSelect tests should render 1`] = `
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
position: relative;
-webkit-box-flex: position:relative;
-webkit-flex-grow: position:relative;
-ms-flex-positive: position:relative;
flex-grow: position:relative;
width: 230px;
}

Expand Down
3 changes: 3 additions & 0 deletions gsa/src/web/components/form/multiselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ class MultiSelect extends React.Component {
items,
menuPosition = 'adjust',
width = DEFAULT_WIDTH,
grow,
} = this.props;

const {search, selectedItems} = this.state;
Expand Down Expand Up @@ -208,6 +209,7 @@ class MultiSelect extends React.Component {
{...getRootProps({}, {suppressRefError: true})}
className={className}
width={width}
grow={grow}
>
<Box
isOpen={isOpen}
Expand Down Expand Up @@ -275,6 +277,7 @@ class MultiSelect extends React.Component {

MultiSelect.propTypes = {
disabled: PropTypes.bool,
grow: PropTypes.number,
items: PropTypes.arrayOf(PropTypes.object),
menuPosition: PropTypes.oneOf(['left', 'right', 'adjust']),
name: PropTypes.string,
Expand Down
1 change: 1 addition & 0 deletions gsa/src/web/components/form/selectelements.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ Menu.propTypes = {
export const SelectContainer = styled.div`
display: flex;
flex-direction: column;
flex-grow: ${props => props.grow}
position: relative;
width: ${props => props.width};
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ exports[`Relation Selector Tests should render 1`] = `
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
position: relative;
-webkit-box-flex: position:relative;
-webkit-flex-grow: position:relative;
-ms-flex-positive: position:relative;
flex-grow: position:relative;
width: 180px;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@ exports[`Severity Values Group Tests should render 1`] = `
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
position: relative;
-webkit-box-flex: position:relative;
-webkit-flex-grow: position:relative;
-ms-flex-positive: position:relative;
flex-grow: position:relative;
width: 180px;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@ exports[`SortByGroup tests should render 1`] = `
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
position: relative;
-webkit-box-flex: position:relative;
-webkit-flex-grow: position:relative;
-ms-flex-positive: position:relative;
flex-grow: position:relative;
width: 180px;
}

Expand Down
10 changes: 8 additions & 2 deletions gsa/src/web/entities/__tests__/__snapshots__/tagsdialog.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,10 @@ exports[`TagsDialog dialog component tests should disable tag selection when no
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
position: relative;
-webkit-box-flex: position:relative;
-webkit-flex-grow: position:relative;
-ms-flex-positive: position:relative;
flex-grow: position:relative;
width: 230px;
}

Expand Down Expand Up @@ -1219,7 +1222,10 @@ exports[`TagsDialog dialog component tests should render dialog 1`] = `
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
position: relative;
-webkit-box-flex: position:relative;
-webkit-flex-grow: position:relative;
-ms-flex-positive: position:relative;
flex-grow: position:relative;
width: 230px;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,10 @@ exports[`CreateTicketDialog component tests should render dialog 1`] = `
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
position: relative;
-webkit-box-flex: position:relative;
-webkit-flex-grow: position:relative;
-ms-flex-positive: position:relative;
flex-grow: position:relative;
width: 180px;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,10 @@ exports[`EditTicketDialog component tests should render dialog 1`] = `
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
position: relative;
-webkit-box-flex: position:relative;
-webkit-flex-grow: position:relative;
-ms-flex-positive: position:relative;
flex-grow: position:relative;
width: 180px;
}

Expand Down
1 change: 0 additions & 1 deletion gsa/src/web/pages/tickets/createdialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const CreateTicketDialog = ({
<FormGroup title={_('Assign To User')}>
<Select
name="userId"
grow="1"
value={values.userId}
items={renderSelectItems(users)}
onChange={onUserIdChange}
Expand Down