mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-4327] added templating for content dialog (#4549)
* [ADF-4327] added templating for content dialog * [ADF-4327] added unit test and documentation
This commit is contained in:
@@ -41,6 +41,7 @@ export class AppLayoutComponent implements OnInit {
|
||||
{ href: '/breadcrumb', icon: 'label', title: 'APP_LAYOUT.BREADCRUMB' },
|
||||
{ href: '/notifications', icon: 'alarm', title: 'APP_LAYOUT.NOTIFICATIONS' },
|
||||
{ href: '/card-view', icon: 'view_headline', title: 'APP_LAYOUT.CARD_VIEW' },
|
||||
{ href: '/confirm-dialog', icon: 'view_headline', title: 'APP_LAYOUT.CONFIRM-DIALOG' },
|
||||
{ href: '/header-data', icon: 'edit', title: 'APP_LAYOUT.HEADER_DATA' },
|
||||
{ href: '/node-selector', icon: 'attachment', title: 'APP_LAYOUT.NODE-SELECTOR' },
|
||||
{ href: '/sites', icon: 'format_list_bulleted', title: 'APP_LAYOUT.SITES' },
|
||||
|
@@ -0,0 +1,18 @@
|
||||
<mat-accordion>
|
||||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
Confirm Dialog Default Behaviour
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
<button mat-raised-button (click)="openConfirmDefaultDialog()">Open Default Dialog</button>
|
||||
</mat-expansion-panel>
|
||||
<mat-expansion-panel>
|
||||
<mat-expansion-panel-header>
|
||||
<mat-panel-title>
|
||||
Confirm Dialog Custom Template
|
||||
</mat-panel-title>
|
||||
</mat-expansion-panel-header>
|
||||
<button mat-raised-button (click)="openConfirmCustomDialog()">Open Custom Dialog</button>
|
||||
</mat-expansion-panel>
|
||||
</mat-accordion>
|
@@ -0,0 +1,51 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { ConfirmDialogComponent } from '@alfresco/adf-content-services';
|
||||
|
||||
@Component({
|
||||
selector: 'app-confirm-dialog-example',
|
||||
templateUrl: 'confirm-dialog-example.component.html',
|
||||
styleUrls: ['confirm-dialog-example.component.scss']
|
||||
})
|
||||
export class ConfirmDialogExampleComponent {
|
||||
|
||||
constructor(private dialog: MatDialog) { }
|
||||
|
||||
openConfirmDefaultDialog() {
|
||||
this.dialog.open(ConfirmDialogComponent, {
|
||||
data: {
|
||||
title: 'Upload',
|
||||
message: `This is the default message`
|
||||
},
|
||||
minWidth: '250px'
|
||||
});
|
||||
}
|
||||
|
||||
openConfirmCustomDialog() {
|
||||
this.dialog.open(ConfirmDialogComponent, {
|
||||
data: {
|
||||
title: 'Upload',
|
||||
message: `This is the default message`,
|
||||
htmlContent: '<div> <p>A</p> <p>Custom</p> <p>Content</p> </div>'
|
||||
},
|
||||
minWidth: '250px'
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user