fix(zero_value_checks): checks can now have a value set to 0 (#17933)
parent
35ed5734bb
commit
2eb70ee041
|
@ -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
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue