From fc6f420b9687e9d40c56a9a28ebdd1ba65e3aa0f Mon Sep 17 00:00:00 2001 From: Sofie Hofmann <29145005+sofie29@users.noreply.github.com> Date: Tue, 8 Dec 2020 17:37:20 +0100 Subject: [PATCH] TSK-1474: Update classification details layout (#1358) Co-authored-by: Chi Nguyen --- .../classification-details.component.html | 308 +++++++++--------- .../classification-details.component.scss | 189 ++++++----- .../classification-details.component.spec.ts | 19 +- .../classification-details.component.ts | 3 +- .../classification-list.component.html | 8 +- .../classification-list.component.scss | 5 +- .../classification-overview.component.scss | 2 +- 7 files changed, 283 insertions(+), 251 deletions(-) diff --git a/web/src/app/administration/components/classification-details/classification-details.component.html b/web/src/app/administration/components/classification-details/classification-details.component.html index 327f8c6b4..c63a676c0 100644 --- a/web/src/app/administration/components/classification-details/classification-details.component.html +++ b/web/src/app/administration/components/classification-details/classification-details.component.html @@ -1,11 +1,11 @@
-
+
- -

{{classification.name}}  [{{classification.type}}] - {{badgeMessage$ | async}} + +

{{classification.name}}  [{{classification.type}}] + {{badgeMessage$ | async}}

@@ -16,7 +16,7 @@
-
+ -
+
-
+
-
General
- +
General
+ - - - Key - - - -
{{lengthError}}
- + +
- - - Name - - - -
{{lengthError}}
- + +
- - -
-
- - Service Level - - - -
{{lengthError}}
-
- -
- + - Priority - - + Key + + + +
{{lengthError}}
+ + + + + Name + + + +
{{lengthError}}
+ + + + + Description + + + +
{{lengthError}}
+
+ + + +
+ + + + +
+ + + + Domain + + - - + + + +
+ + +
+ + Service Level + + + +
{{lengthError}}
+
+ + +
+ + Priority + + + + + + +
+
+ + + + Application entry point + + + +
{{lengthError}}
+ + + + Category + + + + + {{this.classification.category}} + + + + {{category}} + + +
- -
- - - Domain - - - - - - - - Category - - - - - {{this.classification.category}} - - - - {{category}} - - - -
- - - Application entry point - - - -
{{lengthError}}
- - - Description - - - -
{{lengthError}}
+ -
Custom Fields
- +
Custom Fields
+ - -
-
- - {{customField.field}} - - - -
{{lengthError}}
+
+
+ + {{customField.field}} + + + +
{{lengthError}}
-
diff --git a/web/src/app/administration/components/classification-details/classification-details.component.scss b/web/src/app/administration/components/classification-details/classification-details.component.scss index bc2539733..8cf8c7590 100644 --- a/web/src/app/administration/components/classification-details/classification-details.component.scss +++ b/web/src/app/administration/components/classification-details/classification-details.component.scss @@ -5,16 +5,11 @@ overflow-y: auto; } -.classification-details__wrapper { +.classification-details-wrapper { position: relative; } -/* ACTION TOOLBAR */ -.classification-details__headline { - font-size: 1.5rem; - padding: 0.5rem; -} -.classification-details__action-toolbar { +.action-toolbar { padding: 8px 30px 12px 24px; height: 68px; background-color: #fff; @@ -23,93 +18,121 @@ justify-content: space-between; flex-wrap: wrap; z-index: 10; + + &__headline { + font-size: 1.5rem; + padding: 0.5rem; + } + + &__badge-message { + font-size: 13px; + background-color: $transparent-grey; + } + + &__button { + margin-top: 0.25rem; + margin-right: 6px; + background-color: #fff; + } + + &__dropdown { + border-color: $transparent-grey; + border-bottom-style: solid; + border-width: 1px; + } + + &__save-button { + background-color: $aquamarine; + color: white; + } + + &__aquamarine-button { + color: $aquamarine; + } + + &__red-button { + color: $invalid; + } } -.action-toolbar__button { - margin-top: 0.25rem; - margin-right: 6px; - background-color: #fff; -} - -.action-toolbar__dropdown { - border-color: $transparent-grey; - border-bottom-style: solid; - border-width: 1px; -} - -.action-toolbar__save-button { - background-color: $aquamarine; - color: white; -} - -.button__green-blue { - color: $aquamarine; -} - -.button__red { - color: $invalid; -} - -/* DETAILED FIELDS */ - -.classification__detailed-fields { +.detailed-fields { padding: 15px; display: flex; flex-direction: column; -} -.classification-details__subheading { - font-weight: bold; - padding-left: 15px; - margin-bottom: 0; -} + &__subheading { + font-weight: bold; + padding-left: 15px; + margin-bottom: 0; + } -.classification-details__horizontal-line { - margin: 5px 5px 25px 5px; - border-top-color: #555; - border-top-width: 1.35px; -} + &__horizontal-line { + margin: 5px 5px 25px 5px; + border-top-color: #555; + border-top-width: 1.35px; + } -.classification-details__domain-and-category { - position: relative; - display: flex; - justify-content: space-between; - padding-bottom: 16px; -} + &__general { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: space-between; + } -.domain-and-category__domain-checkbox { - position: absolute; - top: 64px; - left: 12px; - font-size: 14px; - color: #555; -} -.domain-and-category__domain-checkbox-icon { - cursor: pointer; - margin-top: 2px; - font-size: 20px; -} -.domain-and-category__category-icon { - fill: #555; - margin-right: 5px; - top: -2px; -} + &__general-right-column { + display: flex; + flex-direction: column; + width: 30%; + } -.classification-details__service-and-priority { - display: flex; - width: 100%; -} -.classification-details__service { - width: 100%; - margin-right: 10px; -} -.classification-details__priority { - flex-grow: 1; -} + &__spacer { + display: block; + width: 20px; + } -.classification-details__mat-form-field { - width: 100%; - margin-right: 10px; + &__general-left-column { + display: flex; + flex-direction: column; + flex-wrap: wrap; + width: 70%; + } + + &__domain-checkbox { + position: absolute; + top: 172px; + right: 12px; + font-size: 12px; + color: #555; + } + + &__domain-checkbox-icon { + cursor: pointer; + margin-top: 2px; + font-size: 18px; + } + + &__service-and-priority { + display: flex; + justify-content: space-between; + width: 100%; + } + + &__category-icon { + fill: #555; + margin-right: 5px; + top: -2px; + } + + &__custom-fields { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-between; + } + + &__input-custom-field { + flex: 0 49%; + } } input:invalid.dirty { diff --git a/web/src/app/administration/components/classification-details/classification-details.component.spec.ts b/web/src/app/administration/components/classification-details/classification-details.component.spec.ts index a49807b83..38a05df20 100644 --- a/web/src/app/administration/components/classification-details/classification-details.component.spec.ts +++ b/web/src/app/administration/components/classification-details/classification-details.component.spec.ts @@ -248,21 +248,21 @@ describe('ClassificationDetailsComponent', () => { component.requestInProgress = true; component.classification = {}; fixture.detectChanges(); - expect(debugElement.nativeElement.querySelector('.classification-details__action-toolbar')).toBeFalsy(); - expect(debugElement.nativeElement.querySelector('.classification__detailed-fields')).toBeFalsy(); + expect(debugElement.nativeElement.querySelector('.action-toolbar')).toBeFalsy(); + expect(debugElement.nativeElement.querySelector('.detailed-fields')).toBeFalsy(); }); it('should not show details when classification does not exist', () => { component.requestInProgress = false; component.classification = null; fixture.detectChanges(); - expect(debugElement.nativeElement.querySelector('.classification-details__action-toolbar')).toBeFalsy(); - expect(debugElement.nativeElement.querySelector('.classification__detailed-fields')).toBeFalsy(); + expect(debugElement.nativeElement.querySelector('.action-toolbar')).toBeFalsy(); + expect(debugElement.nativeElement.querySelector('.detailed-fields')).toBeFalsy(); }); it('should show details when classification exists and spinner is not running', () => { - expect(debugElement.nativeElement.querySelector('.classification-details__action-toolbar')).toBeTruthy(); - expect(debugElement.nativeElement.querySelector('.classification__detailed-fields')).toBeTruthy(); + expect(debugElement.nativeElement.querySelector('.action-toolbar')).toBeTruthy(); + expect(debugElement.nativeElement.querySelector('.detailed-fields')).toBeTruthy(); }); /* HTML: TITLE + ACTION BUTTONS */ @@ -270,7 +270,7 @@ describe('ClassificationDetailsComponent', () => { component.classification = { name: 'Recommendation', type: 'DOCUMENT' }; component.isCreatingNewClassification = true; fixture.detectChanges(); - const headline = debugElement.nativeElement.querySelector('.classification-details__headline'); + const headline = debugElement.nativeElement.querySelector('.action-toolbar__headline'); expect(headline).toBeTruthy(); expect(headline.textContent).toContain('Recommendation'); expect(headline.textContent).toContain('DOCUMENT'); @@ -290,8 +290,7 @@ describe('ClassificationDetailsComponent', () => { }); it('should restore selected classification when button is clicked', async () => { - const button = debugElement.nativeElement.querySelector('.classification-details__action-toolbar').children[1] - .children[1]; + const button = debugElement.nativeElement.querySelector('.action-toolbar').children[1].children[1]; expect(button).toBeTruthy(); expect(button.textContent).toContain('Undo Changes'); expect(button.textContent).toContain('restore'); @@ -391,7 +390,7 @@ describe('ClassificationDetailsComponent', () => { }); it('should change isValidInDomain when button is clicked', () => { - const button = debugElement.nativeElement.querySelector('.domain-and-category__domain-checkbox-icon').parentNode; + const button = debugElement.nativeElement.querySelector('.detailed-fields__domain-checkbox-icon').parentNode; expect(button).toBeTruthy(); component.classification.isValidInDomain = false; button.click(); diff --git a/web/src/app/administration/components/classification-details/classification-details.component.ts b/web/src/app/administration/components/classification-details/classification-details.component.ts index 4298aa808..c586b0604 100644 --- a/web/src/app/administration/components/classification-details/classification-details.component.ts +++ b/web/src/app/administration/components/classification-details/classification-details.component.ts @@ -69,7 +69,8 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy { ngOnInit() { this.customFields$ = this.store.select(EngineConfigurationSelectors.classificationsCustomisation).pipe( map((customisation) => customisation.information), - getCustomFields(customFieldCount) + getCustomFields(customFieldCount), + map((customisationFields) => customisationFields.filter((customisation) => customisation.visible)) ); this.selectedClassification$.pipe(takeUntil(this.destroy$)).subscribe((classification) => { diff --git a/web/src/app/administration/components/classification-list/classification-list.component.html b/web/src/app/administration/components/classification-list/classification-list.component.html index a31da5050..36bd044d3 100644 --- a/web/src/app/administration/components/classification-list/classification-list.component.html +++ b/web/src/app/administration/components/classification-list/classification-list.component.html @@ -23,8 +23,8 @@
- diff --git a/web/src/app/administration/components/classification-list/classification-list.component.scss b/web/src/app/administration/components/classification-list/classification-list.component.scss index adc6f09a0..6e700724d 100644 --- a/web/src/app/administration/components/classification-list/classification-list.component.scss +++ b/web/src/app/administration/components/classification-list/classification-list.component.scss @@ -32,6 +32,7 @@ .category-filter__icons { height: 33px; width: 16px; + fill: #555; } .category-filter__categories { fill: #555; @@ -39,10 +40,6 @@ top: -2px; } -.category-filter__filter-button { - color: #555; -} - .filter__input { width: 100%; margin-right: 12px; diff --git a/web/src/app/administration/components/classification-overview/classification-overview.component.scss b/web/src/app/administration/components/classification-overview/classification-overview.component.scss index 3c918e630..0fe00eeb8 100644 --- a/web/src/app/administration/components/classification-overview/classification-overview.component.scss +++ b/web/src/app/administration/components/classification-overview/classification-overview.component.scss @@ -6,7 +6,7 @@ align-items: stretch; } taskana-administration-classification-list { - width: 500px; + min-width: 500px; } taskana-administration-classification-details { flex-grow: 1;