Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACS-5645] metadata fixes for encapsulation and host classes #9018

Merged
merged 2 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions lib/core/src/lib/card-view/components/base-card-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -33,9 +32,7 @@ export abstract class BaseCardView<T extends CardViewItem> implements OnDestroy
protected destroy$ = new Subject<boolean>();

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;
}
Expand All @@ -46,5 +43,4 @@ export abstract class BaseCardView<T extends CardViewItem> implements OnDestroy
this.destroy$.next(true);
this.destroy$.complete();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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<CardViewDateItemModel> implements OnInit, OnDestroy {
@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we maybe rename the files for this component as well? To keep consistency

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<CardViewKeyValuePairsItemModel> implements OnChanges {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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<CardViewSelectItemModel<string | number>> implements OnInit, OnChanges, OnDestroy {
private appConfig = inject(AppConfigService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<CardViewTextItemModel> implements OnChanges, OnDestroy {
@Input()
Expand Down
Loading