mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4406] - Confirm Dialog doesn't support a third extra button option to be customised (#4608)
* [ADF-4406] - Confirm Dialog doesn't support a third extra button option to be customised * * comments fixed * * docs and test added
This commit is contained in:
@@ -15,4 +15,15 @@
|
||||
</mat-expansion-panel-header>
|
||||
<button mat-raised-button (click)="openConfirmCustomDialog()">Open Custom Dialog</button>
|
||||
</mat-expansion-panel>
|
||||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
Confirm Dialog Third Option
|
||||
</mat-panel-title>
|
||||
<mat-panel-description>
|
||||
Provide extra button in the action section
|
||||
</mat-panel-description>
|
||||
</mat-expansion-panel-header>
|
||||
<button mat-raised-button (click)="openConfirmCustomActionDialog()">Open Custom Dialog</button>
|
||||
</mat-expansion-panel>
|
||||
</mat-accordion>
|
||||
|
@@ -48,4 +48,22 @@ export class ConfirmDialogExampleComponent {
|
||||
minWidth: '250px'
|
||||
});
|
||||
}
|
||||
|
||||
openConfirmCustomActionDialog() {
|
||||
const thirdOptionLabel = 'Yes. Don\'t Show it again';
|
||||
const dialog = this.dialog.open(ConfirmDialogComponent, {
|
||||
data: {
|
||||
title: 'Upload',
|
||||
thirdOptionLabel: thirdOptionLabel,
|
||||
message: `This is the default message`
|
||||
},
|
||||
minWidth: '250px'
|
||||
});
|
||||
dialog.afterClosed().subscribe((status) => {
|
||||
// do the third option label operation
|
||||
if ( status === thirdOptionLabel) {
|
||||
// console.log('third option clicked');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user