Merge pull request #11821 from influxdata/feat/show-scraper-name

feat(ui): Display scraper name in scrapers list
pull/11819/head
Iris Scholten 2019-02-12 10:42:54 -08:00 committed by GitHub
commit 7200ab869f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 8 deletions

View File

@ -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

View File

@ -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}

View File

@ -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
@ -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})
}
}

View File

@ -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