fix: view editor overlay should respect table view options
parent
572e81e3ea
commit
02946a48a2
|
@ -21,6 +21,7 @@
|
|||
1. [17391](https://github.com/influxdata/influxdb/pull/17391): Fixed threshold check bug where checks could not be created when a field had a space in the name
|
||||
1. [17384](https://github.com/influxdata/influxdb/pull/17384): Reuse slices built by iterator to reduce allocations
|
||||
1. [17404](https://github.com/influxdata/influxdb/pull/17404): Updated duplicate check error message to be more explicit and actionable
|
||||
1. [17515](https://github.com/influxdata/influxdb/pull/17515): Editing a table cell shows the proper values and respects changes
|
||||
|
||||
### UI Improvements
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@ import {
|
|||
timeMachinesReducer,
|
||||
} from 'src/timeMachine/reducers'
|
||||
|
||||
import {RemoteDataState, TableViewProperties} from 'src/types'
|
||||
|
||||
describe('the Time Machine reducer', () => {
|
||||
describe('setting the default aggregateFunctionType', () => {
|
||||
const store = createStore(timeMachinesReducer, initialState())
|
||||
|
@ -189,4 +191,37 @@ describe('the Time Machine reducer', () => {
|
|||
expect(activeTimeMachine.activeQueryIndex).toBe(originalActiveQueryIndex)
|
||||
})
|
||||
})
|
||||
|
||||
// Fix for: https://github.com/influxdata/influxdb/issues/17364
|
||||
describe('editing a table view', () => {
|
||||
it('does not overwrite internal TableViewProperites when files is an empty array', () => {
|
||||
const initial = initialState()
|
||||
|
||||
const store = createStore(timeMachinesReducer, initial)
|
||||
store.dispatch({type: 'SET_VIEW_TYPE', payload: {type: 'table'}})
|
||||
|
||||
const midState = store.getState()
|
||||
const tableViewProperties = midState.timeMachines[
|
||||
midState.activeTimeMachineID
|
||||
].view.properties as TableViewProperties
|
||||
tableViewProperties.fieldOptions = [
|
||||
{internalName: '_foo', displayName: 'foo'},
|
||||
]
|
||||
|
||||
store.dispatch({
|
||||
type: 'SET_QUERY_RESULTS',
|
||||
payload: {
|
||||
status: RemoteDataState.Done,
|
||||
files: [],
|
||||
fetchDuration: 234,
|
||||
},
|
||||
})
|
||||
|
||||
const endState = store.getState()
|
||||
expect(
|
||||
(endState.timeMachines[endState.activeTimeMachineID].view
|
||||
.properties as TableViewProperties).fieldOptions[0].displayName
|
||||
).toBe(tableViewProperties.fieldOptions[0].displayName)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -274,7 +274,7 @@ export const timeMachineReducer = (
|
|||
draftState.queryResults.status = status
|
||||
draftState.queryResults.errorMessage = errorMessage
|
||||
|
||||
if (files) {
|
||||
if (files && files.length) {
|
||||
if (
|
||||
state.view &&
|
||||
state.view.properties &&
|
||||
|
|
Loading…
Reference in New Issue