diff --git a/ui/src/app/metadata/configuration/action/restore.action.ts b/ui/src/app/metadata/configuration/action/restore.action.ts index 48861c35e..b05594fab 100644 --- a/ui/src/app/metadata/configuration/action/restore.action.ts +++ b/ui/src/app/metadata/configuration/action/restore.action.ts @@ -5,13 +5,39 @@ export enum RestoreActionTypes { SELECT_VERSION_SUCCESS = '[Restore Version] Select Version Success', SELECT_VERSION_ERROR = '[Restore Version] Select Version Error', SELECT_VERSION_REQUEST = '[Restore Version] Select Version Request', + + RESTORE_VERSION_REQUEST = '[Restore Version] Restore Version Request', + RESTORE_VERSION_SUCCESS = '[Restore Version] Restore Version Request', + RESTORE_VERSION_ERROR = '[Restore Version] Restore Version Request', + CLEAR_VERSION = '[Restore Version] Clear Versions' } +export interface VersionRequest { + type: string; + id: string; + version: string; +} + +export class RestoreVersionRequest implements Action { + readonly type = RestoreActionTypes.RESTORE_VERSION_REQUEST; + constructor(public payload: VersionRequest) { } +} + +export class RestoreVersionSuccess implements Action { + readonly type = RestoreActionTypes.RESTORE_VERSION_SUCCESS; + constructor(public payload: Metadata) { } +} + +export class RestoreVersionError implements Action { + readonly type = RestoreActionTypes.RESTORE_VERSION_ERROR; + constructor(public payload: any) { } +} + export class SelectVersionRestoreRequest implements Action { readonly type = RestoreActionTypes.SELECT_VERSION_REQUEST; - constructor(public payload: { type: string, id: string, version: string }) { } + constructor(public payload: VersionRequest) { } } export class SelectVersionRestoreSuccess implements Action { @@ -33,4 +59,7 @@ export type RestoreActionsUnion = | SelectVersionRestoreRequest | SelectVersionRestoreError | SelectVersionRestoreSuccess + | RestoreVersionRequest + | RestoreVersionSuccess + | RestoreVersionError | ClearVersionRestore; diff --git a/ui/src/app/metadata/configuration/container/configuration.component.ts b/ui/src/app/metadata/configuration/container/configuration.component.ts index d8c0234c6..7e8d6f443 100644 --- a/ui/src/app/metadata/configuration/container/configuration.component.ts +++ b/ui/src/app/metadata/configuration/container/configuration.component.ts @@ -37,7 +37,7 @@ export class ConfigurationComponent implements OnDestroy { type, version })) - ).subscribe(store); + ).subscribe(this.store); this.routerState.params.pipe( takeUntil(this.ngUnsubscribe), diff --git a/ui/src/app/metadata/configuration/container/metadata-history.component.ts b/ui/src/app/metadata/configuration/container/metadata-history.component.ts index 17f2c3caa..7d817b94f 100644 --- a/ui/src/app/metadata/configuration/container/metadata-history.component.ts +++ b/ui/src/app/metadata/configuration/container/metadata-history.component.ts @@ -49,6 +49,7 @@ export class MetadataHistoryComponent { this.router.navigate( [ '../', 'restore' ], { + queryParams: { version: version.id }, relativeTo: this.route } ); diff --git a/ui/src/app/metadata/configuration/container/restore.component.html b/ui/src/app/metadata/configuration/container/restore.component.html index c842aa47d..0b5a2f1ac 100644 --- a/ui/src/app/metadata/configuration/container/restore.component.html +++ b/ui/src/app/metadata/configuration/container/restore.component.html @@ -1,12 +1,14 @@
Restoring this version will copy the configuration from the selected version and create a new version from these settings. You can then edit the configuration before saving the new version.
- Cancel Restore +Restoring this version will copy the Version ({{ date$ | async | date:DATE_FORMAT }}) configuration and create a new Version from the + selected version settings. You can then edit the configuration before saving the new version.
+ Cancel +