-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-Authored-by: Bertrand Zuchuat <[email protected]>
- Loading branch information
1 parent
c1366a7
commit 6dcf4c1
Showing
151 changed files
with
5,809 additions
and
3,855 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
17 changes: 17 additions & 0 deletions
17
projects/ng-core-tester/src/app/home/dialog/app-dialog.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- | ||
RERO angular core | ||
Copyright (C) 2020-2024 RERO | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, version 3 of the License. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
--> | ||
<p-button (click)="confirm($event)" [label]="'Save'|translate" [outlined]="true" /> |
58 changes: 58 additions & 0 deletions
58
projects/ng-core-tester/src/app/home/dialog/app-dialog.component.ts
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* RERO angular core | ||
* Copyright (C) 2024 RERO | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, version 3 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
import { Component, inject } from '@angular/core'; | ||
import { TranslateService } from '@ngx-translate/core'; | ||
import { ConfirmationService, MessageService } from 'primeng/api'; | ||
|
||
@Component({ | ||
selector: 'app-dialog', | ||
templateUrl: './app-dialog.component.html' | ||
}) | ||
export class AppDialogComponent { | ||
translate = inject(TranslateService); | ||
confirmationService = inject(ConfirmationService); | ||
messageService = inject(MessageService); | ||
|
||
confirm(event: Event): void { | ||
this.confirmationService.confirm({ | ||
target: event.target as EventTarget, | ||
acceptLabel: this.translate.instant('Yes'), | ||
rejectLabel: this.translate.instant('No'), | ||
message: this.translate.instant('Are you sure that you want to proceed?'), | ||
header: this.translate.instant('Confirmation'), | ||
icon: 'pi pi-exclamation-triangle', | ||
acceptIcon:"none", | ||
rejectIcon:"none", | ||
rejectButtonStyleClass:"p-button-text", | ||
accept: () => { | ||
this.messageService.add({ | ||
severity: 'info', | ||
summary: this.translate.instant('Confirmed'), | ||
detail: this.translate.instant('You have accepted') | ||
}); | ||
}, | ||
reject: () => { | ||
this.messageService.add({ | ||
severity: 'error', | ||
summary: this.translate.instant('Rejected'), | ||
detail: this.translate.instant('You have rejected'), | ||
life: 3000 | ||
}); | ||
} | ||
}); | ||
} | ||
} |
Oops, something went wrong.