mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
[ADF-2567] delete a version (#3151)
* configuration support for version manager * checkbox for version deletion demo * i18n support for version manager * deleting versions * confirmation dialog for version deletion * readme update * update schema * update code as per code review * update i18n resources for demo shell * unit tests
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 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, Inject, ViewEncapsulation } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA } from '@angular/material';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-confirm-dialog',
|
||||
template: `
|
||||
<h1 mat-dialog-title>{{ title | translate }}</h1>
|
||||
<mat-dialog-content>
|
||||
<p>{{ message | translate }}</p>
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions>
|
||||
<span class="spacer"></span>
|
||||
<button mat-button [mat-dialog-close]="true">{{ yesLabel | translate }}</button>
|
||||
<button mat-button [mat-dialog-close]="false" cdkFocusInitial>{{ noLabel | translate }}</button>
|
||||
</mat-dialog-actions>
|
||||
`,
|
||||
styles: [`
|
||||
.spacer { flex: 1 1 auto; }
|
||||
|
||||
.adf-confirm-dialog .mat-dialog-actions .mat-button-wrapper {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
`],
|
||||
host: { 'class': 'adf-confirm-dialog' },
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class ConfirmDialogComponent {
|
||||
|
||||
title: string;
|
||||
message: string;
|
||||
yesLabel: string;
|
||||
noLabel: string;
|
||||
|
||||
constructor(@Inject(MAT_DIALOG_DATA) data) {
|
||||
data = data || {};
|
||||
this.title = data.title || 'ADF_CONFIRM_DIALOG.CONFIRM';
|
||||
this.message = data.message || 'ADF_CONFIRM_DIALOG.MESSAGE';
|
||||
this.yesLabel = data.yesLabel || 'ADF_CONFIRM_DIALOG.YES_LABEL';
|
||||
this.noLabel = data.noLabel || 'ADF_CONFIRM_DIALOG.NO_LABEL';
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ import { DownloadZipDialogComponent } from './download-zip.dialog';
|
||||
import { FolderDialogComponent } from './folder.dialog';
|
||||
import { NodeLockDialogComponent } from './node-lock.dialog';
|
||||
import { ShareDialogComponent } from './share.dialog';
|
||||
import { ConfirmDialogComponent } from './confirm.dialog';
|
||||
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
@@ -46,19 +47,22 @@ import { MatMomentDatetimeModule } from '@mat-datetimepicker/moment';
|
||||
DownloadZipDialogComponent,
|
||||
FolderDialogComponent,
|
||||
NodeLockDialogComponent,
|
||||
ShareDialogComponent
|
||||
ShareDialogComponent,
|
||||
ConfirmDialogComponent
|
||||
],
|
||||
exports: [
|
||||
DownloadZipDialogComponent,
|
||||
FolderDialogComponent,
|
||||
NodeLockDialogComponent,
|
||||
ShareDialogComponent
|
||||
ShareDialogComponent,
|
||||
ConfirmDialogComponent
|
||||
],
|
||||
entryComponents: [
|
||||
DownloadZipDialogComponent,
|
||||
FolderDialogComponent,
|
||||
NodeLockDialogComponent,
|
||||
ShareDialogComponent
|
||||
ShareDialogComponent,
|
||||
ConfirmDialogComponent
|
||||
]
|
||||
})
|
||||
export class DialogModule {}
|
||||
|
||||
@@ -19,3 +19,4 @@ export * from './download-zip.dialog';
|
||||
export * from './folder.dialog';
|
||||
export * from './node-lock.dialog';
|
||||
export * from './share.dialog';
|
||||
export * from './confirm.dialog';
|
||||
|
||||
Reference in New Issue
Block a user