From f36f573954f41723b1ae3393e64efd25aa3e9148 Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Tue, 10 Sep 2019 08:23:28 -0700 Subject: [PATCH] SHIBUI-1407 Implemented differences highlighting --- .../metadata-configuration.component.scss | 1 + .../property/array-property.component.html | 94 ++++++++++--------- .../property/array-property.component.ts | 7 ++ 3 files changed, 56 insertions(+), 46 deletions(-) diff --git a/ui/src/app/metadata/configuration/component/metadata-configuration.component.scss b/ui/src/app/metadata/configuration/component/metadata-configuration.component.scss index 24b159af0..82e7a5f37 100644 --- a/ui/src/app/metadata/configuration/component/metadata-configuration.component.scss +++ b/ui/src/app/metadata/configuration/component/metadata-configuration.component.scss @@ -4,6 +4,7 @@ .bg-diff { background: #FEE8E9; position: relative; + border-color: #CCC !important; &::before { $size: 24px; content: "\f06a"; diff --git a/ui/src/app/metadata/configuration/component/property/array-property.component.html b/ui/src/app/metadata/configuration/component/property/array-property.component.html index 1a1fe28d1..28777731d 100644 --- a/ui/src/app/metadata/configuration/component/property/array-property.component.html +++ b/ui/src/app/metadata/configuration/component/property/array-property.component.html @@ -1,57 +1,59 @@ -
- -
{{ property.name }}
-
-
-
- {{ property.items.properties[prop].title }} -
- -
- {{ version[i][prop] }} -
-
- - -
-
+
+
{{ property.name }}
+
+
+
+ {{ property.items.properties[prop].title }}
+ +
+ {{ version[i][prop] }} +
+
+ - +
+
+
+
+ + + - - - - - + + + + +
- - -
- -
-
-
- {{ attr.label }} -
- - true - - - false - -
+
+
+
+ {{ attr.label }} +
+ + true + + + false +
- +
-
+
-
+
{{ property.name }}

-

diff --git a/ui/src/app/metadata/configuration/component/property/array-property.component.ts b/ui/src/app/metadata/configuration/component/property/array-property.component.ts index 2c4de49bd..f166aa155 100644 --- a/ui/src/app/metadata/configuration/component/property/array-property.component.ts +++ b/ui/src/app/metadata/configuration/component/property/array-property.component.ts @@ -33,6 +33,13 @@ export class ArrayPropertyComponent extends ConfigurationPropertyComponent imple return UriValidator.isUri(str); } + isDifferent(key: string): boolean { + const model = this.property.value || []; + return model + .map((value) => value ? value.indexOf(key) > -1 : false) + .reduce((current, val) => current !== val ? true : false, false); + } + get attributeList$(): Observable<{ key: string, label: string }[]> { if (this.property.widget && this.property.widget.hasOwnProperty('data')) { return of(this.property.widget.data);