Skip to content

Commit

Permalink
fix support tags (#993)
Browse files Browse the repository at this point in the history
Co-authored-by: teodor-ritense <[email protected]>
  • Loading branch information
mbritense and teodor-ritense authored May 15, 2024
1 parent 106904f commit c929216
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,18 +156,22 @@
<ng-container *ngIf="!data.tags">-</ng-container>

<div *ngIf="data.tags" class="tag-template">
<cds-tag *ngIf="!!data.tags[0].content" class="cds-tag--no-margin" [type]="data.tags[0].type">
{{ data.tags[0].content }}
</cds-tag>

<cds-tag
*ngIf="data.tags.length > 1"
class="cds-tag--no-margin valtimo-carbon-list__expand-tag"
type="high-contrast"
(click)="onTagClick($event, data.tags)"
>
{{ data.tags.length - 1 }} <svg cdsIcon="add" size="16"></svg>
</cds-tag>
@if (data.tags.length === 0) {
-
} @else {
<cds-tag *ngIf="!!data.tags[0].content" class="cds-tag--no-margin" [type]="data.tags[0].type">
{{ data.tags[0].content }}
</cds-tag>

<cds-tag
*ngIf="data.tags.length > 1"
class="cds-tag--no-margin valtimo-carbon-list__expand-tag"
type="high-contrast"
(click)="onTagClick($event, data.tags)"
>
{{ data.tags.length - 1 }} <svg cdsIcon="add" size="16"></svg>
</cds-tag>
}
</div>
</ng-template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export class CarbonListComponent implements OnInit, AfterViewInit, OnDestroy {
});
case ViewType.TAGS:
return new TableItem({
data: {tags: item.tags},
data: {tags: item?.tags ?? []},
template: this.tagTemplate,
});
default:
Expand Down

0 comments on commit c929216

Please sign in to comment.