From 5054679f6cdbe86931098e57075b476f6e302e00 Mon Sep 17 00:00:00 2001 From: swapnil-verma-gl <92505353+swapnil-verma-gl@users.noreply.github.com> Date: Wed, 3 Jan 2024 12:19:04 +0530 Subject: [PATCH] [ACS-6211] Fixed UI alignment issues in create rules screen (CardView and child components) (#9101) * [ACS-6211] Fixed UI alignment issues create rule dialog (changes in card-view and child components) * [ACS-6211] Removed unneeded test case * [ACS-6211] Addressed code review findings. Added label div for when card-view-selectitem.component is in non-editable mode. Added corresponding tests * [ACS-6211] Fixed alignment issue for card-view-selectitem.component * [ACS-6211] Removed unneeded testcase * [ACS-6211] Resolved ui alignment issue with card-view-text-item.component --- .../card-view-boolitem.component.ts | 9 ++++++++- .../card-view-selectitem.component.spec.ts | 7 +++++-- .../components/card-view/card-view.component.html | 2 +- .../components/card-view/card-view.component.scss | 12 ++++++++---- 4 files changed, 22 insertions(+), 8 deletions(-) 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 { 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..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 @@ -73,9 +73,12 @@ describe('CardViewSelectItemComponent', () => { }); describe('Rendering', () => { - it('should render the label', () => { + 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'); 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 @@
-
+