From 76f69d128c24907cf059ae23e9b8a6dd36a6e3eb Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Tue, 24 Oct 2023 15:08:55 +0100 Subject: [PATCH 1/2] remove useless typing --- lib/core/src/lib/card-view/components/base-card-view.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/core/src/lib/card-view/components/base-card-view.ts b/lib/core/src/lib/card-view/components/base-card-view.ts index 764efe8f106..8f962d56ca2 100644 --- a/lib/core/src/lib/card-view/components/base-card-view.ts +++ b/lib/core/src/lib/card-view/components/base-card-view.ts @@ -18,7 +18,6 @@ import { Input, OnDestroy, Directive, inject } from '@angular/core'; import { CardViewUpdateService } from '../services/card-view-update.service'; import { CardViewItem } from '../interfaces/card-view.interfaces'; -import { CardViewBaseItemModel } from '../models/card-view-baseitem.model'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; @@ -33,9 +32,7 @@ export abstract class BaseCardView implements OnDestroy protected destroy$ = new Subject(); constructor() { - this.cardViewUpdateService.updateItem$ - .pipe(takeUntil(this.destroy$)) - .subscribe((itemModel: CardViewBaseItemModel) => { + this.cardViewUpdateService.updateItem$.pipe(takeUntil(this.destroy$)).subscribe((itemModel) => { if (this.property.key === itemModel.key) { this.property.value = itemModel.value; } @@ -46,5 +43,4 @@ export abstract class BaseCardView implements OnDestroy this.destroy$.next(true); this.destroy$.complete(); } - } From e2c256f4f4cfe85fb418d9571039ac20e72294a5 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Tue, 24 Oct 2023 15:11:57 +0100 Subject: [PATCH 2/2] fix missing host classes and encapsulation --- .../card-view-dateitem/card-view-dateitem.component.ts | 3 ++- .../card-view-keyvaluepairsitem.component.ts | 5 +++-- .../card-view-selectitem/card-view-selectitem.component.ts | 6 ++++-- .../card-view-textitem/card-view-textitem.component.ts | 3 ++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/core/src/lib/card-view/components/card-view-dateitem/card-view-dateitem.component.ts b/lib/core/src/lib/card-view/components/card-view-dateitem/card-view-dateitem.component.ts index 875b2ccd4e6..6ae92d091ab 100644 --- a/lib/core/src/lib/card-view/components/card-view-dateitem/card-view-dateitem.component.ts +++ b/lib/core/src/lib/card-view/components/card-view-dateitem/card-view-dateitem.component.ts @@ -41,7 +41,8 @@ import { isValid } from 'date-fns'; selector: 'adf-card-view-dateitem', templateUrl: './card-view-dateitem.component.html', styleUrls: ['./card-view-dateitem.component.scss'], - encapsulation: ViewEncapsulation.None + encapsulation: ViewEncapsulation.None, + host: { class: 'adf-card-view-dateitem' } }) export class CardViewDateItemComponent extends BaseCardView implements OnInit, OnDestroy { @Input() diff --git a/lib/core/src/lib/card-view/components/card-view-keyvaluepairsitem/card-view-keyvaluepairsitem.component.ts b/lib/core/src/lib/card-view/components/card-view-keyvaluepairsitem/card-view-keyvaluepairsitem.component.ts index 3e7b981784e..abe88ff3696 100644 --- a/lib/core/src/lib/card-view/components/card-view-keyvaluepairsitem/card-view-keyvaluepairsitem.component.ts +++ b/lib/core/src/lib/card-view/components/card-view-keyvaluepairsitem/card-view-keyvaluepairsitem.component.ts @@ -22,10 +22,11 @@ import { MatTableDataSource } from '@angular/material/table'; import { BaseCardView } from '../base-card-view'; @Component({ - selector: 'adf-card-view-keyvaluepairsitem', + selector: 'adf-card-view-key-value-pairs-item', templateUrl: './card-view-keyvaluepairsitem.component.html', styleUrls: ['./card-view-keyvaluepairsitem.component.scss'], - encapsulation: ViewEncapsulation.None + encapsulation: ViewEncapsulation.None, + host: { class: 'adf-card-view-key-value-pairs-item' } }) export class CardViewKeyValuePairsItemComponent extends BaseCardView implements OnChanges { diff --git a/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.ts b/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.ts index a9e05655ee1..636f43ecb2a 100644 --- a/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.ts +++ b/lib/core/src/lib/card-view/components/card-view-selectitem/card-view-selectitem.component.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { Component, Input, OnChanges, OnDestroy, OnInit, inject } from '@angular/core'; +import { Component, Input, OnChanges, OnDestroy, OnInit, inject, ViewEncapsulation } from '@angular/core'; import { CardViewSelectItemModel } from '../../models/card-view-selectitem.model'; import { BehaviorSubject, combineLatest, Observable, Subject } from 'rxjs'; import { CardViewSelectItemOption } from '../../interfaces/card-view.interfaces'; @@ -27,7 +27,9 @@ import { takeUntil, map } from 'rxjs/operators'; @Component({ selector: 'adf-card-view-selectitem', templateUrl: './card-view-selectitem.component.html', - styleUrls: ['./card-view-selectitem.component.scss'] + styleUrls: ['./card-view-selectitem.component.scss'], + encapsulation: ViewEncapsulation.None, + host: { class: 'adf-card-view-selectitem' } }) export class CardViewSelectItemComponent extends BaseCardView> implements OnInit, OnChanges, OnDestroy { private appConfig = inject(AppConfigService); diff --git a/lib/core/src/lib/card-view/components/card-view-textitem/card-view-textitem.component.ts b/lib/core/src/lib/card-view/components/card-view-textitem/card-view-textitem.component.ts index d1eba639b2f..0b1f5b68f41 100644 --- a/lib/core/src/lib/card-view/components/card-view-textitem/card-view-textitem.component.ts +++ b/lib/core/src/lib/card-view/components/card-view-textitem/card-view-textitem.component.ts @@ -39,7 +39,8 @@ const templateTypes = { selector: 'adf-card-view-textitem', templateUrl: './card-view-textitem.component.html', styleUrls: ['./card-view-textitem.component.scss'], - encapsulation: ViewEncapsulation.None + encapsulation: ViewEncapsulation.None, + host: { class: 'adf-card-view-textitem' } }) export class CardViewTextItemComponent extends BaseCardView implements OnChanges, OnDestroy { @Input()