mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4484] Quick notifications (#4688)
* quick notifications (info, error, warning) * update code docs
This commit is contained in:
@@ -65,4 +65,10 @@
|
||||
{{snackBarConfigObject}}
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3>Quick Messages</h3>
|
||||
<button mat-button color="primary" (click)="quickInfo()">Info</button>
|
||||
<button mat-button color="warn" (click)="quickError()">Error</button>
|
||||
<button mat-button color="accent" (click)="quickWarning()">Warning</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -117,4 +117,16 @@ export class NotificationsComponent implements OnInit {
|
||||
dismissSnackBar() {
|
||||
this.notificationService.dismissSnackMessageAction();
|
||||
}
|
||||
|
||||
quickError() {
|
||||
this.notificationService.showError(this.message, 'Fix');
|
||||
}
|
||||
|
||||
quickInfo() {
|
||||
this.notificationService.showInfo(this.message);
|
||||
}
|
||||
|
||||
quickWarning() {
|
||||
this.notificationService.showWarning(this.message, 'Undo');
|
||||
}
|
||||
}
|
||||
|
@@ -20,6 +20,7 @@ import { NotificationsComponent } from './notifications.component';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
@@ -32,7 +33,8 @@ const routes: Routes = [
|
||||
imports: [
|
||||
CommonModule,
|
||||
CoreModule.forChild(),
|
||||
RouterModule.forChild(routes)
|
||||
RouterModule.forChild(routes),
|
||||
MatButtonModule
|
||||
],
|
||||
declarations: [NotificationsComponent]
|
||||
})
|
||||
|
Reference in New Issue
Block a user