-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: more updates to use signals
- Loading branch information
Showing
38 changed files
with
362 additions
and
378 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 6 additions & 7 deletions
13
src/app/common/loading-overlay/loading-overlay.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<div class="alert alert-{{ notificationType }} d-flex" [class.small]="small"> | ||
<div class="flex-grow-1" [class.action-text]="showActions"> | ||
{{ message }} | ||
<div class="alert alert-{{ notificationType() }} d-flex" [class.small]="small()"> | ||
<div class="flex-grow-1" [class.action-text]="showActions()"> | ||
{{ message() }} | ||
</div> | ||
@if (showActions) { | ||
@if (showActions() && actionTemplate()) { | ||
<div class="table-actions d-flex"> | ||
<ng-container *ngTemplateOutlet="actionTemplate"></ng-container> | ||
<ng-container *ngTemplateOutlet="actionTemplate() ?? null"></ng-container> | ||
</div> | ||
} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
import { NgTemplateOutlet } from '@angular/common'; | ||
import { Component, ContentChild, Input, TemplateRef, booleanAttribute } from '@angular/core'; | ||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
TemplateRef, | ||
booleanAttribute, | ||
contentChild, | ||
input | ||
} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'notification', | ||
templateUrl: 'notification.component.html', | ||
styleUrls: ['notification.component.scss'], | ||
standalone: true, | ||
imports: [NgTemplateOutlet] | ||
imports: [NgTemplateOutlet], | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class NotificationComponent { | ||
@ContentChild('notificationActions', { static: true }) actionTemplate: TemplateRef<any> | null = | ||
null; | ||
readonly actionTemplate = contentChild<TemplateRef<any>>('notificationActions'); | ||
|
||
@Input() | ||
notificationType: 'info' | 'success' | 'warning' | 'danger' = 'info'; | ||
|
||
@Input() | ||
message = ''; | ||
|
||
@Input({ transform: booleanAttribute }) | ||
showActions = false; | ||
|
||
@Input({ transform: booleanAttribute }) | ||
small = false; | ||
readonly notificationType = input<'info' | 'success' | 'warning' | 'danger'>('info'); | ||
readonly message = input(''); | ||
readonly showActions = input(false, { transform: booleanAttribute }); | ||
readonly small = input(false, { transform: booleanAttribute }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.