Skip to content

Commit

Permalink
change wizard doc version to 2; change migration version to 2.3.0
Browse files Browse the repository at this point in the history
Signed-off-by: abbyhu2000 <[email protected]>
  • Loading branch information
abbyhu2000 committed Sep 3, 2022
1 parent 5dbbd1e commit 00b1812
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,14 @@ export const getTopNavConfig = (
visualizationState,
styleState,
saveDisabledReason,
dispatch
dispatch,
}: TopNavConfigParams,
{ history, toastNotifications, i18n: { Context: I18nContext }, data: { indexPatterns } }: WizardServices
{
history,
toastNotifications,
i18n: { Context: I18nContext },
data: { indexPatterns },
}: WizardServices
) => {
const topNavConfig: TopNavMenuData[] = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function createSavedWizardVisClass(services: SavedObjectOpenSearchDashboa
description: '',
visualizationState: '{}',
styleState: '{}',
version: 1,
version: 2,
},
});
this.showInRecentlyAccessed = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { wizardSavedObjectTypeMigrations } from './wizard_migration';

const savedObjectMigrationContext = (null as unknown) as SavedObjectMigrationContext;

describe('3.0.0', () => {
describe('2.3.0', () => {
const migrate = (doc: any) =>
wizardSavedObjectTypeMigrations['3.0.0'](
wizardSavedObjectTypeMigrations['2.3.0'](
doc as Parameters<SavedObjectMigrationFn>[0],
savedObjectMigrationContext
);
Expand Down Expand Up @@ -76,6 +76,7 @@ describe('3.0.0', () => {
activeVisualization: {},
indexPattern: 'indexPatternId',
}),
version: 1,
},
references: [],
});
Expand All @@ -87,6 +88,7 @@ describe('3.0.0', () => {
searchFields: {},
activeVisualization: {},
}),
version: 2,
kibanaSavedObjectMeta: {
searchSourceJSON: JSON.stringify({
indexRefName: 'kibanaSavedObjectMeta.searchSourceJSON.index',
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/wizard/server/saved_objects/wizard_migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const migrateIndexPattern: SavedObjectMigrationFn<any, any> = (doc) => {
type: 'index-pattern',
id: indexPatternId,
});
doc.attributes.version = 2;

return {
...doc,
Expand All @@ -46,5 +47,5 @@ const migrateIndexPattern: SavedObjectMigrationFn<any, any> = (doc) => {
};

export const wizardSavedObjectTypeMigrations = {
'3.0.0': flow(migrateIndexPattern),
'2.3.0': flow(migrateIndexPattern),
};

0 comments on commit 00b1812

Please sign in to comment.