fix(zero_value_checks): checks can now have a value set to 0 (#17933)

pull/17941/head
Ariel Salem 2020-05-04 05:00:28 -07:00 committed by GitHub
parent 35ed5734bb
commit 2eb70ee041
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 5 deletions

View File

@ -7,6 +7,7 @@
### Bug Fixes
1. [17906](https://github.com/influxdata/influxdb/pull/17906): Ensure UpdateUser cleans up the index when updating names
1. [17933](https://github.com/influxdata/influxdb/pull/17933): Ensure Checks can be set for zero values
### UI Improvements

View File

@ -380,7 +380,7 @@ func (b ThresholdConfigBase) GetLevel() notification.CheckLevel {
// Lesser threshold type.
type Lesser struct {
ThresholdConfigBase
Value float64 `json:"value,omitempty"`
Value float64 `json:"value"`
}
// Type of the threshold config.
@ -404,7 +404,7 @@ func (td Lesser) MarshalJSON() ([]byte, error) {
// Greater threshold type.
type Greater struct {
ThresholdConfigBase
Value float64 `json:"value,omitempty"`
Value float64 `json:"value"`
}
// Type of the threshold config.

View File

@ -80,6 +80,9 @@ describe('Checks', () => {
cy.getByTestID('save-cell--button').should('be.disabled')
cy.getByTestID('checkeo--header alerting-tab').click()
cy.getByTestID('add-threshold-condition-WARN').click()
cy.getByTestID('input-field')
.clear()
.type('0')
cy.getByTestID('save-cell--button').click()
cy.getByTestID('check-card').should('have.length', 1)
cy.getByTestID('notification-error').should('not.exist')
@ -104,6 +107,25 @@ describe('Checks', () => {
})
})
it('should allow created checks edited checks to persist changes (especially if the value is 0)', () => {
const checkName = 'Check it out!'
// Selects the check to edit
cy.getByTestID('check-card--name').should('have.length', 1)
cy.getByTestID('check-card--name').click()
// ensures that the check WARN value is set to 0
cy.getByTestID('input-field')
.should('have.value', '0')
.clear()
.type('7')
// renames the check
cy.getByTestID('page-title')
.contains('Name this Check')
.type(checkName)
cy.getByTestID('save-cell--button').click()
// checks that the values persisted
cy.getByTestID('check-card--name').contains(checkName)
})
it('can edit the check card', () => {
// toggle on / off
cy.get('.cf-resource-card__disabled').should('not.exist')

View File

@ -25,13 +25,24 @@
}
&.alert-builder--meta-card {
flex: 1 0 280px !important;
flex: 1 0 140px !important;
}
&.alert-builder--message-card {
flex: 3 0 320px !important;
flex: 3 0 140px !important;
}
&.alert-builder--conditions-card {
flex: 2 0 320px !important;
flex: 2 0 200px !important;
}
@media screen and (min-width: $cf-grid--breakpoint-md) {
&.alert-builder--meta-card {
flex: 1 0 280px !important;
}
&.alert-builder--message-card {
flex: 3 0 320px !important;
}
&.alert-builder--conditions-card {
flex: 2 0 320px !important;
}
}
}