diff --git a/ui/src/app/metadata/configuration/effect/restore.effect.ts b/ui/src/app/metadata/configuration/effect/restore.effect.ts index bacb422f6..4825c32dc 100644 --- a/ui/src/app/metadata/configuration/effect/restore.effect.ts +++ b/ui/src/app/metadata/configuration/effect/restore.effect.ts @@ -24,7 +24,8 @@ import { getVersionModel, getConfigurationModelId, getConfigurationModelKind, - getConfigurationDefinition + getConfigurationDefinition, + getRestorationModel } from '../reducer'; import { SetMetadata } from '../action/configuration.action'; @@ -39,7 +40,7 @@ export class RestoreEffects { this.store.select(getConfigurationModelId), this.store.select(getConfigurationModelKind), this.store.select(getConfigurationModel), - this.store.select(getVersionModel) + this.store.select(getRestorationModel) ), switchMap(([action, id, kind, current, version]) => this.historyService.updateVersion(id, kind, { diff --git a/ui/src/app/metadata/configuration/reducer/index.ts b/ui/src/app/metadata/configuration/reducer/index.ts index 7bd043a2c..b26766af9 100644 --- a/ui/src/app/metadata/configuration/reducer/index.ts +++ b/ui/src/app/metadata/configuration/reducer/index.ts @@ -195,6 +195,12 @@ export const getFormattedModel = createSelector( (model, definition) => definition.formatter(model) ); +export const getRestorationModel = createSelector( + getVersionModel, + getRestorationChanges, + (model, changes) => model +); + // Mixed states export const getConfigurationModelFn = (kind, version, provider, resolver) => { diff --git a/ui/src/app/metadata/domain/component/wizard-summary.component.ts b/ui/src/app/metadata/domain/component/wizard-summary.component.ts index e8b8deb34..82cd86c8d 100644 --- a/ui/src/app/metadata/domain/component/wizard-summary.component.ts +++ b/ui/src/app/metadata/domain/component/wizard-summary.component.ts @@ -34,15 +34,11 @@ export class WizardSummaryComponent implements OnChanges { ngOnChanges(changes: SimpleChanges): void { if (changes.summary && this.summary) { - const schemas = this.summary.schema; + const schema = this.summary.schema; const model = this.summary.model; const def = this.summary.definition; const steps = def.steps; - const schema = Object.keys(schemas).reduce((coll, key) => ({ - ...merge(coll, schemas[key]) - }), {} as any); - this.sections = steps .filter(step => step.id !== 'summary') .map( diff --git a/ui/src/app/metadata/provider/container/provider-wizard.component.ts b/ui/src/app/metadata/provider/container/provider-wizard.component.ts index f1957718e..f501f7cb8 100644 --- a/ui/src/app/metadata/provider/container/provider-wizard.component.ts +++ b/ui/src/app/metadata/provider/container/provider-wizard.component.ts @@ -63,7 +63,7 @@ export class ProviderWizardComponent implements OnDestroy { this.summary$ = combineLatest( this.store.select(fromWizard.getWizardDefinition), - this.store.select(fromWizard.getSchema), + this.store.select(fromWizard.getSchemaObject), this.store.select(fromProvider.getEntityChanges) ).pipe( map(([ definition, schema, model ]) => ({ definition, schema, model })) diff --git a/ui/src/app/metadata/provider/effect/editor.effect.ts b/ui/src/app/metadata/provider/effect/editor.effect.ts index f9ac13baf..60ec2d719 100644 --- a/ui/src/app/metadata/provider/effect/editor.effect.ts +++ b/ui/src/app/metadata/provider/effect/editor.effect.ts @@ -12,8 +12,7 @@ import { LoadSchemaSuccess, LoadSchemaFail, SetDefinition, - WizardActionTypes, - AddSchema + WizardActionTypes } from '../../../wizard/action/wizard.action'; import { ResetChanges } from '../action/entity.action'; @@ -38,14 +37,6 @@ export class EditorEffects { ) ); - @Effect() - $loadSchemaSuccess = this.actions$.pipe( - ofType(WizardActionTypes.LOAD_SCHEMA_SUCCESS), - map(action => action.payload), - withLatestFrom(this.store.select(fromWizard.getWizardIndex)), - map(([schema, id]) => new AddSchema({ id, schema })) - ); - @Effect() $resetChanges = this.actions$.pipe( ofType(WizardActionTypes.SET_DEFINITION), diff --git a/ui/src/app/wizard/action/wizard.action.ts b/ui/src/app/wizard/action/wizard.action.ts index 83a5f08a5..3e630f1a1 100644 --- a/ui/src/app/wizard/action/wizard.action.ts +++ b/ui/src/app/wizard/action/wizard.action.ts @@ -58,12 +58,6 @@ export class Previous implements Action { constructor(public payload: string) { } } -export class AddSchema implements Action { - readonly type = WizardActionTypes.ADD_SCHEMA; - - constructor(public payload: { id: string, schema: any }) { } -} - export class ClearWizard implements Action { readonly type = WizardActionTypes.CLEAR; } @@ -102,7 +96,6 @@ export type WizardActionUnion = | Next | Previous | ClearWizard - | AddSchema | LoadSchemaRequest | LoadSchemaSuccess | LoadSchemaFail diff --git a/ui/src/app/wizard/reducer/wizard.reducer.spec.ts b/ui/src/app/wizard/reducer/wizard.reducer.spec.ts index d43ad334e..8276a2d68 100644 --- a/ui/src/app/wizard/reducer/wizard.reducer.spec.ts +++ b/ui/src/app/wizard/reducer/wizard.reducer.spec.ts @@ -3,7 +3,6 @@ import * as selectors from './wizard.reducer'; import { WizardActionTypes, ClearWizard, - AddSchema, SetDisabled, SetDefinition, SetIndex,