diff --git a/backend/src/integration/resources/SHIBUI-1334-1.side b/backend/src/integration/resources/SHIBUI-1334-1.side index d19bef702..8c4ed0437 100644 --- a/backend/src/integration/resources/SHIBUI-1334-1.side +++ b/backend/src/integration/resources/SHIBUI-1334-1.side @@ -2219,7 +2219,7 @@ "id": "c2d29077-30c4-45cf-81c9-b5790294e11e", "comment": "", "command": "click", - "target": "css=.btn-info > translate-i18n", + "target": "css=.btn-info", "targets": [ ["css=.btn-info > translate-i18n", "css:finder"], ["xpath=//div[2]/button/translate-i18n", "xpath:position"], @@ -2230,7 +2230,7 @@ "id": "f2e3d420-5cf5-4165-94da-41688839cf82", "comment": "", "command": "click", - "target": "css=.btn-link:nth-child(1) > translate-i18n", + "target": "css=.btn-link:nth-child(1)", "targets": [ ["css=.btn-link:nth-child(1) > translate-i18n", "css:finder"], ["xpath=//div[@id='navigation']/div/a/translate-i18n", "xpath:idRelative"], @@ -2253,7 +2253,7 @@ "id": "68972f7d-8268-4701-865c-585a39987208", "comment": "", "command": "click", - "target": "css=tr:nth-child(2) .custom-control-label", + "target": "css=tr:nth-child(3) .custom-control-label", "targets": [ ["css=tr:nth-child(2) .custom-control-label", "css:finder"], ["xpath=//tr[2]/td/div/label", "xpath:position"] @@ -2270,6 +2270,13 @@ ["xpath=//button[contains(.,'Compare Selected(2)')]", "xpath:innerText"] ], "value": "" + }, { + "id": "98aafaee-a430-4a2d-9aa5-b4c9ce0c4908", + "comment": "", + "command": "waitForElementVisible", + "target": "css=.mb-4:nth-child(2) primitive-property:nth-child(1) .d-block:nth-child(2)", + "targets": [], + "value": "10000" }, { "id": "5a976e2c-dc5f-4021-9cc6-3cad12e771ea", "comment": "", diff --git a/backend/src/integration/resources/SHIBUI-1334-2.side b/backend/src/integration/resources/SHIBUI-1334-2.side index e20c9ba3d..555b73c93 100644 --- a/backend/src/integration/resources/SHIBUI-1334-2.side +++ b/backend/src/integration/resources/SHIBUI-1334-2.side @@ -119,6 +119,13 @@ ["xpath=//li[2]/button", "xpath:position"] ], "value": "" + }, { + "id": "d072327c-78b4-4bdb-8020-b825cd26592d", + "comment": "", + "command": "waitForElementVisible", + "target": "id=/xmlId", + "targets": [], + "value": "10000" }, { "id": "86262eda-4a44-41b0-b7aa-fa46406e2601", "comment": "", @@ -578,15 +585,9 @@ }, { "id": "5636ef67-71fb-4bca-ba58-7ecf926c7bf0", "comment": "", - "command": "click", - "target": "id=/xmlId", - "targets": [ - ["id=/xmlId", "id"], - ["name=field38", "name"], - ["css=#\\/xmlId", "css:finder"], - ["xpath=//input[@id='/xmlId']", "xpath:attributes"], - ["xpath=//custom-string/div/input", "xpath:position"] - ], + "command": "pause", + "target": "5000", + "targets": [], "value": "" }, { "id": "7d641e58-47ce-4d20-908c-e0002ff73cfa", @@ -600,7 +601,14 @@ ["xpath=//input[@id='/xmlId']", "xpath:attributes"], ["xpath=//custom-string/div/input", "xpath:position"] ], - "value": "123 v2" + "value": "123 version 2" + }, { + "id": "b78c81e9-41ac-41db-837a-0db6bd4f77eb", + "comment": "", + "command": "pause", + "target": "5000", + "targets": [], + "value": "" }, { "id": "247b04c1-e690-42bc-ae15-dfbedb44d2e9", "comment": "", @@ -624,6 +632,13 @@ ["xpath=//button[contains(.,'Save')]", "xpath:innerText"] ], "value": "" + }, { + "id": "eb08417b-b8f0-46dc-9e32-e8daf3bc205d", + "comment": "", + "command": "pause", + "target": "2000", + "targets": [], + "value": "" }, { "id": "cf005a45-74ae-4f7a-a53c-ed59d63f7114", "comment": "", @@ -699,7 +714,7 @@ ["xpath=//primitive-property[4]/div/span[2]", "xpath:position"], ["xpath=//span[contains(.,'123 v2')]", "xpath:innerText"] ], - "value": "123 v2" + "value": "123 version 2" }, { "id": "a13198b9-7827-47e2-ade3-143b981d34ee", "comment": "", @@ -782,17 +797,11 @@ ], "value": "" }, { - "id": "78967fb5-8f61-46ce-9c14-9b6ceb12b03a", + "id": "270a048e-b903-4bc1-b95b-06ffbdef99de", "comment": "", - "command": "click", - "target": "css=#\\/httpMetadataResolverAttributes\\/connectionRequestTimeout-container .btn", - "targets": [ - ["css=#\\/httpMetadataResolverAttributes\\/connectionRequestTimeout-container .btn", "css:finder"], - ["xpath=(//button[@type='button'])[2]", "xpath:attributes"], - ["xpath=//div[@id='/httpMetadataResolverAttributes/connectionRequestTimeout-container']/div/div/button", "xpath:idRelative"], - ["xpath=//auto-complete/div/div/div/button", "xpath:position"], - ["xpath=//button[contains(.,'Toggle Dropdown')]", "xpath:innerText"] - ], + "command": "pause", + "target": "3000", + "targets": [], "value": "" }, { "id": "1cde012c-d521-4fd5-a7d5-7a680bba0e7b", @@ -806,7 +815,14 @@ ], "value": "" }, { - "id": "d00ecf98-7425-467c-acbb-3b39918e3462", + "id": "863e9f5e-a3d6-47e9-8b65-de639029812a", + "comment": "", + "command": "waitForElementVisible", + "target": "css=#\\/httpMetadataResolverAttributes\\/connectionRequestTimeout-container .btn", + "targets": [], + "value": "10000" + }, { + "id": "78967fb5-8f61-46ce-9c14-9b6ceb12b03a", "comment": "", "command": "click", "target": "css=#\\/httpMetadataResolverAttributes\\/connectionRequestTimeout-container .btn", @@ -818,6 +834,13 @@ ["xpath=//button[contains(.,'Toggle Dropdown')]", "xpath:innerText"] ], "value": "" + }, { + "id": "8277f894-0bbd-41f7-b3bb-1aba2a0f80be", + "comment": "", + "command": "waitForElementVisible", + "target": "id=/httpMetadataResolverAttributes/connectionRequestTimeout__option--1", + "targets": [], + "value": "10000" }, { "id": "8ba62572-354d-47f4-bb72-f9309c1cb201", "comment": "", @@ -844,6 +867,13 @@ ["xpath=//div[2]/sf-form-element/div/sf-widget-chooser/datalist-component/div/auto-complete/div/div/div/button", "xpath:position"] ], "value": "" + }, { + "id": "7014a534-b908-482f-85d2-7f7031741b04", + "comment": "", + "command": "waitForElementVisible", + "target": "id=/httpMetadataResolverAttributes/connectionTimeout__option--2", + "targets": [], + "value": "10000" }, { "id": "337ac160-7990-425f-83da-2788d8a0985e", "comment": "", @@ -869,6 +899,13 @@ ["xpath=//div[3]/sf-form-element/div/sf-widget-chooser/datalist-component/div/auto-complete/div/div/div/button", "xpath:position"] ], "value": "" + }, { + "id": "c28e3ee6-e536-4eb7-914b-896b2ec2cb9e", + "comment": "", + "command": "waitForElementVisible", + "target": "id=/httpMetadataResolverAttributes/socketTimeout__option--3", + "targets": [], + "value": "10000" }, { "id": "34693225-4754-4b27-92ee-3e37304a8cd7", "comment": "", @@ -893,6 +930,13 @@ ["xpath=//button[contains(.,'Save')]", "xpath:innerText"] ], "value": "" + }, { + "id": "c3ad6c24-736a-492a-8952-b368e123d8e1", + "comment": "", + "command": "waitForElementVisible", + "target": "linkText=Test Metadata Provider", + "targets": [], + "value": "10000" }, { "id": "8868c054-2e6a-403e-ba2b-499a56730d71", "comment": "", @@ -911,7 +955,7 @@ "id": "0092cd5c-a885-4a48-a233-b3af447b02bc", "comment": "", "command": "click", - "target": "css=.btn-link:nth-child(1) > translate-i18n", + "target": "css=.btn-link:nth-child(1)", "targets": [ ["css=.btn-link:nth-child(1) > translate-i18n", "css:finder"], ["xpath=//div[@id='navigation']/div/a/translate-i18n", "xpath:idRelative"], diff --git a/backend/src/integration/resources/SHIBUI-1361.side b/backend/src/integration/resources/SHIBUI-1361.side index 8185b484e..ae87cd2b7 100644 --- a/backend/src/integration/resources/SHIBUI-1361.side +++ b/backend/src/integration/resources/SHIBUI-1361.side @@ -601,6 +601,13 @@ "target": "id=/xmlId", "targets": [], "value": "10000" + }, { + "id": "0aae114c-3e79-4d57-8f40-e669887a8545", + "comment": "", + "command": "pause", + "target": "2000", + "targets": [], + "value": "" }, { "id": "7d641e58-47ce-4d20-908c-e0002ff73cfa", "comment": "", @@ -702,6 +709,13 @@ ["xpath=//button[contains(.,'  Restore')]", "xpath:innerText"] ], "value": "10000" + }, { + "id": "271939a6-6196-4c14-aa13-e6c31e0373c2", + "comment": "", + "command": "pause", + "target": "5000", + "targets": [], + "value": "" }, { "id": "c223e329-733c-41eb-9e85-c6f69a840179", "comment": "", @@ -857,6 +871,13 @@ ["xpath=//button[contains(.,'Toggle Dropdown')]", "xpath:innerText"] ], "value": "" + }, { + "id": "6e01f905-fd32-45a5-9517-9dd12191f7ae", + "comment": "", + "command": "waitForElementVisible", + "target": "id=/httpMetadataResolverAttributes/connectionRequestTimeout__option--1", + "targets": [], + "value": "10000" }, { "id": "8ba62572-354d-47f4-bb72-f9309c1cb201", "comment": "", @@ -883,6 +904,13 @@ ["xpath=//div[2]/sf-form-element/div/sf-widget-chooser/datalist-component/div/auto-complete/div/div/div/button", "xpath:position"] ], "value": "" + }, { + "id": "01d5f751-6964-4fd8-a0de-36fd79d7be99", + "comment": "", + "command": "waitForElementVisible", + "target": "id=/httpMetadataResolverAttributes/connectionTimeout__option--2", + "targets": [], + "value": "10000" }, { "id": "337ac160-7990-425f-83da-2788d8a0985e", "comment": "", @@ -908,6 +936,13 @@ ["xpath=//div[3]/sf-form-element/div/sf-widget-chooser/datalist-component/div/auto-complete/div/div/div/button", "xpath:position"] ], "value": "" + }, { + "id": "99c7ec5a-ad8c-4970-b97f-27997098c0d6", + "comment": "", + "command": "waitForElementVisible", + "target": "id=/httpMetadataResolverAttributes/socketTimeout__option--3", + "targets": [], + "value": "10000" }, { "id": "34693225-4754-4b27-92ee-3e37304a8cd7", "comment": "", @@ -932,6 +967,13 @@ ["xpath=//button[contains(.,'Save')]", "xpath:innerText"] ], "value": "" + }, { + "id": "4e2831c6-d1ba-409d-a0cc-7a25dad75421", + "comment": "", + "command": "waitForElementVisible", + "target": "linkText=Test Metadata Provider", + "targets": [], + "value": "10000" }, { "id": "8868c054-2e6a-403e-ba2b-499a56730d71", "comment": "", @@ -1050,6 +1092,13 @@ "target": "isDate", "targets": [], "value": "true" + }, { + "id": "48fc4781-3313-4f56-8546-00e8210d9641", + "comment": "", + "command": "pause", + "target": "5000", + "targets": [], + "value": "" }, { "id": "2cfe222d-a506-4f2b-8840-4b4a76cf2bfb", "comment": "", @@ -1065,7 +1114,7 @@ "id": "a10e3e37-28f1-403f-b572-8b4020de7904", "comment": "", "command": "click", - "target": "css=tr:nth-child(2) .custom-control-label", + "target": "css=tr:nth-child(3) .custom-control-label", "targets": [ ["css=tr:nth-child(2) .custom-control-label", "css:finder"], ["xpath=//tr[2]/td/div/label", "xpath:position"] diff --git a/backend/src/main/resources/i18n/messages.properties b/backend/src/main/resources/i18n/messages.properties index 621dc4e63..673a47728 100644 --- a/backend/src/main/resources/i18n/messages.properties +++ b/backend/src/main/resources/i18n/messages.properties @@ -60,6 +60,7 @@ action.restore=Restore value.enabled=Enabled value.disabled=Disabled value.current=Current +value.not-current=Not Current value.none=None value.file=File value.memory=Memory diff --git a/ui/src/app/metadata/configuration/action/configuration.action.ts b/ui/src/app/metadata/configuration/action/configuration.action.ts index 8a12d47c8..b1eb9c00a 100644 --- a/ui/src/app/metadata/configuration/action/configuration.action.ts +++ b/ui/src/app/metadata/configuration/action/configuration.action.ts @@ -71,13 +71,13 @@ export class SetMetadataModel implements Action { constructor(public payload: Metadata) { } } -export class SetDefinition implements Action { +export class SetConfigurationDefinition implements Action { readonly type = ConfigurationActionTypes.SET_DEFINITION; constructor(public payload: Wizard) { } } -export class SetSchema implements Action { +export class SetConfigurationSchema implements Action { readonly type = ConfigurationActionTypes.SET_SCHEMA; constructor(public payload: Schema) { } @@ -105,8 +105,8 @@ export type ConfigurationActionsUnion = | LoadXmlSuccess | LoadXmlError | SetMetadata - | SetDefinition - | SetSchema + | SetConfigurationDefinition + | SetConfigurationSchema | SetXml | DownloadXml | ClearConfiguration; diff --git a/ui/src/app/metadata/configuration/action/restore.action.ts b/ui/src/app/metadata/configuration/action/restore.action.ts index 290367054..978e9eee4 100644 --- a/ui/src/app/metadata/configuration/action/restore.action.ts +++ b/ui/src/app/metadata/configuration/action/restore.action.ts @@ -1,27 +1,25 @@ import { Action } from '@ngrx/store'; import { Metadata } from '../../domain/domain.type'; +import { VersionRequest } from '../model/request'; 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 Success', RESTORE_VERSION_ERROR = '[Restore Version] Restore Version Error', - CLEAR_VERSION = '[Restore Version] Clear Versions' -} + UPDATE_RESTORATION_REQUEST = '[Restore Version] Update Changes Request', + UPDATE_RESTORATION_SUCCESS = '[Restore Version] Update Changes Success', + + UPDATE_STATUS = '[Restore Version] Update Restore Form Status', + SET_SAVING_STATUS = '[Restore Version] Set Saving Status', -export interface VersionRequest { - type: string; - id: string; - version: string; + CLEAR_VERSION = '[Restore Version] Clear Versions', + CANCEL_RESTORE = '[Restore Version] Cancel Restore' } export class RestoreVersionRequest implements Action { readonly type = RestoreActionTypes.RESTORE_VERSION_REQUEST; - constructor(public payload: VersionRequest) { } + constructor() { } } export class RestoreVersionSuccess implements Action { @@ -34,32 +32,39 @@ export class RestoreVersionError implements Action { constructor(public payload: any) { } } -export class SelectVersionRestoreRequest implements Action { - readonly type = RestoreActionTypes.SELECT_VERSION_REQUEST; +export class UpdateRestorationChangesRequest implements Action { + readonly type = RestoreActionTypes.UPDATE_RESTORATION_REQUEST; + constructor(public payload: Partial) { } +} - constructor(public payload: VersionRequest) { } +export class UpdateRestorationChangesSuccess implements Action { + readonly type = RestoreActionTypes.UPDATE_RESTORATION_SUCCESS; + constructor(public payload: Partial) { } } -export class SelectVersionRestoreSuccess implements Action { - readonly type = RestoreActionTypes.SELECT_VERSION_SUCCESS; +export class UpdateRestoreFormStatus implements Action { + readonly type = RestoreActionTypes.UPDATE_STATUS; - constructor(public payload: Metadata) { } + constructor(public payload: { [key: string]: string }) { } } -export class SelectVersionRestoreError implements Action { - readonly type = RestoreActionTypes.SELECT_VERSION_ERROR; - constructor(public payload: any) { } +export class SetSavingStatus implements Action { + readonly type = RestoreActionTypes.SET_SAVING_STATUS; + + constructor(public payload: boolean) { } } -export class ClearVersionRestore implements Action { - readonly type = RestoreActionTypes.CLEAR_VERSION; +export class CancelRestore implements Action { + readonly type = RestoreActionTypes.CANCEL_RESTORE; + constructor() { } } export type RestoreActionsUnion = - | SelectVersionRestoreRequest - | SelectVersionRestoreError - | SelectVersionRestoreSuccess | RestoreVersionRequest | RestoreVersionSuccess | RestoreVersionError - | ClearVersionRestore; + | UpdateRestorationChangesRequest + | UpdateRestorationChangesSuccess + | UpdateRestoreFormStatus + | SetSavingStatus + | CancelRestore; diff --git a/ui/src/app/metadata/configuration/action/version.action.ts b/ui/src/app/metadata/configuration/action/version.action.ts new file mode 100644 index 000000000..0379a240b --- /dev/null +++ b/ui/src/app/metadata/configuration/action/version.action.ts @@ -0,0 +1,40 @@ +import { Action } from '@ngrx/store'; +import { Metadata } from '../../domain/domain.type'; +import { VersionRequest } from '../model/request'; + +export enum VersionActionTypes { + SELECT_VERSION_SUCCESS = '[Version] Select Version Success', + SELECT_VERSION_ERROR = '[Version] Select Version Error', + SELECT_VERSION_REQUEST = '[Version] Select Version Request', + + CLEAR_VERSION = '[Version] Clear Versions' +} + +export class SelectVersionRequest implements Action { + readonly type = VersionActionTypes.SELECT_VERSION_REQUEST; + + constructor(public payload: VersionRequest) { } +} + +export class SelectVersionSuccess implements Action { + readonly type = VersionActionTypes.SELECT_VERSION_SUCCESS; + + constructor(public payload: Metadata) { } +} +export class SelectVersionError implements Action { + readonly type = VersionActionTypes.SELECT_VERSION_ERROR; + + constructor(public payload: any) { } +} + +export class ClearVersion implements Action { + readonly type = VersionActionTypes.CLEAR_VERSION; + + constructor() { } +} + +export type VersionActionsUnion = + | SelectVersionRequest + | SelectVersionError + | SelectVersionSuccess + | ClearVersion; diff --git a/ui/src/app/metadata/configuration/component/editor.component.html b/ui/src/app/metadata/configuration/component/editor.component.html new file mode 100644 index 000000000..fd71771aa --- /dev/null +++ b/ui/src/app/metadata/configuration/component/editor.component.html @@ -0,0 +1,14 @@ +
+ + + {{ lock.value ? 'Locked' : 'Unlocked' }} + + For Advanced Knowledge Only +
+ \ No newline at end of file diff --git a/ui/src/app/metadata/configuration/component/editor.component.ts b/ui/src/app/metadata/configuration/component/editor.component.ts new file mode 100644 index 000000000..59f3ef375 --- /dev/null +++ b/ui/src/app/metadata/configuration/component/editor.component.ts @@ -0,0 +1,29 @@ +import { Component, Input, Output, EventEmitter } from '@angular/core'; +import { FormControl } from '@angular/forms'; +import { Metadata } from '../../domain/domain.type'; + + +@Component({ + selector: 'metadata-editor', + templateUrl: './editor.component.html', + styleUrls: [] +}) +export class MetadataEditorComponent { + + @Input() schema: any; + @Input() bindings: any; + @Input() validators: { [key: string]: any }; + @Input() model: Metadata; + @Input() lockable: boolean; + + @Output() change: EventEmitter = new EventEmitter(); + @Output() status: EventEmitter = new EventEmitter(); + @Output() onLockChange: EventEmitter = new EventEmitter(); + + lock: FormControl = new FormControl(true); + + constructor() { + this.lock.valueChanges.subscribe(locked => this.onLockChange.emit(locked)); + } +} + diff --git a/ui/src/app/metadata/configuration/component/filter-configuration-list-item.component.html b/ui/src/app/metadata/configuration/component/filter-configuration-list-item.component.html index b8df62a11..cf1cfe3be 100644 --- a/ui/src/app/metadata/configuration/component/filter-configuration-list-item.component.html +++ b/ui/src/app/metadata/configuration/component/filter-configuration-list-item.component.html @@ -1,6 +1,6 @@
{{ index + 1 }} -
+

-
+
diff --git a/ui/src/app/metadata/configuration/component/filter-configuration-list-item.component.ts b/ui/src/app/metadata/configuration/component/filter-configuration-list-item.component.ts index ede42a55a..9e5cb7630 100644 --- a/ui/src/app/metadata/configuration/component/filter-configuration-list-item.component.ts +++ b/ui/src/app/metadata/configuration/component/filter-configuration-list-item.component.ts @@ -16,6 +16,7 @@ export class FilterConfigurationListItemComponent implements OnChanges { @Input() index: number; @Input() isFirst: boolean; @Input() isLast: boolean; + @Input() editable: boolean; @Output() onUpdateOrderUp: EventEmitter = new EventEmitter(); @Output() onUpdateOrderDown: EventEmitter = new EventEmitter(); diff --git a/ui/src/app/metadata/configuration/component/filter-configuration-list.component.html b/ui/src/app/metadata/configuration/component/filter-configuration-list.component.html index c49a7738c..03d89d651 100644 --- a/ui/src/app/metadata/configuration/component/filter-configuration-list.component.html +++ b/ui/src/app/metadata/configuration/component/filter-configuration-list.component.html @@ -6,6 +6,7 @@ [index]="i" [isFirst]="isFirst" [isLast]="isLast" + [editable]="editable" (onUpdateOrderDown)="onUpdateOrderDown.emit($event)" (onUpdateOrderUp)="onUpdateOrderUp.emit($event)" (onRemove)="onRemove.emit($event)"> diff --git a/ui/src/app/metadata/configuration/component/filter-configuration-list.component.ts b/ui/src/app/metadata/configuration/component/filter-configuration-list.component.ts index 5208a7f4c..17f377480 100644 --- a/ui/src/app/metadata/configuration/component/filter-configuration-list.component.ts +++ b/ui/src/app/metadata/configuration/component/filter-configuration-list.component.ts @@ -1,8 +1,10 @@ -import { Component } from '@angular/core'; +import { Component, Input } from '@angular/core'; import { FilterListComponent } from '../../filter/component/filter-list.component'; @Component({ selector: 'filter-configuration-list', templateUrl: './filter-configuration-list.component.html' }) -export class FilterConfigurationListComponent extends FilterListComponent { } +export class FilterConfigurationListComponent extends FilterListComponent { + @Input() editable = true; +} diff --git a/ui/src/app/metadata/configuration/component/history-list.component.html b/ui/src/app/metadata/configuration/component/history-list.component.html index 168d0cf19..668308311 100644 --- a/ui/src/app/metadata/configuration/component/history-list.component.html +++ b/ui/src/app/metadata/configuration/component/history-list.component.html @@ -21,13 +21,11 @@
- - - {{ version.date | date:DATE_FORMAT }}  - - (Current) - - + + {{ version.date | date:DATE_FORMAT }} (Current) + + + {{ version.date | date:DATE_FORMAT }} {{ version.creator }} diff --git a/ui/src/app/metadata/configuration/component/metadata-configuration.component.html b/ui/src/app/metadata/configuration/component/metadata-configuration.component.html index f5ab2814b..f4826cfe6 100644 --- a/ui/src/app/metadata/configuration/component/metadata-configuration.component.html +++ b/ui/src/app/metadata/configuration/component/metadata-configuration.component.html @@ -1,8 +1,7 @@
-
+

diff --git a/ui/src/app/metadata/configuration/component/metadata-header.component.html b/ui/src/app/metadata/configuration/component/metadata-header.component.html index 9041ae00e..5278ed3bd 100644 --- a/ui/src/app/metadata/configuration/component/metadata-header.component.html +++ b/ui/src/app/metadata/configuration/component/metadata-header.component.html @@ -2,16 +2,17 @@
Saved:  - {{ version.date | date:DATE_FORMAT }} + {{ version.modifiedDate | date:DATE_FORMAT }}
By:  - {{ version.creator }} + {{ version.createdBy }}

Enabled Disabled   Current + Not Current

\ No newline at end of file diff --git a/ui/src/app/metadata/configuration/component/metadata-header.component.spec.ts b/ui/src/app/metadata/configuration/component/metadata-header.component.spec.ts index e8db42c36..f3cfd0d45 100644 --- a/ui/src/app/metadata/configuration/component/metadata-header.component.spec.ts +++ b/ui/src/app/metadata/configuration/component/metadata-header.component.spec.ts @@ -9,7 +9,6 @@ import { MetadataHeaderComponent } from './metadata-header.component'; ` @@ -25,7 +24,6 @@ class TestHostComponent { creator: 'foobar', date: new Date().toDateString() }; - versionNumber = 1; isCurrent = false; } diff --git a/ui/src/app/metadata/configuration/component/metadata-header.component.ts b/ui/src/app/metadata/configuration/component/metadata-header.component.ts index 590be316e..cc0df37b1 100644 --- a/ui/src/app/metadata/configuration/component/metadata-header.component.ts +++ b/ui/src/app/metadata/configuration/component/metadata-header.component.ts @@ -1,6 +1,5 @@ import { Component, Input } from '@angular/core'; -import { Metadata, MetadataTypes } from '../../domain/domain.type'; -import { MetadataVersion } from '../model/version'; +import { Metadata } from '../../domain/domain.type'; import { CONFIG_DATE_FORMAT } from '../configuration.values'; @@ -12,8 +11,7 @@ import { CONFIG_DATE_FORMAT } from '../configuration.values'; export class MetadataHeaderComponent { @Input() isEnabled: boolean; - @Input() version: MetadataVersion; - @Input() versionNumber: number; + @Input() version: Metadata; @Input() isCurrent: boolean; DATE_FORMAT = CONFIG_DATE_FORMAT; diff --git a/ui/src/app/metadata/configuration/component/array-property.component.html b/ui/src/app/metadata/configuration/component/property/array-property.component.html similarity index 100% rename from ui/src/app/metadata/configuration/component/array-property.component.html rename to ui/src/app/metadata/configuration/component/property/array-property.component.html diff --git a/ui/src/app/metadata/configuration/component/array-property.component.scss b/ui/src/app/metadata/configuration/component/property/array-property.component.scss similarity index 100% rename from ui/src/app/metadata/configuration/component/array-property.component.scss rename to ui/src/app/metadata/configuration/component/property/array-property.component.scss diff --git a/ui/src/app/metadata/configuration/component/array-property.component.spec.ts b/ui/src/app/metadata/configuration/component/property/array-property.component.spec.ts similarity index 89% rename from ui/src/app/metadata/configuration/component/array-property.component.spec.ts rename to ui/src/app/metadata/configuration/component/property/array-property.component.spec.ts index 614738b06..c0dbcbb16 100644 --- a/ui/src/app/metadata/configuration/component/array-property.component.spec.ts +++ b/ui/src/app/metadata/configuration/component/property/array-property.component.spec.ts @@ -3,13 +3,13 @@ import { TestBed, async, ComponentFixture } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbDropdownModule, NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap'; -import { Property } from '../../domain/model/property'; -import { MockI18nModule } from '../../../../testing/i18n.stub'; -import { SCHEMA } from '../../../../testing/form-schema.stub'; -import { getStepProperty } from '../../domain/utility/configuration'; +import { Property } from '../../../domain/model/property'; +import { MockI18nModule } from '../../../../../testing/i18n.stub'; +import { SCHEMA } from '../../../../../testing/form-schema.stub'; +import { getStepProperty } from '../../../domain/utility/configuration'; import { ArrayPropertyComponent } from './array-property.component'; -import { AttributesService } from '../../domain/service/attributes.service'; -import { MockAttributeService } from '../../../../testing/attributes.stub'; +import { AttributesService } from '../../../domain/service/attributes.service'; +import { MockAttributeService } from '../../../../../testing/attributes.stub'; import { of } from 'rxjs'; @Component({ diff --git a/ui/src/app/metadata/configuration/component/array-property.component.ts b/ui/src/app/metadata/configuration/component/property/array-property.component.ts similarity index 86% rename from ui/src/app/metadata/configuration/component/array-property.component.ts rename to ui/src/app/metadata/configuration/component/property/array-property.component.ts index a17ad01da..2c4de49bd 100644 --- a/ui/src/app/metadata/configuration/component/array-property.component.ts +++ b/ui/src/app/metadata/configuration/component/property/array-property.component.ts @@ -1,9 +1,9 @@ import { Component, Input, OnChanges, Output, EventEmitter } from '@angular/core'; -import { Property } from '../../domain/model/property'; +import { Property } from '../../../domain/model/property'; import { Observable, of } from 'rxjs'; -import { AttributesService } from '../../domain/service/attributes.service'; +import { AttributesService } from '../../../domain/service/attributes.service'; import { ConfigurationPropertyComponent } from './configuration-property.component'; -import UriValidator from '../../../shared/validation/uri.validator'; +import UriValidator from '../../../../shared/validation/uri.validator'; @Component({ selector: 'array-property', diff --git a/ui/src/app/metadata/configuration/component/configuration-property.component.spec.ts b/ui/src/app/metadata/configuration/component/property/configuration-property.component.spec.ts similarity index 85% rename from ui/src/app/metadata/configuration/component/configuration-property.component.spec.ts rename to ui/src/app/metadata/configuration/component/property/configuration-property.component.spec.ts index aa7fd9478..cccfd9114 100644 --- a/ui/src/app/metadata/configuration/component/configuration-property.component.spec.ts +++ b/ui/src/app/metadata/configuration/component/property/configuration-property.component.spec.ts @@ -2,11 +2,11 @@ import { Component, ViewChild, Input } from '@angular/core'; import { TestBed, async, ComponentFixture } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; -import { NgbDropdownModule, NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap'; -import { Property } from '../../domain/model/property'; -import { MockI18nModule } from '../../../../testing/i18n.stub'; -import { SCHEMA } from '../../../../testing/form-schema.stub'; -import { getStepProperties, getStepProperty } from '../../domain/utility/configuration'; +import { NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap'; +import { Property } from '../../../domain/model/property'; +import { MockI18nModule } from '../../../../../testing/i18n.stub'; +import { SCHEMA } from '../../../../../testing/form-schema.stub'; +import { getStepProperty } from '../../../domain/utility/configuration'; import { ConfigurationPropertyComponent } from './configuration-property.component'; @Component({ diff --git a/ui/src/app/metadata/configuration/component/configuration-property.component.ts b/ui/src/app/metadata/configuration/component/property/configuration-property.component.ts similarity index 91% rename from ui/src/app/metadata/configuration/component/configuration-property.component.ts rename to ui/src/app/metadata/configuration/component/property/configuration-property.component.ts index 5418bde30..7e666bc03 100644 --- a/ui/src/app/metadata/configuration/component/configuration-property.component.ts +++ b/ui/src/app/metadata/configuration/component/property/configuration-property.component.ts @@ -1,5 +1,5 @@ import { Component, Input } from '@angular/core'; -import { Property } from '../../domain/model/property'; +import { Property } from '../../../domain/model/property'; @Component({ selector: 'configuration-property', diff --git a/ui/src/app/metadata/configuration/component/filter-target-property.component.html b/ui/src/app/metadata/configuration/component/property/filter-target-property.component.html similarity index 100% rename from ui/src/app/metadata/configuration/component/filter-target-property.component.html rename to ui/src/app/metadata/configuration/component/property/filter-target-property.component.html diff --git a/ui/src/app/metadata/configuration/component/filter-target-property.component.spec.ts b/ui/src/app/metadata/configuration/component/property/filter-target-property.component.spec.ts similarity index 79% rename from ui/src/app/metadata/configuration/component/filter-target-property.component.spec.ts rename to ui/src/app/metadata/configuration/component/property/filter-target-property.component.spec.ts index 98c08d4c4..d1308787d 100644 --- a/ui/src/app/metadata/configuration/component/filter-target-property.component.spec.ts +++ b/ui/src/app/metadata/configuration/component/property/filter-target-property.component.spec.ts @@ -3,15 +3,12 @@ import { TestBed, async, ComponentFixture } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap'; -import { Property } from '../../domain/model/property'; -import { MockI18nModule } from '../../../../testing/i18n.stub'; -import { SCHEMA } from '../../../../testing/form-schema.stub'; -import { getStepProperty } from '../../domain/utility/configuration'; +import { Property } from '../../../domain/model/property'; +import { MockI18nModule } from '../../../../../testing/i18n.stub'; +import { SCHEMA } from '../../../../../testing/form-schema.stub'; +import { getStepProperty } from '../../../domain/utility/configuration'; import { FilterTargetPropertyComponent } from './filter-target-property.component'; -import { PrimitivePropertyComponent } from './primitive-property.component'; -import { ArrayPropertyComponentStub, PrimitivePropertyComponentStub } from '../../../../testing/property-component.stub'; -import { AttributesService } from '../../domain/service/attributes.service'; -import { of } from 'rxjs'; +import { ArrayPropertyComponentStub, PrimitivePropertyComponentStub } from '../../../../../testing/property-component.stub'; @Component({ template: ` diff --git a/ui/src/app/metadata/configuration/component/filter-target-property.component.ts b/ui/src/app/metadata/configuration/component/property/filter-target-property.component.ts similarity index 91% rename from ui/src/app/metadata/configuration/component/filter-target-property.component.ts rename to ui/src/app/metadata/configuration/component/property/filter-target-property.component.ts index 6b7ebf216..8c0e89b00 100644 --- a/ui/src/app/metadata/configuration/component/filter-target-property.component.ts +++ b/ui/src/app/metadata/configuration/component/property/filter-target-property.component.ts @@ -1,5 +1,5 @@ import { Component, Input, Output, EventEmitter } from '@angular/core'; -import { Property } from '../../domain/model/property'; +import { Property } from '../../../domain/model/property'; import { ConfigurationPropertyComponent } from './configuration-property.component'; @Component({ diff --git a/ui/src/app/metadata/configuration/component/object-property.component.html b/ui/src/app/metadata/configuration/component/property/object-property.component.html similarity index 100% rename from ui/src/app/metadata/configuration/component/object-property.component.html rename to ui/src/app/metadata/configuration/component/property/object-property.component.html diff --git a/ui/src/app/metadata/configuration/component/object-property.component.spec.ts b/ui/src/app/metadata/configuration/component/property/object-property.component.spec.ts similarity index 87% rename from ui/src/app/metadata/configuration/component/object-property.component.spec.ts rename to ui/src/app/metadata/configuration/component/property/object-property.component.spec.ts index 8817711c9..d9ddcdd97 100644 --- a/ui/src/app/metadata/configuration/component/object-property.component.spec.ts +++ b/ui/src/app/metadata/configuration/component/property/object-property.component.spec.ts @@ -3,11 +3,11 @@ import { TestBed, async, ComponentFixture } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap'; -import { Property } from '../../domain/model/property'; -import { MockI18nModule } from '../../../../testing/i18n.stub'; +import { Property } from '../../../domain/model/property'; +import { MockI18nModule } from '../../../../../testing/i18n.stub'; import { ObjectPropertyComponent } from './object-property.component'; -import { SCHEMA } from '../../../../testing/form-schema.stub'; -import { getStepProperty } from '../../domain/utility/configuration'; +import { SCHEMA } from '../../../../../testing/form-schema.stub'; +import { getStepProperty } from '../../../domain/utility/configuration'; import { PrimitivePropertyComponent } from './primitive-property.component'; import { ArrayPropertyComponent } from './array-property.component'; import { FilterTargetPropertyComponent } from './filter-target-property.component'; diff --git a/ui/src/app/metadata/configuration/component/object-property.component.ts b/ui/src/app/metadata/configuration/component/property/object-property.component.ts similarity index 89% rename from ui/src/app/metadata/configuration/component/object-property.component.ts rename to ui/src/app/metadata/configuration/component/property/object-property.component.ts index 1fafafa25..9eef4afbd 100644 --- a/ui/src/app/metadata/configuration/component/object-property.component.ts +++ b/ui/src/app/metadata/configuration/component/property/object-property.component.ts @@ -1,5 +1,5 @@ import { Component, Input, Output, EventEmitter } from '@angular/core'; -import { Property } from '../../domain/model/property'; +import { Property } from '../../../domain/model/property'; import { ConfigurationPropertyComponent } from './configuration-property.component'; @Component({ diff --git a/ui/src/app/metadata/configuration/component/primitive-property.component.html b/ui/src/app/metadata/configuration/component/property/primitive-property.component.html similarity index 100% rename from ui/src/app/metadata/configuration/component/primitive-property.component.html rename to ui/src/app/metadata/configuration/component/property/primitive-property.component.html diff --git a/ui/src/app/metadata/configuration/component/primitive-property.component.spec.ts b/ui/src/app/metadata/configuration/component/property/primitive-property.component.spec.ts similarity index 92% rename from ui/src/app/metadata/configuration/component/primitive-property.component.spec.ts rename to ui/src/app/metadata/configuration/component/property/primitive-property.component.spec.ts index 9ce81bfb5..dbc3eed4f 100644 --- a/ui/src/app/metadata/configuration/component/primitive-property.component.spec.ts +++ b/ui/src/app/metadata/configuration/component/property/primitive-property.component.spec.ts @@ -3,8 +3,8 @@ import { TestBed, async, ComponentFixture } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { Property } from '../../domain/model/property'; -import { MockI18nModule } from '../../../../testing/i18n.stub'; +import { Property } from '../../../domain/model/property'; +import { MockI18nModule } from '../../../../../testing/i18n.stub'; import { PrimitivePropertyComponent } from './primitive-property.component'; @Component({ diff --git a/ui/src/app/metadata/configuration/component/primitive-property.component.ts b/ui/src/app/metadata/configuration/component/property/primitive-property.component.ts similarity index 100% rename from ui/src/app/metadata/configuration/component/primitive-property.component.ts rename to ui/src/app/metadata/configuration/component/property/primitive-property.component.ts diff --git a/ui/src/app/metadata/configuration/configuration.module.ts b/ui/src/app/metadata/configuration/configuration.module.ts index 906bed24d..ae332ddf3 100644 --- a/ui/src/app/metadata/configuration/configuration.module.ts +++ b/ui/src/app/metadata/configuration/configuration.module.ts @@ -11,10 +11,12 @@ import { ConfigurationComponent } from './container/configuration.component'; import { MetadataConfigurationService } from './service/configuration.service'; import * as fromConfig from './reducer'; import { MetadataConfigurationEffects } from './effect/configuration.effect'; -import { ConfigurationPropertyComponent } from './component/configuration-property.component'; -import { PrimitivePropertyComponent } from './component/primitive-property.component'; -import { ObjectPropertyComponent } from './component/object-property.component'; -import { ArrayPropertyComponent } from './component/array-property.component'; +import { ConfigurationPropertyComponent } from './component/property/configuration-property.component'; +import { PrimitivePropertyComponent } from './component/property/primitive-property.component'; +import { ObjectPropertyComponent } from './component/property/object-property.component'; +import { ArrayPropertyComponent } from './component/property/array-property.component'; +import { FilterTargetPropertyComponent } from './component/property/filter-target-property.component'; + import { MetadataOptionsComponent } from './container/metadata-options.component'; import { MetadataXmlComponent } from './container/metadata-xml.component'; import { MetadataHeaderComponent } from './component/metadata-header.component'; @@ -29,9 +31,19 @@ import { FilterModule } from '../filter/filter.module'; import { FilterConfigurationListComponent } from './component/filter-configuration-list.component'; import { FilterConfigurationListItemComponent } from './component/filter-configuration-list-item.component'; import { SharedModule } from '../../shared/shared.module'; -import { FilterTargetPropertyComponent } from './component/filter-target-property.component'; + import { RestoreComponent } from './container/restore.component'; -import { RestoreVersionEffects } from './effect/restore.effect'; +import { RestoreEffects } from './effect/restore.effect'; +import { VersionComponent } from './container/version.component'; +import { VersionOptionsComponent } from './container/version-options.component'; +import { VersionEffects } from './effect/version.effect'; +import { MetadataEditorComponent } from './component/editor.component'; +import { WizardModule } from '../../wizard/wizard.module'; +import { FormModule } from '../../schema-form/schema-form.module'; +import { RestoreEditComponent } from './container/restore-edit.component'; +import { RestoreEditStepComponent } from './container/restore-edit-step.component'; + +import { IndexResolver } from './service/index-resolver.service'; @NgModule({ declarations: [ @@ -50,7 +62,12 @@ import { RestoreVersionEffects } from './effect/restore.effect'; FilterConfigurationListComponent, FilterConfigurationListItemComponent, FilterTargetPropertyComponent, - RestoreComponent + RestoreComponent, + VersionComponent, + VersionOptionsComponent, + MetadataEditorComponent, + RestoreEditComponent, + RestoreEditStepComponent ], entryComponents: [], imports: [ @@ -60,11 +77,14 @@ import { RestoreVersionEffects } from './effect/restore.effect'; RouterModule, DomainModule, FilterModule, - SharedModule + SharedModule, + WizardModule, + FormModule ], exports: [], providers: [ - DatePipe + DatePipe, + IndexResolver ] }) export class MetadataConfigurationModule { @@ -88,7 +108,8 @@ export class MetadataConfigurationModule { MetadataConfigurationEffects, MetadataHistoryEffects, CompareVersionEffects, - RestoreVersionEffects + RestoreEffects, + VersionEffects ]) ], providers: [] diff --git a/ui/src/app/metadata/configuration/configuration.routing.ts b/ui/src/app/metadata/configuration/configuration.routing.ts index dc3f5df99..fec3c84da 100644 --- a/ui/src/app/metadata/configuration/configuration.routing.ts +++ b/ui/src/app/metadata/configuration/configuration.routing.ts @@ -5,6 +5,11 @@ import { MetadataXmlComponent } from './container/metadata-xml.component'; import { MetadataHistoryComponent } from './container/metadata-history.component'; import { MetadataComparisonComponent } from './container/metadata-comparison.component'; import { RestoreComponent } from './container/restore.component'; +import { VersionComponent } from './container/version.component'; +import { VersionOptionsComponent } from './container/version-options.component'; +import { RestoreEditComponent } from './container/restore-edit.component'; +import { IndexResolver } from './service/index-resolver.service'; +import { RestoreEditStepComponent } from './container/restore-edit-step.component'; export const ConfigurationRoutes: Routes = [ { @@ -32,8 +37,35 @@ export const ConfigurationRoutes: Routes = [ component: MetadataComparisonComponent }, { - path: 'restore', - component: RestoreComponent + path: 'version/:version', + component: VersionComponent, + children: [ + { + path: 'options', + component: VersionOptionsComponent + }, + { + path: 'restore', + component: RestoreComponent + }, + { + path: 'edit', + redirectTo: 'edit/common' + }, + { + path: 'edit', + component: RestoreEditComponent, + children: [ + { + path: ':index', + component: RestoreEditStepComponent, + resolve: { + index: IndexResolver + } + } + ] + } + ] } ] } diff --git a/ui/src/app/metadata/configuration/container/configuration.component.spec.ts b/ui/src/app/metadata/configuration/container/configuration.component.spec.ts index 0d2fca0d3..b1d9bc2f2 100644 --- a/ui/src/app/metadata/configuration/container/configuration.component.spec.ts +++ b/ui/src/app/metadata/configuration/container/configuration.component.spec.ts @@ -1,10 +1,9 @@ -import { Component, ViewChild, Input } from '@angular/core'; +import { Component, ViewChild } from '@angular/core'; import { TestBed, async, ComponentFixture } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { StoreModule, combineReducers } from '@ngrx/store'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import { MetadataConfiguration } from '../model/metadata-configuration'; import { ConfigurationComponent } from './configuration.component'; import * as fromConfiguration from '../reducer'; import * as fromProviders from '../../provider/reducer'; @@ -19,11 +18,6 @@ import { MockI18nModule } from '../../../../testing/i18n.stub'; class TestHostComponent { @ViewChild(ConfigurationComponent) public componentUnderTest: ConfigurationComponent; - - configuration: MetadataConfiguration = { - dates: [], - sections: [] - }; } describe('Metadata Configuration Page Component', () => { @@ -59,12 +53,4 @@ describe('Metadata Configuration Page Component', () => { it('should load metadata objects', async(() => { expect(app).toBeTruthy(); })); - - describe('hasVersion function', () => { - it('should determine if a version is defined', () => { - expect(app.hasVersion([[{id: 'foo'}], { version: 'foo' }])).toBe('foo'); - expect(app.hasVersion([[{ id: 'foo' }], {}])).toBe('foo'); - expect(app.hasVersion([[], {}])).toBeNull(); - }); - }); }); diff --git a/ui/src/app/metadata/configuration/container/configuration.component.ts b/ui/src/app/metadata/configuration/container/configuration.component.ts index 295f90257..c1e2daf35 100644 --- a/ui/src/app/metadata/configuration/container/configuration.component.ts +++ b/ui/src/app/metadata/configuration/container/configuration.component.ts @@ -1,13 +1,12 @@ -import { Component, ChangeDetectionStrategy, OnDestroy, HostListener } from '@angular/core'; -import { ActivatedRoute, Router, Scroll, Event } from '@angular/router'; -import { takeUntil, map, withLatestFrom, filter, timeout, delay } from 'rxjs/operators'; +import { Component, ChangeDetectionStrategy, OnDestroy } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { takeUntil, map } from 'rxjs/operators'; import { Store } from '@ngrx/store'; -import { Observable, Subject, interval, combineLatest } from 'rxjs'; +import { Observable, Subject } from 'rxjs'; import * as fromConfiguration from '../reducer'; import { ClearConfiguration, SetMetadata } from '../action/configuration.action'; -import { LoadHistoryRequest, ClearHistory, SelectVersion } from '../action/history.action'; import * as fromReducer from '../reducer'; @Component({ @@ -22,39 +21,20 @@ export class ConfigurationComponent implements OnDestroy { name$: Observable; type$: Observable; - hasVersion = ([collection, params]) => params.version || collection && collection.length > 0 ? collection[0].id : null; - constructor( private store: Store, private routerState: ActivatedRoute ) { - combineLatest( - this.routerState.params, - this.routerState.queryParams - ).pipe( + this.routerState.params.pipe( takeUntil(this.ngUnsubscribe), - map(([{ id, type }, { version }]) => new SetMetadata({ + map(({ id, type, version }) => new SetMetadata({ id, type, version })) ).subscribe(this.store); - this.routerState.params.pipe( - takeUntil(this.ngUnsubscribe), - map(params => new LoadHistoryRequest({ id: params.id, type: params.type })) - ).subscribe(store); - - this.store.select(fromReducer.getVersionCollection).pipe( - filter(collection => collection && collection.length > 0), - takeUntil(this.ngUnsubscribe), - withLatestFrom( - this.routerState.queryParams - ), - map(this.hasVersion) - ).subscribe(version => this.store.dispatch(new SelectVersion(version))); - this.name$ = this.store.select(fromReducer.getConfigurationModelName); this.type$ = this.store.select(fromReducer.getConfigurationModelType); } @@ -63,6 +43,5 @@ export class ConfigurationComponent implements OnDestroy { this.ngUnsubscribe.next(); this.ngUnsubscribe.complete(); this.store.dispatch(new ClearConfiguration()); - this.store.dispatch(new ClearHistory()); } } diff --git a/ui/src/app/metadata/configuration/container/metadata-comparison.component.html b/ui/src/app/metadata/configuration/container/metadata-comparison.component.html index 7117b7bf6..8e652d1c2 100644 --- a/ui/src/app/metadata/configuration/container/metadata-comparison.component.html +++ b/ui/src/app/metadata/configuration/container/metadata-comparison.component.html @@ -4,7 +4,7 @@

Provider Configuration

-
@@ -14,5 +14,9 @@

Version History

- + +
+
+ + Loading...
\ No newline at end of file diff --git a/ui/src/app/metadata/configuration/container/metadata-comparison.component.ts b/ui/src/app/metadata/configuration/container/metadata-comparison.component.ts index cec29c2a6..1b1834fa1 100644 --- a/ui/src/app/metadata/configuration/container/metadata-comparison.component.ts +++ b/ui/src/app/metadata/configuration/container/metadata-comparison.component.ts @@ -1,10 +1,10 @@ -import { Component, ChangeDetectionStrategy } from '@angular/core'; +import { Component, ChangeDetectionStrategy, OnDestroy } from '@angular/core'; import { Observable } from 'rxjs'; import { Store } from '@ngrx/store'; import { ActivatedRoute } from '@angular/router'; import { map } from 'rxjs/operators'; -import { ConfigurationState, getVersionConfigurations, getVersionConfigurationCount } from '../reducer'; -import { CompareVersionRequest } from '../action/compare.action'; +import { ConfigurationState, getComparisonConfigurations, getComparisonConfigurationCount } from '../reducer'; +import { CompareVersionRequest, ClearVersions } from '../action/compare.action'; import { MetadataConfiguration } from '../model/metadata-configuration'; import * as fromReducer from '../reducer'; @@ -14,11 +14,12 @@ import * as fromReducer from '../reducer'; templateUrl: './metadata-comparison.component.html', styleUrls: [] }) -export class MetadataComparisonComponent { +export class MetadataComparisonComponent implements OnDestroy { versions$: Observable; numVersions$: Observable; type$: Observable; + loading$: Observable = this.store.select(fromReducer.getComparisonLoading); constructor( private store: Store, @@ -26,11 +27,16 @@ export class MetadataComparisonComponent { ) { this.activatedRoute.queryParams.pipe( map(params => params.versions), + map(versions => Array.isArray(versions) ? versions : [versions]), map(versions => new CompareVersionRequest(versions)) ).subscribe(this.store); - this.versions$ = this.store.select(getVersionConfigurations); - this.numVersions$ = this.store.select(getVersionConfigurationCount); + this.versions$ = this.store.select(getComparisonConfigurations); + this.numVersions$ = this.store.select(getComparisonConfigurationCount); this.type$ = this.store.select(fromReducer.getConfigurationModelType); } + + ngOnDestroy(): void { + this.store.dispatch(new ClearVersions()); + } } diff --git a/ui/src/app/metadata/configuration/container/metadata-history.component.html b/ui/src/app/metadata/configuration/container/metadata-history.component.html index 5291b4907..23c2b4595 100644 --- a/ui/src/app/metadata/configuration/container/metadata-history.component.html +++ b/ui/src/app/metadata/configuration/container/metadata-history.component.html @@ -1,9 +1,13 @@

Version History

-
+
+
+ + Loading... +
\ No newline at end of file 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 7d817b94f..c2c1d0a1a 100644 --- a/ui/src/app/metadata/configuration/container/metadata-history.component.ts +++ b/ui/src/app/metadata/configuration/container/metadata-history.component.ts @@ -1,11 +1,17 @@ -import { Component, ChangeDetectionStrategy } from '@angular/core'; -import { Observable } from 'rxjs'; +import { Component, ChangeDetectionStrategy, OnDestroy } from '@angular/core'; +import { Observable, combineLatest, Subject } from 'rxjs'; import { Store } from '@ngrx/store'; -import { ConfigurationState, getVersionCollection } from '../reducer'; +import { + ConfigurationState, + getVersionCollection, + getConfigurationModelId, + getConfigurationModelKind, + getHistoryLoading +} from '../reducer'; import { MetadataVersion } from '../model/version'; -import { CompareVersionRequest } from '../action/compare.action'; import { Router, ActivatedRoute } from '@angular/router'; -import { map } from 'rxjs/operators'; +import { map, takeUntil } from 'rxjs/operators'; +import { LoadHistoryRequest, ClearHistory } from '../action/history.action'; @Component({ selector: 'metadata-history', @@ -13,15 +19,27 @@ import { map } from 'rxjs/operators'; templateUrl: './metadata-history.component.html', styleUrls: [] }) -export class MetadataHistoryComponent { +export class MetadataHistoryComponent implements OnDestroy { + + private ngUnsubscribe: Subject = new Subject(); history$: Observable; + loading$: Observable = this.store.select(getHistoryLoading); constructor( private store: Store, private router: Router, private route: ActivatedRoute ) { + combineLatest( + this.store.select(getConfigurationModelId), + this.store.select(getConfigurationModelKind) + ).pipe( + takeUntil(this.ngUnsubscribe), + map(([id, kind]) => ({ id, type: kind })), + map(request => new LoadHistoryRequest(request)) + ).subscribe(store); + this.history$ = this.store.select(getVersionCollection) .pipe(map(versions => this.sortVersionsByDate(versions))); } @@ -47,11 +65,16 @@ export class MetadataHistoryComponent { restoreVersion(version: MetadataVersion): void { this.router.navigate( - [ '../', 'restore' ], + [ '../', 'version', version.id, 'restore' ], { - queryParams: { version: version.id }, relativeTo: this.route } ); } + + ngOnDestroy() { + this.ngUnsubscribe.next(); + this.ngUnsubscribe.complete(); + this.store.dispatch(new ClearHistory()); + } } diff --git a/ui/src/app/metadata/configuration/container/metadata-options.component.html b/ui/src/app/metadata/configuration/container/metadata-options.component.html index ebed36bf3..390d6981c 100644 --- a/ui/src/app/metadata/configuration/container/metadata-options.component.html +++ b/ui/src/app/metadata/configuration/container/metadata-options.component.html @@ -6,9 +6,8 @@