mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
[Management] Show internal indices when toggled even if there are no other indices (#19618) (#19646)
* Ensure we only show the empty state component if they have no data indices AND the include system indices is not checked * Add snapshot test for bug find
This commit is contained in:
parent
6e43505fa0
commit
b6434d0685
3 changed files with 43 additions and 1 deletions
|
@ -59,3 +59,26 @@ exports[`CreateIndexPatternWizard renders time field step when step is set to 2
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`CreateIndexPatternWizard shows system indices even if there are no other indices if the include system indices is toggled 1`] = `
|
||||||
|
<div>
|
||||||
|
<Header
|
||||||
|
isIncludingSystemIndices={true}
|
||||||
|
onChangeIncludingSystemIndices={[Function]}
|
||||||
|
/>
|
||||||
|
<StepIndexPattern
|
||||||
|
allIndices={
|
||||||
|
Array [
|
||||||
|
Object {
|
||||||
|
"name": ".kibana ",
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
esService={Object {}}
|
||||||
|
goToNextStep={[Function]}
|
||||||
|
initialQuery=""
|
||||||
|
isIncludingSystemIndices={true}
|
||||||
|
savedObjectsClient={Object {}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
|
@ -77,6 +77,25 @@ describe('CreateIndexPatternWizard', () => {
|
||||||
expect(component).toMatchSnapshot();
|
expect(component).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('shows system indices even if there are no other indices if the include system indices is toggled', async () => {
|
||||||
|
const component = shallow(
|
||||||
|
<CreateIndexPatternWizard
|
||||||
|
loadingDataDocUrl={loadingDataDocUrl}
|
||||||
|
initialQuery={initialQuery}
|
||||||
|
services={services}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
component.setState({
|
||||||
|
isInitiallyLoadingIndices: false,
|
||||||
|
isIncludingSystemIndices: true,
|
||||||
|
allIndices: [{ name: '.kibana ' }]
|
||||||
|
});
|
||||||
|
|
||||||
|
await component.update();
|
||||||
|
expect(component).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
it('renders index pattern step when there are indices', async () => {
|
it('renders index pattern step when there are indices', async () => {
|
||||||
const component = shallow(
|
const component = shallow(
|
||||||
<CreateIndexPatternWizard
|
<CreateIndexPatternWizard
|
||||||
|
|
|
@ -125,7 +125,7 @@ export class CreateIndexPatternWizard extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
const hasDataIndices = allIndices.some(({ name }) => !name.startsWith('.'));
|
const hasDataIndices = allIndices.some(({ name }) => !name.startsWith('.'));
|
||||||
if (!hasDataIndices) {
|
if (!hasDataIndices && !isIncludingSystemIndices) {
|
||||||
return <EmptyState onRefresh={this.fetchIndices} />;
|
return <EmptyState onRefresh={this.fetchIndices} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue