Skip to content

Commit a48df33

Browse files
committed
refactor: includeHidden -> includeHiddenIndices
1 parent 1de542a commit a48df33

3 files changed

Lines changed: 13 additions & 12 deletions

File tree

x-pack/plugins/index_management/public/application/sections/home/index_list/index_table/index_table.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class IndexTable extends Component {
9494
super(props);
9595

9696
this.state = {
97-
showHiddenIndices: false,
97+
includeHiddenIndices: false,
9898
dataStreamFilter: undefined,
9999
selectedIndicesMap: {},
100100
};
@@ -130,21 +130,20 @@ export class IndexTable extends Component {
130130

131131
syncUrlParams() {
132132
const { location } = this.props;
133-
// Check if the we have the includeHidden query param
134-
const { includeHidden } = qs.parse((location && location.search) || '');
135-
const nextValue = includeHidden === 'true';
136-
if (this.state.includeHidden !== nextValue) {
137-
this.setState({ includeHidden: nextValue });
133+
const { includeHiddenIndices } = qs.parse((location && location.search) || '');
134+
const nextValue = includeHiddenIndices === 'true';
135+
if (this.state.includeHiddenIndices !== nextValue) {
136+
this.setState({ includeHiddenIndices: nextValue });
138137
}
139138
}
140139

141140
setIncludeHiddenParam(hidden) {
142141
const { pathname, search } = this.props.location;
143142
const params = qs.parse(search);
144143
if (hidden) {
145-
params.includeHidden = 'true';
144+
params.includeHiddenIndices = 'true';
146145
} else {
147-
delete params.includeHidden;
146+
delete params.includeHiddenIndices;
148147
}
149148
this.props.history.push(pathname + '?' + qs.stringify(params));
150149
}
@@ -497,7 +496,7 @@ export class IndexTable extends Component {
497496
<EuiSwitch
498497
id="checkboxShowHiddenIndices"
499498
data-test-subj="indexTableIncludeHiddenIndicesToggle"
500-
checked={this.state.includeHidden}
499+
checked={this.state.includeHiddenIndices}
501500
onChange={(event) => this.setIncludeHiddenParam(event.target.checked)}
502501
label={
503502
<FormattedMessage

x-pack/plugins/index_management/public/application/store/selectors/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export const getFilteredIndices = createSelector(
9090
(indices, allIds, tableState, tableLocation) => {
9191
let indexArray = allIds.map((indexName) => indices[indexName]);
9292
indexArray = filterByToggles(indexArray, tableState.toggleNameToVisibleMap);
93-
const { includeHidden: includeHiddenParam, dataStreams: dataStreamsParam } = qs.parse(
93+
const { includeHiddenIndices: includeHiddenParam, dataStreams: dataStreamsParam } = qs.parse(
9494
tableLocation.search
9595
);
9696
const includeHidden = includeHiddenParam === 'true';

x-pack/plugins/index_management/public/application/store/selectors/indices_filter.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ describe('getFilteredIndices selector', () => {
3737
});
3838

3939
it('includes hidden indices', () => {
40-
expect(getFilteredIndices(state, { location: { search: '?includeHidden=true' } })).toEqual([
40+
expect(
41+
getFilteredIndices(state, { location: { search: '?includeHiddenIndices=true' } })
42+
).toEqual([
4143
{ name: 'index1', hidden: true, dataStream: '123' },
4244
{ name: 'index2', hidden: false },
4345
{ name: 'index3', dataStream: 'abc' },
@@ -56,7 +58,7 @@ describe('getFilteredIndices selector', () => {
5658
it('filters based on data stream and includes hidden indices', () => {
5759
expect(
5860
getFilteredIndices(state, {
59-
location: { search: '?includeHidden=true&dataStreams=123,abc,does-not-exist' },
61+
location: { search: '?includeHiddenIndices=true&dataStreams=123,abc,does-not-exist' },
6062
})
6163
).toEqual([
6264
{ name: 'index1', hidden: true, dataStream: '123' },

0 commit comments

Comments
 (0)