mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Log Explorer] Show only dataset name in dataset selector (#166703)
closes https://github.com/elastic/kibana/issues/166247
## 📝 Summary
This PR changes the display of datasets in the dataset selector so that
we only show the dataset name and not the whole index pattern.
ex:
- `logs-foo-*` ➡️ `foo`
- `logs-bar-*` ➡️ `bar`
## ✅ Testing
1. Navigate to the observability log explorer
2. Click the dataset selector and choose Uncategorized
3. Observe how the datasets are represented
## 🎥 Demo
8a6a1212
-46d5-4ceb-bf38-cf13d1b3e555
This commit is contained in:
parent
50bef40a1f
commit
27056ca66c
4 changed files with 14 additions and 10 deletions
|
@ -67,7 +67,9 @@ export class Dataset {
|
|||
}
|
||||
|
||||
public static create(dataset: DatasetDeps, parentIntegration?: IntegrationBase) {
|
||||
return new Dataset(dataset, parentIntegration);
|
||||
const datasetTitle = dataset.title || dataset.name.split('-')[1];
|
||||
|
||||
return new Dataset({ ...dataset, title: datasetTitle }, parentIntegration);
|
||||
}
|
||||
|
||||
public static createAllLogsDataset() {
|
||||
|
|
|
@ -83,7 +83,7 @@ export const DatasetsList = ({
|
|||
|
||||
return datasets.map((dataset) => (
|
||||
<EuiContextMenuItem key={dataset.id} onClick={() => onDatasetClick(dataset)}>
|
||||
{dataset.name}
|
||||
{dataset.title}
|
||||
</EuiContextMenuItem>
|
||||
));
|
||||
};
|
||||
|
|
|
@ -14,7 +14,8 @@ const initialPackageMap = {
|
|||
};
|
||||
const initialPackagesTexts = Object.values(initialPackageMap);
|
||||
|
||||
const expectedUncategorized = ['logs-gaming-*', 'logs-manufacturing-*', 'logs-retail-*'];
|
||||
const uncategorized = ['logs-gaming-*', 'logs-manufacturing-*', 'logs-retail-*'];
|
||||
const expectedUncategorized = uncategorized.map((dataset) => dataset.split('-')[1]);
|
||||
|
||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||
const browser = getService('browser');
|
||||
|
@ -511,7 +512,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries();
|
||||
|
||||
expect(menuEntries.length).to.be(1);
|
||||
expect(await menuEntries[0].getVisibleText()).to.be('logs-retail-*');
|
||||
expect(await menuEntries[0].getVisibleText()).to.be('retail');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -529,7 +530,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
await retry.try(async () => {
|
||||
const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries();
|
||||
|
||||
expect(await menuEntries[0].getVisibleText()).to.be('logs-gaming-*');
|
||||
expect(await menuEntries[0].getVisibleText()).to.be(expectedUncategorized[0]);
|
||||
menuEntries[0].click();
|
||||
});
|
||||
|
||||
|
@ -537,7 +538,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
const selectorButton =
|
||||
await PageObjects.observabilityLogExplorer.getDatasetSelectorButton();
|
||||
|
||||
expect(await selectorButton.getVisibleText()).to.be('logs-gaming-*');
|
||||
expect(await selectorButton.getVisibleText()).to.be(expectedUncategorized[0]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -14,7 +14,8 @@ const initialPackageMap = {
|
|||
};
|
||||
const initialPackagesTexts = Object.values(initialPackageMap);
|
||||
|
||||
const expectedUncategorized = ['logs-gaming-*', 'logs-manufacturing-*', 'logs-retail-*'];
|
||||
const uncategorized = ['logs-gaming-*', 'logs-manufacturing-*', 'logs-retail-*'];
|
||||
const expectedUncategorized = uncategorized.map((dataset) => dataset.split('-')[1]);
|
||||
|
||||
export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
||||
const browser = getService('browser');
|
||||
|
@ -518,7 +519,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries();
|
||||
|
||||
expect(menuEntries.length).to.be(1);
|
||||
expect(await menuEntries[0].getVisibleText()).to.be('logs-retail-*');
|
||||
expect(await menuEntries[0].getVisibleText()).to.be('retail');
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -536,7 +537,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
await retry.try(async () => {
|
||||
const menuEntries = await PageObjects.observabilityLogExplorer.getCurrentPanelEntries();
|
||||
|
||||
expect(await menuEntries[0].getVisibleText()).to.be('logs-gaming-*');
|
||||
expect(await menuEntries[0].getVisibleText()).to.be(expectedUncategorized[0]);
|
||||
menuEntries[0].click();
|
||||
});
|
||||
|
||||
|
@ -544,7 +545,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
|
|||
const selectorButton =
|
||||
await PageObjects.observabilityLogExplorer.getDatasetSelectorButton();
|
||||
|
||||
expect(await selectorButton.getVisibleText()).to.be('logs-gaming-*');
|
||||
expect(await selectorButton.getVisibleText()).to.be(expectedUncategorized[0]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue