Skip to content

Commit

Permalink
fix mgmt field refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkime committed Feb 7, 2023
1 parent 8733774 commit 67816f9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ export const EditIndexPattern = withRouter(
const isRollup = new URLSearchParams(useLocation().search).get('type') === 'rollup';
const displayIndexPatternEditor = showEditDialog ? (
<IndexPatternEditor
onSave={() => setShowEditDialog(false)}
onSave={() => {
setFields(indexPattern.getNonScriptedFields());
setShowEditDialog(false);
}}
onCancel={() => setShowEditDialog(false)}
defaultTypeIsRollup={isRollup}
editData={indexPattern}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ const getItems = (conflictDescriptions: IndexedFieldItem['conflictDescriptions']
};

export const renderFieldName = (field: IndexedFieldItem, timeFieldName?: string) => (
<span>
<span data-test-subj={`field-name-${field.name}`}>
{field.name}
{field.info && field.info.length ? (
<span>
Expand Down
25 changes: 25 additions & 0 deletions test/functional/apps/management/_index_pattern_create_delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
describe('creating and deleting default index', function describeIndexTests() {
before(async function () {
await esArchiver.emptyKibanaIndex();
await esArchiver.loadIfNeeded(
'test/functional/fixtures/es_archiver/kibana_sample_data_flights_index_pattern'
);
await kibanaServer.uiSettings.replace({});
await PageObjects.settings.navigateTo();
await PageObjects.settings.clickKibanaIndexPatterns();
Expand Down Expand Up @@ -157,6 +160,28 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});
});

describe('index pattern edit', function () {
it('should update field list', async function () {
await PageObjects.settings.editIndexPattern(
'kibana_sample_data_flights',
'timestamp',
undefined,
true
);

await retry.try(async () => {
// verify initial field list
expect(await testSubjects.exists('field-name-AvgTicketPrice')).to.be(true);
});

await PageObjects.settings.editIndexPattern('logstash-*', '@timestamp', undefined, true);
await retry.try(async () => {
// verify updated field list
expect(await testSubjects.exists('field-name-agent')).to.be(true);
});
});
});

describe('index pattern deletion', function indexDelete() {
before(function () {
const expectedAlertText = 'Delete data view';
Expand Down

0 comments on commit 67816f9

Please sign in to comment.