Skip to content

Commit

Permalink
Merge branch 'master' into feature/SHIBUI-1361-QA
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Smith committed Aug 15, 2019
2 parents c4370aa + a102134 commit b8409b0
Show file tree
Hide file tree
Showing 34 changed files with 410 additions and 105 deletions.
28 changes: 19 additions & 9 deletions backend/src/integration/resources/SHIBUI-1335-1.side
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
],
"value": ""
}, {
"id": "7d9109bb-f3b5-4d74-864e-5c647e90c9e4",
"id": "352f066f-c2af-4735-81b1-5440ba7a3432",
"comment": "",
"command": "waitForElementVisible",
"target": "id=/xmlId",
Expand Down Expand Up @@ -1359,14 +1359,10 @@
}, {
"id": "c28d683a-552d-4752-aa89-465e33d60887",
"comment": "",
"command": "waitForElementVisible",
"target": "css=tr:nth-child(2) > .td-lg:nth-child(4)",
"targets": [
["css=tr:nth-child(2) > .td-lg:nth-child(4)", "css:finder"],
["xpath=//tr[2]/td[4]", "xpath:position"],
["xpath=//td[contains(.,'NameIDFormat')]", "xpath:innerText"]
],
"value": "10000"
"command": "pause",
"target": "2000",
"targets": [],
"value": ""
}, {
"id": "100902ee-6d6e-4148-a69b-b37746a4ad6e",
"comment": "",
Expand All @@ -1388,6 +1384,13 @@
["xpath=//button[2]/i", "xpath:position"]
],
"value": ""
}, {
"id": "febfcea8-8f72-4a17-b1a8-b1e323c8cced",
"comment": "",
"command": "pause",
"target": "2000",
"targets": [],
"value": ""
}, {
"id": "c9d498da-9f59-40ae-b5d4-cae397a13766",
"comment": "",
Expand All @@ -1409,6 +1412,13 @@
["xpath=//button[2]/i", "xpath:position"]
],
"value": ""
}, {
"id": "4fdc2334-0b93-4f4c-b44e-80656f808f6d",
"comment": "",
"command": "pause",
"target": "2000",
"targets": [],
"value": ""
}, {
"id": "441608df-24a3-4a60-bfce-50a90ff0ee16",
"comment": "",
Expand Down
13 changes: 10 additions & 3 deletions backend/src/integration/resources/SHIBUI-1335-2.side
Original file line number Diff line number Diff line change
Expand Up @@ -691,10 +691,10 @@
}, {
"id": "eca1d3dd-9e47-49d2-b4a1-a45c2b6c8c3a",
"comment": "",
"command": "waitForElementVisible",
"target": "css=tr:nth-child(1) > .td-lg:nth-child(4)",
"command": "pause",
"target": "2000",
"targets": [],
"value": "10000"
"value": ""
}, {
"id": "d722902b-5c10-45dc-99df-d96f46e78313",
"comment": "",
Expand All @@ -716,6 +716,13 @@
["xpath=//button[2]/i", "xpath:position"]
],
"value": ""
}, {
"id": "d25400e1-127e-4b8c-b7e2-ade937cfd5a0",
"comment": "",
"command": "pause",
"target": "2000",
"targets": [],
"value": ""
}, {
"id": "d7909094-96ce-4532-98b4-446cc013c9c8",
"comment": "",
Expand Down
13 changes: 10 additions & 3 deletions backend/src/integration/resources/SHIBUI-1335-3.side
Original file line number Diff line number Diff line change
Expand Up @@ -785,10 +785,10 @@
}, {
"id": "455e24c1-5093-4da3-a62d-457bbf0cd5db",
"comment": "",
"command": "waitForElementVisible",
"target": "css=tr:nth-child(2) > .td-lg:nth-child(4)",
"command": "pause",
"target": "2000",
"targets": [],
"value": "10000"
"value": ""
}, {
"id": "9f7e95cf-4dd5-415f-8577-a6f1bc54a85d",
"comment": "",
Expand All @@ -810,6 +810,13 @@
["xpath=//td[contains(.,'NameIDFormat')]", "xpath:innerText"]
],
"value": "NameIDFormat"
}, {
"id": "81970d9d-2892-4b42-ba56-ba1a14f453d2",
"comment": "",
"command": "pause",
"target": "2000",
"targets": [],
"value": ""
}, {
"id": "63ac7307-0538-4c0d-8e98-2f05c767baaf",
"comment": "",
Expand Down
22 changes: 18 additions & 4 deletions backend/src/integration/resources/SHIBUI-1335-4.side
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@
"id": "77dfeb05-38e3-4ef8-9566-06e7597d464c",
"comment": "",
"command": "click",
"target": "css=.btn-primary > translate-i18n",
"target": "css=.btn-primary",
"targets": [
["css=.btn-primary > translate-i18n", "css:finder"],
["xpath=//div/button/translate-i18n", "xpath:position"],
Expand All @@ -924,10 +924,10 @@
}, {
"id": "f79371b5-0081-45a0-bfb3-c403db903043",
"comment": "",
"command": "waitForElementVisible",
"target": "css=tr:nth-child(1) > .td-lg:nth-child(4)",
"command": "pause",
"target": "2000",
"targets": [],
"value": "10000"
"value": ""
}, {
"id": "a8ed628c-53f7-4551-9ce8-fef976cc96ce",
"comment": "",
Expand All @@ -938,6 +938,13 @@
["xpath=//button[2]/i", "xpath:position"]
],
"value": ""
}, {
"id": "6b3ec8f1-8b9a-40f5-816f-3a1e415b9d8d",
"comment": "",
"command": "pause",
"target": "2000",
"targets": [],
"value": ""
}, {
"id": "be805934-2692-4a1c-a28f-afb3cc4eb5f4",
"comment": "",
Expand All @@ -959,6 +966,13 @@
["xpath=//button[2]/i", "xpath:position"]
],
"value": ""
}, {
"id": "403570ff-e1f0-4db9-925f-f90c5994b60e",
"comment": "",
"command": "pause",
"target": "2000",
"targets": [],
"value": ""
}, {
"id": "8f2da627-e8ad-473a-a71a-bec5dd1f0999",
"comment": "",
Expand Down
33 changes: 22 additions & 11 deletions backend/src/integration/resources/SHIBUI-1392.side
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,13 @@
["xpath=//a[contains(.,'Script')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "786cd3cb-46b2-4361-b449-8f679ff97135",
"comment": "",
"command": "waitForElementPresent",
"target": "id=/nameIdFormatFilterTarget.target",
"targets": [],
"value": "10000"
}, {
"id": "dcf31546-0976-44ae-9ffc-c29a5255d646",
"comment": "",
Expand All @@ -366,23 +373,27 @@
"comment": "",
"command": "editContent",
"target": "id=/nameIdFormatFilterTarget.target",
"targets": [
["id=/nameIdFormatFilterTarget.target", "id"],
["css=#\\/nameIdFormatFilterTarget\\.target", "css:finder"],
["xpath=//p[@id='/nameIdFormatFilterTarget.target']", "xpath:attributes"],
["xpath=//p", "xpath:position"],
["xpath=//p[contains(.,'eval(true)')]", "xpath:innerText"]
],
"targets": [],
"value": "eval(true)"
}, {
"id": "05870356-d3db-4540-bb3f-db34b1cf65f1",
"comment": "",
"command": "sendKeys",
"target": "id=/nameIdFormatFilterTarget.target",
"targets": [],
"value": ";"
"value": "${KEY_END};"
}, {
"id": "b544a0b1-fc04-4dc3-8a11-5769500e5503",
"id": "d7721254-68c9-4140-af2a-1757cce99da7",
"comment": "",
"command": "click",
"target": "css=.section-body",
"targets": [
["css=.section-body", "css:finder"],
["xpath=//section/div[2]", "xpath:position"]
],
"value": ""
}, {
"id": "ed6eb266-04f0-4517-b874-ea1d0ba68441",
"comment": "",
"command": "click",
"target": "css=#\\/filterEnabled\\.parent > .custom-control-label",
Expand Down Expand Up @@ -436,7 +447,7 @@
}, {
"id": "ad613704-0718-4b83-97f1-b49897f510eb",
"comment": "",
"command": "waitForElementEditable",
"command": "waitForElementVisible",
"target": "id=/nameIdFormatFilterTarget.target",
"targets": [],
"value": "10000"
Expand All @@ -452,7 +463,7 @@
["xpath=//p", "xpath:position"],
["xpath=//p[contains(.,'eval(true)')]", "xpath:innerText"]
],
"value": "eval(true)"
"value": "eval(true);"
}]
}],
"suites": [{
Expand Down
11 changes: 9 additions & 2 deletions ui/src/app/metadata/configuration/action/configuration.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ export enum ConfigurationActionTypes {
LOAD_XML_SUCCESS = '[Metadata Configuration] Load XML Success',
LOAD_XML_ERROR = '[Metadata Configuration] Load XML Error',

SET_METADATA = '[Metadata Configuration] Set Metadata Model',
SET_METADATA = '[Metadata Configuration] Set Metadata Attributes',
SET_DEFINITION = '[Metadata Configuration] Set Metadata Definition',
SET_SCHEMA = '[Metadata Configuration] Set Metadata Schema',
SET_XML = '[Metadata Configuration] Set Metadata Xml',
SET_METADATA_MODEL = '[Metadata Configuration] Set Metadata Model',

DOWNLOAD_XML = '[Metadata Configuration] Download Metadata Xml',

Expand Down Expand Up @@ -61,7 +62,13 @@ export class LoadXmlError implements Action {
export class SetMetadata implements Action {
readonly type = ConfigurationActionTypes.SET_METADATA;

constructor(public payload: { id: string, type: string }) { }
constructor(public payload: { id: string, type: string, version?: string }) { }
}

export class SetMetadataModel implements Action {
readonly type = ConfigurationActionTypes.SET_METADATA_MODEL;

constructor(public payload: Metadata) { }
}

export class SetDefinition implements Action {
Expand Down
36 changes: 36 additions & 0 deletions ui/src/app/metadata/configuration/action/restore.action.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { Action } from '@ngrx/store';
import { Metadata } from '../../domain/domain.type';

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',
CLEAR_VERSION = '[Restore Version] Clear Versions'
}

export class SelectVersionRestoreRequest implements Action {
readonly type = RestoreActionTypes.SELECT_VERSION_REQUEST;

constructor(public payload: { type: string, id: string, version: string }) { }
}

export class SelectVersionRestoreSuccess implements Action {
readonly type = RestoreActionTypes.SELECT_VERSION_SUCCESS;

constructor(public payload: Metadata) { }
}
export class SelectVersionRestoreError implements Action {
readonly type = RestoreActionTypes.SELECT_VERSION_ERROR;

constructor(public payload: any) { }
}

export class ClearVersionRestore implements Action {
readonly type = RestoreActionTypes.CLEAR_VERSION;
}

export type RestoreActionsUnion =
| SelectVersionRestoreRequest
| SelectVersionRestoreError
| SelectVersionRestoreSuccess
| ClearVersionRestore;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<th scope="col">
<span class="sr-only" translate="label.select-version">Select Version</span>
</th>
<th scope="col" translate="label.version">Version</th>
<th scope="col" translate="label.save-date">Save Date</th>
<th scope="col" translate="label.changed-by">Changed By</th>
<th scope="col" translate="label.actions">Actions</th>
Expand All @@ -21,12 +20,19 @@
</label>
</div>
</td>
<td *ngIf="i === 0"><translate-i18n key="label.current">Current</translate-i18n> (v{{ history.length - i }})</td>
<td *ngIf="i > 0">v{{ history.length - (i) }}</td>
<td>{{ version.date | date:DATE_FORMAT }}</td>
<td>
<a [routerLink]="['../', 'options']" [queryParams]="{'version': version.id}">
<ng-container>
{{ version.date | date:DATE_FORMAT }}&nbsp;
<ng-container *ngIf="i === 0">
(<translate-i18n key="label.current">Current</translate-i18n>)
</ng-container>
</ng-container>
</a>
</td>
<td>{{ version.creator }}</td>
<td>
<button class="btn btn-link" (click)="restore.emit(version)">
<button class="btn btn-text btn-link" (click)="restore.emit(version)" *ngIf="i > 0">
<i class="fa fa-undo"></i>&nbsp;
<translate-i18n key="label.restore">Restore</translate-i18n>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { MockI18nModule } from '../../../../testing/i18n.stub';
import { HistoryListComponent } from './history-list.component';
import { MetadataHistory } from '../model/history';
import { MetadataVersion } from '../model/version';
import { RouterTestingModule } from '@angular/router/testing';

export const TestData = {
versions: [
Expand Down Expand Up @@ -37,7 +38,8 @@ describe('Metadata History List Component', () => {
TestBed.configureTestingModule({
providers: [],
imports: [
MockI18nModule
MockI18nModule,
RouterTestingModule
],
declarations: [
HistoryListComponent,
Expand Down
8 changes: 6 additions & 2 deletions ui/src/app/metadata/configuration/configuration.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import { FilterConfigurationListComponent } from './component/filter-configurati
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';

@NgModule({
declarations: [
Expand All @@ -47,7 +49,8 @@ import { FilterTargetPropertyComponent } from './component/filter-target-propert
MetadataComparisonComponent,
FilterConfigurationListComponent,
FilterConfigurationListItemComponent,
FilterTargetPropertyComponent
FilterTargetPropertyComponent,
RestoreComponent
],
entryComponents: [],
imports: [
Expand Down Expand Up @@ -82,7 +85,8 @@ export class MetadataConfigurationModule {
[
MetadataConfigurationEffects,
MetadataHistoryEffects,
CompareVersionEffects
CompareVersionEffects,
RestoreVersionEffects
])
],
providers: []
Expand Down
5 changes: 5 additions & 0 deletions ui/src/app/metadata/configuration/configuration.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { MetadataOptionsComponent } from './container/metadata-options.component
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';

export const ConfigurationRoutes: Routes = [
{
Expand All @@ -29,6 +30,10 @@ export const ConfigurationRoutes: Routes = [
{
path: 'compare',
component: MetadataComparisonComponent
},
{
path: 'restore',
component: RestoreComponent
}
]
}
Expand Down
Loading

0 comments on commit b8409b0

Please sign in to comment.