feat(labels/ui): update label name (#12702)
parent
77cf726a52
commit
2d97cd9b69
|
@ -985,9 +985,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@influxdata/influx": {
|
"@influxdata/influx": {
|
||||||
"version": "0.2.42",
|
"version": "0.2.43",
|
||||||
"resolved": "https://registry.npmjs.org/@influxdata/influx/-/influx-0.2.42.tgz",
|
"resolved": "https://registry.npmjs.org/@influxdata/influx/-/influx-0.2.43.tgz",
|
||||||
"integrity": "sha512-xHywcFLfIM+MhdCjmK6T9c+mXIYgEvGENA13PDK2+G6j7YSmJZTutdYT4k472aa2uq3ziCBlYxvS5oG6P5Pd1g==",
|
"integrity": "sha512-sAffeCoIBnpauaa7tATBI2P4wIloJSJC5wwPTu9xwKGQ5GjwRFAC34JXU8zuBlqg4ksYW9NvNBbLOGZSbz+iZw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"axios": "^0.18.0"
|
"axios": "^0.18.0"
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,7 +137,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@influxdata/clockface": "0.0.5",
|
"@influxdata/clockface": "0.0.5",
|
||||||
"@influxdata/influx": "0.2.42",
|
"@influxdata/influx": "0.2.43",
|
||||||
"@influxdata/react-custom-scrollbars": "4.3.8",
|
"@influxdata/react-custom-scrollbars": "4.3.8",
|
||||||
"axios": "^0.18.0",
|
"axios": "^0.18.0",
|
||||||
"babel-polyfill": "^6.26.0",
|
"babel-polyfill": "^6.26.0",
|
||||||
|
|
|
@ -62,15 +62,15 @@ class CreateLabelOverlay extends Component<Props, State> {
|
||||||
<LabelOverlayForm
|
<LabelOverlayForm
|
||||||
id={label.id}
|
id={label.id}
|
||||||
name={label.name}
|
name={label.name}
|
||||||
description={label.properties.description}
|
|
||||||
color={label.properties.color}
|
|
||||||
onColorChange={this.handleColorChange}
|
|
||||||
onSubmit={this.handleSubmit}
|
|
||||||
onCloseModal={onDismiss}
|
onCloseModal={onDismiss}
|
||||||
onInputChange={this.handleInputChange}
|
|
||||||
buttonText="Create Label"
|
buttonText="Create Label"
|
||||||
|
onSubmit={this.handleSubmit}
|
||||||
isFormValid={this.isFormValid}
|
isFormValid={this.isFormValid}
|
||||||
|
color={label.properties.color}
|
||||||
onNameValidation={onNameValidation}
|
onNameValidation={onNameValidation}
|
||||||
|
onInputChange={this.handleInputChange}
|
||||||
|
onColorChange={this.handleColorChange}
|
||||||
|
description={label.properties.description}
|
||||||
/>
|
/>
|
||||||
</Overlay.Body>
|
</Overlay.Body>
|
||||||
</Overlay.Container>
|
</Overlay.Container>
|
||||||
|
|
|
@ -126,7 +126,7 @@ class Labels extends PureComponent<Props, State> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleUpdateLabel = (label: ILabel) => {
|
private handleUpdateLabel = (label: ILabel) => {
|
||||||
this.props.updateLabel(label.id, label.properties)
|
this.props.updateLabel(label.id, label)
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleDelete = async (id: string) => {
|
private handleDelete = async (id: string) => {
|
||||||
|
|
|
@ -94,11 +94,11 @@ export const createLabel = (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const updateLabel = (id: string, properties: LabelProperties) => async (
|
export const updateLabel = (id: string, l: ILabel) => async (
|
||||||
dispatch: Dispatch<Action>
|
dispatch: Dispatch<Action>
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
const label = await client.labels.update(id, properties)
|
const label = await client.labels.update(id, l)
|
||||||
|
|
||||||
dispatch(editLabel(label))
|
dispatch(editLabel(label))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue