From 310bd4b0ce713373bf9d368fbefec7a6ce5490a9 Mon Sep 17 00:00:00 2001 From: "swapnil.verma" Date: Mon, 20 Nov 2023 13:36:49 +0530 Subject: [PATCH 1/6] [ACS-6211] Fixed UI alignment issues create rule dialog (changes in card-view and child components) --- .../card-view-boolitem/card-view-boolitem.component.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/core/src/lib/card-view/components/card-view-boolitem/card-view-boolitem.component.ts b/lib/core/src/lib/card-view/components/card-view-boolitem/card-view-boolitem.component.ts index d5337fd39b3..8d36313b570 100644 --- a/lib/core/src/lib/card-view/components/card-view-boolitem/card-view-boolitem.component.ts +++ b/lib/core/src/lib/card-view/components/card-view-boolitem/card-view-boolitem.component.ts @@ -22,7 +22,14 @@ import { BaseCardView } from '../base-card-view'; @Component({ selector: 'adf-card-view-boolitem', - templateUrl: './card-view-boolitem.component.html' + templateUrl: './card-view-boolitem.component.html', + styles: [ + ` + .adf-property-value { + padding: 15px 0; + } + ` + ] }) export class CardViewBoolItemComponent extends BaseCardView { From 5217049f629e57258ff31f52fe5d78408c2ee9cb Mon Sep 17 00:00:00 2001 From: "swapnil.verma" Date: Mon, 20 Nov 2023 14:07:51 +0530 Subject: [PATCH 2/6] [ACS-6211] Removed unneeded test case --- .../card-view-selectitem.component.spec.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.spec.ts b/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.spec.ts index 32ed33a2a80..551cff02d19 100644 --- a/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.spec.ts +++ b/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.spec.ts @@ -73,14 +73,6 @@ describe('CardViewSelectItemComponent', () => { }); describe('Rendering', () => { - it('should render the label', () => { - fixture.detectChanges(); - - const labelValue = fixture.debugElement.query(By.css('.adf-property-label')); - expect(labelValue).not.toBeNull(); - expect(labelValue.nativeElement.innerText).toBe('Select box label'); - }); - it('should render readOnly value is editable property is FALSE', () => { component.property = new CardViewSelectItemModel({ ...mockDefaultProps, From bedfbf1bf11ad531958e0791d1f566735a390b9d Mon Sep 17 00:00:00 2001 From: "swapnil.verma" Date: Fri, 24 Nov 2023 12:05:03 +0530 Subject: [PATCH 3/6] [ACS-6211] Addressed code review findings. Added label div for when card-view-selectitem.component is in non-editable mode. Added corresponding tests --- .../card-view-selectitem.component.spec.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.spec.ts b/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.spec.ts index 551cff02d19..13ac16272f4 100644 --- a/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.spec.ts +++ b/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.spec.ts @@ -26,6 +26,7 @@ import { AppConfigService } from '../../../app-config/app-config.service'; import { HarnessLoader } from '@angular/cdk/testing'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { MatSelectHarness } from '@angular/material/select/testing'; +import { MatLabel } from '@angular/material/form-field'; describe('CardViewSelectItemComponent', () => { let loader: HarnessLoader; @@ -73,6 +74,25 @@ describe('CardViewSelectItemComponent', () => { }); describe('Rendering', () => { + it('should render custom label when editable is set to false', () => { + component.property = new CardViewSelectItemModel({ + ...mockDefaultProps, + editable: false + }); + fixture.detectChanges(); + const labelValue = fixture.debugElement.query(By.css('.adf-property-label')); + expect(labelValue).not.toBeNull(); + expect(labelValue.nativeElement.innerText).toBe('Select box label'); + }); + + it('should render mat label when editable is set to true', () => { + component.editable = true; + fixture.detectChanges(); + const labelValue = fixture.debugElement.query(By.directive(MatLabel)); + expect(labelValue).not.toBeNull(); + expect(labelValue.nativeElement.innerText).toBe('Select box label'); + }); + it('should render readOnly value is editable property is FALSE', () => { component.property = new CardViewSelectItemModel({ ...mockDefaultProps, From 48bd7a8c0a58586cddf264b1a1d3545a8822068d Mon Sep 17 00:00:00 2001 From: "swapnil.verma" Date: Thu, 28 Dec 2023 14:50:37 +0530 Subject: [PATCH 4/6] [ACS-6211] Fixed alignment issue for card-view-selectitem.component --- .../lib/card-view/components/card-view/card-view.component.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/src/lib/card-view/components/card-view/card-view.component.scss b/lib/core/src/lib/card-view/components/card-view/card-view.component.scss index fa1a330d324..482b1d9aa75 100644 --- a/lib/core/src/lib/card-view/components/card-view/card-view.component.scss +++ b/lib/core/src/lib/card-view/components/card-view/card-view.component.scss @@ -7,7 +7,7 @@ .adf-property-label { color: var(--adf-metadata-property-panel-text-color); display: flex; - padding: 6px 0; + padding: 3px 0; line-height: 20px; &.adf-property-value-editable { From 6d349a42bdf36276eab3abc285ed9f19e6c5f1da Mon Sep 17 00:00:00 2001 From: "swapnil.verma" Date: Fri, 29 Dec 2023 12:23:54 +0530 Subject: [PATCH 5/6] [ACS-6211] Removed unneeded testcase --- .../card-view-selectitem.component.spec.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.spec.ts b/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.spec.ts index 13ac16272f4..9421959f39b 100644 --- a/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.spec.ts +++ b/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.spec.ts @@ -26,7 +26,6 @@ import { AppConfigService } from '../../../app-config/app-config.service'; import { HarnessLoader } from '@angular/cdk/testing'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { MatSelectHarness } from '@angular/material/select/testing'; -import { MatLabel } from '@angular/material/form-field'; describe('CardViewSelectItemComponent', () => { let loader: HarnessLoader; @@ -85,14 +84,6 @@ describe('CardViewSelectItemComponent', () => { expect(labelValue.nativeElement.innerText).toBe('Select box label'); }); - it('should render mat label when editable is set to true', () => { - component.editable = true; - fixture.detectChanges(); - const labelValue = fixture.debugElement.query(By.directive(MatLabel)); - expect(labelValue).not.toBeNull(); - expect(labelValue.nativeElement.innerText).toBe('Select box label'); - }); - it('should render readOnly value is editable property is FALSE', () => { component.property = new CardViewSelectItemModel({ ...mockDefaultProps, From eaf4b512551fdcce13aad282dac9160c5b36db46 Mon Sep 17 00:00:00 2001 From: "swapnil.verma" Date: Fri, 29 Dec 2023 16:03:53 +0530 Subject: [PATCH 6/6] [ACS-6211] Resolved ui alignment issue with card-view-text-item.component --- .../components/card-view/card-view.component.html | 2 +- .../components/card-view/card-view.component.scss | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/core/src/lib/card-view/components/card-view/card-view.component.html b/lib/core/src/lib/card-view/components/card-view/card-view.component.html index 10ac653f315..81a1f52ac2c 100644 --- a/lib/core/src/lib/card-view/components/card-view/card-view.component.html +++ b/lib/core/src/lib/card-view/components/card-view/card-view.component.html @@ -1,5 +1,5 @@
-
+