Skip to content

Commit

Permalink
Merge pull request #11821 from influxdata/feat/show-scraper-name
Browse files Browse the repository at this point in the history
feat(ui): Display scraper name in scrapers list
  • Loading branch information
ischolten authored Feb 12, 2019
2 parents f7b9312 + 3d810a9 commit 7200ab8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Features
1. [11809](https://github.com/influxdata/influxdb/pull/11809): Add the ability to name a scraper target
1. [11821](https://github.com/influxdata/influxdb/pull/11821): Display scraper name as the first and only updatable column in scrapers list

### Bug Fixes

Expand Down
5 changes: 3 additions & 2 deletions ui/src/organizations/components/ScraperList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ export default class ScraperList extends PureComponent<Props> {
<>
<IndexList>
<IndexList.Header>
<IndexList.HeaderCell columnName="URL" width="50%" />
<IndexList.HeaderCell columnName="Bucket" width="50%" />
<IndexList.HeaderCell columnName="Name" width="33%" />
<IndexList.HeaderCell columnName="URL" width="34%" />
<IndexList.HeaderCell columnName="Bucket" width="33%" />
</IndexList.Header>
<IndexList.Body columnCount={3} emptyState={emptyState}>
{this.scrapersList}
Expand Down
9 changes: 5 additions & 4 deletions ui/src/organizations/components/ScraperRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ export default class ScraperRow extends PureComponent<Props> {
<IndexList.Row>
<IndexList.Cell>
<EditableName
onUpdate={this.handleUpdateScraper}
name={scraper.url}
onUpdate={this.handleUpdateScraperName}
name={scraper.name}
noNameString={DEFAULT_SCRAPER_NAME}
/>
</IndexList.Cell>
<IndexList.Cell>{scraper.url}</IndexList.Cell>
<IndexList.Cell>{scraper.bucket}</IndexList.Cell>
<IndexList.Cell revealOnHover={true} alignment={Alignment.Right}>
<ConfirmationButton
Expand All @@ -48,8 +49,8 @@ export default class ScraperRow extends PureComponent<Props> {
)
}

private handleUpdateScraper = (name: string) => {
private handleUpdateScraperName = (name: string) => {
const {onUpdateScraper, scraper} = this.props
onUpdateScraper({...scraper, url: name})
onUpdateScraper({...scraper, name})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@ exports[`ScraperList rendering renders 1`] = `
<Fragment>
<IndexList>
<IndexListHeader>
<IndexListHeaderCell
alignment="left"
columnName="Name"
width="33%"
/>
<IndexListHeaderCell
alignment="left"
columnName="URL"
width="50%"
width="34%"
/>
<IndexListHeaderCell
alignment="left"
columnName="Bucket"
width="50%"
width="33%"
/>
</IndexListHeader>
<IndexListBody
Expand Down

0 comments on commit 7200ab8

Please sign in to comment.