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

Fix list of excluded hosts formatting #1340

Merged
merged 2 commits into from
Apr 30, 2019
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -34,6 +34,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Cleanup get_report function in gsad [#1263](https://github.com/greenbone/gsa/pull/1263)

### Fixed
- Fix list of excluded hosts formatting [#1340](https://github.com/greenbone/gsa/pull/1340)
- Fix installation of locale files [#1330](https://github.com/greenbone/gsa/pull/1330)
- Fix list of options of possible Filter types [#1326](https://github.com/greenbone/gsa/pull/1326)
- Fix timezone handling at performance page [#1325](https://github.com/greenbone/gsa/pull/1325)
Expand Down
17 changes: 10 additions & 7 deletions gsa/src/web/pages/targets/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import DetailsLink from 'web/components/link/detailslink';

import InfoTable from 'web/components/table/infotable';
import TableBody from 'web/components/table/body';
import TableData from 'web/components/table/data';
import TableData, {TableDataAlignTop} from 'web/components/table/data';
import TableRow from 'web/components/table/row';

import DetailsBlock from 'web/entity/block';
Expand Down Expand Up @@ -61,6 +61,10 @@ const TargetDetails = ({capabilities, entity, links = true}) => {
.slice(0, MAX_HOSTS_LISTINGS)
.map(host => <span key={host}>{host}</span>);

const excludeHostsListing = exclude_hosts
.slice(0, MAX_HOSTS_LISTINGS)
.map(host => <span key={host}>{host}</span>);

return (
<Layout grow="1" flex="column">
<DetailsBlock title={_('Hosts')}>
Expand All @@ -71,7 +75,7 @@ const TargetDetails = ({capabilities, entity, links = true}) => {
</colgroup>
<TableBody>
<TableRow>
<TableData>{_('Included')}</TableData>
<TableDataAlignTop>{_('Included')}</TableDataAlignTop>
<TableData>
<Divider wrap>
{hostsListing}
Expand All @@ -82,12 +86,11 @@ const TargetDetails = ({capabilities, entity, links = true}) => {

{exclude_hosts.length > 0 && (
<TableRow>
<TableData>{_('Excluded')}</TableData>
<TableDataAlignTop>{_('Excluded')}</TableDataAlignTop>
<TableData>
<Divider>
{exclude_hosts.map(host => (
<span key={host}>{host}</span>
))}
<Divider wrap>
{excludeHostsListing}
{exclude_hosts.length > MAX_HOSTS_LISTINGS && '[...]'}
</Divider>
</TableData>
</TableRow>
Expand Down