-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in feature/SHIBUI-1270 (pull request #340)
SHIBUI-1270 Implemented metadata comparison component
- Loading branch information
Showing
45 changed files
with
635 additions
and
142 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
ui/src/app/metadata/configuration/action/compare.action.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { Action } from '@ngrx/store'; | ||
import { MetadataHistory } from '../model/history'; | ||
import { MetadataVersion } from '../model/version'; | ||
import { Metadata } from '../../domain/domain.type'; | ||
|
||
export enum CompareActionTypes { | ||
COMPARE_METADATA_REQUEST = '[Compare Version] Compare Version Request', | ||
COMPARE_METADATA_SUCCESS = '[Compare Version] Compare Version Success', | ||
COMPARE_METADATA_ERROR = '[Compare Version] Compare Version Error', | ||
SET_VERSIONS = '[Compare Version] Set Versions', | ||
CLEAR_VERSIONS = '[Compare Version] Clear Versions' | ||
} | ||
|
||
export class CompareVersionRequest implements Action { | ||
readonly type = CompareActionTypes.COMPARE_METADATA_REQUEST; | ||
|
||
constructor(public payload: string[]) { } | ||
} | ||
|
||
export class CompareVersionSuccess implements Action { | ||
readonly type = CompareActionTypes.COMPARE_METADATA_SUCCESS; | ||
|
||
constructor(public payload: Metadata[]) { } | ||
} | ||
|
||
export class CompareVersionError implements Action { | ||
readonly type = CompareActionTypes.COMPARE_METADATA_ERROR; | ||
|
||
constructor(public payload: any) { } | ||
} | ||
|
||
export class SetMetadataVersions implements Action { | ||
readonly type = CompareActionTypes.SET_VERSIONS; | ||
|
||
constructor(public payload: Metadata[]) { } | ||
} | ||
|
||
export class ClearVersions implements Action { | ||
readonly type = CompareActionTypes.CLEAR_VERSIONS; | ||
} | ||
|
||
export type CompareActionsUnion = | ||
| CompareVersionRequest | ||
| CompareVersionSuccess | ||
| CompareVersionError | ||
| SetMetadataVersions | ||
| ClearVersions; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 17 additions & 7 deletions
24
ui/src/app/metadata/configuration/component/metadata-configuration.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,33 @@ | ||
<div *ngIf="configuration"> | ||
<section *ngFor="let section of configuration.sections; let i = index;"> | ||
<section *ngFor="let section of configuration.sections; let i = index;" class="mb-4"> | ||
<div class="config-group"> | ||
<div class="numbered-header d-flex justify-content-start bg-light align-items-center"> | ||
<h2 class="title h4 m-0 flex-grow-1"> | ||
<span class="d-inline-block px-2 py-1 mr-2 mb-0 h4 number border border-secondary bg-white rounded-lg"><span *ngIf="i + 1 < 10">0</span>{{ i + 1 }}</span> | ||
<span class="d-inline-block px-2 py-1 mr-2 mb-0 h4 number border border-secondary bg-white rounded-lg"> | ||
<span *ngIf="i + 1 < 10">0</span>{{ i + 1 }} | ||
</span> | ||
<span class="text">{{ section.label | translate }}</span> | ||
</h2> | ||
<div class="actions px-2"> | ||
<div class="actions px-2" *ngIf="configuration.dates.length === 1"> | ||
<button class="btn btn-link edit-link change-view" (click)="edit(section.id)"> | ||
<i class="fa fa-edit"></i> | ||
<span translate="action.edit">Edit</span> | ||
</button> | ||
</div> | ||
</div> | ||
<div class="d-flex border-bottom border-light border-2 p-2"> | ||
<strong class="w-50" translate="label.option">Option</strong> | ||
<strong class="w-50" translate="label.value">Value</strong> | ||
<strong [ngStyle]="{'width': width}" translate="label.option">Option</strong> | ||
<strong *ngFor="let date of configuration.dates" [ngStyle]="{'width': width}"> | ||
<translate-i18n key="label.value" *ngIf="configuration.dates.length <= 1">Value</translate-i18n> | ||
<span *ngIf="configuration.dates.length > 1">{{ date | date:'medium' }}</span> | ||
</strong> | ||
</div> | ||
<object-property class="d-block" *ngIf="section" [property]="section"></object-property> | ||
<object-property | ||
class="d-block" | ||
*ngIf="section" | ||
[property]="section" | ||
[columns]="configuration.dates.length"> | ||
</object-property> | ||
</div> | ||
</section> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
ui/src/app/metadata/configuration/component/object-property.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<ng-container *ngFor="let prop of property.properties"> | ||
<ng-container [ngSwitch]="prop.type"> | ||
<primitive-property *ngSwitchDefault [property]="prop"></primitive-property> | ||
<array-property *ngSwitchCase="'array'" [property]="prop"></array-property> | ||
<object-property *ngSwitchCase="'object'" [property]="prop"></object-property> | ||
<primitive-property *ngSwitchDefault [property]="prop" [columns]="columns"></primitive-property> | ||
<array-property *ngSwitchCase="'array'" [property]="prop" [columns]="columns"></array-property> | ||
<object-property *ngSwitchCase="'object'" [property]="prop" [columns]="columns"></object-property> | ||
</ng-container> | ||
</ng-container> |
11 changes: 8 additions & 3 deletions
11
ui/src/app/metadata/configuration/component/primitive-property.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
<div *ngIf="property.name" class="d-flex border-bottom border-light p-2"> | ||
<span class="w-50 d-block" role="term" [translate]="property.name">{{ property.name }}</span> | ||
<span class="w-50 d-block" | ||
role="definition">{{ property.value || property.value === false ? property.value : '-' }}</span> | ||
<span class="d-block" | ||
role="term" | ||
[translate]="property.name" | ||
[ngStyle]="{'width': width}">{{ property.name }}</span> | ||
<span *ngFor="let v of property.value" | ||
class="d-block" | ||
role="definition" | ||
[ngStyle]="{'width': width}">{{ v ? v : (v === false) ? v : '-' }}</span> | ||
</div> |
Oops, something went wrong.