Skip to content

Commit af970b3

Browse files
committed
fix(status-badge): update status badge
1 parent fca9031 commit af970b3

2 files changed

Lines changed: 5 additions & 11 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
@if (label) {
2-
<p-tag class="font-bold" [value]="label | translate" [severity]="severity"></p-tag>
1+
@if (label()) {
2+
<p-tag class="font-bold" [value]="label() | translate" [severity]="severity()"></p-tag>
33
}

src/app/shared/components/status-badge/status-badge.component.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ import { TranslatePipe } from '@ngx-translate/core';
22

33
import { Tag } from 'primeng/tag';
44

5-
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
5+
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
66

77
import { RegistryStatusMap } from '@osf/shared/constants/registration-statuses';
88
import { RegistryStatus } from '@osf/shared/enums/registry-status.enum';
9-
import { TagSeverityType } from '@osf/shared/models/severity.type';
109

1110
@Component({
1211
selector: 'osf-status-badge',
@@ -18,11 +17,6 @@ import { TagSeverityType } from '@osf/shared/models/severity.type';
1817
export class StatusBadgeComponent {
1918
status = input.required<RegistryStatus>();
2019

21-
get label(): string {
22-
return RegistryStatusMap[this.status()]?.label ?? 'Unknown';
23-
}
24-
25-
get severity(): TagSeverityType | null {
26-
return RegistryStatusMap[this.status()]?.severity ?? null;
27-
}
20+
label = computed(() => RegistryStatusMap[this.status()]?.label ?? 'resourceCard.type.null');
21+
severity = computed(() => RegistryStatusMap[this.status()]?.severity ?? null);
2822
}

0 commit comments

Comments
 (0)