[ACA-92] Context Menu - share settings action (#699)

* context menu share settings action

* update cspell with 'qshare'

* share/edit share in viewer

* force change detection on children

* cleanup module declarations

* detection only for preview page

* assert properties

* cast to boolean
This commit is contained in:
Cilibiu Bogdan
2018-10-10 20:31:13 +03:00
committed by Denys Vuika
parent 8d28838de4
commit f44b3629e9
11 changed files with 262 additions and 30 deletions

View File

@@ -27,7 +27,9 @@ import {
Component,
ViewEncapsulation,
ChangeDetectionStrategy,
Input
Input,
DoCheck,
ChangeDetectorRef
} from '@angular/core';
import { ContentActionRef } from '@alfresco/adf-extensions';
@@ -38,7 +40,7 @@ import { ContentActionRef } from '@alfresco/adf-extensions';
changeDetection: ChangeDetectionStrategy.OnPush,
host: { class: 'aca-toolbar-action' }
})
export class ToolbarActionComponent {
export class ToolbarActionComponent implements DoCheck {
@Input()
type = 'icon-button';
@@ -47,4 +49,14 @@ export class ToolbarActionComponent {
@Input()
actionRef: ContentActionRef;
constructor(private cd: ChangeDetectorRef) {}
// todo: review after ADF 2.6
// preview component : change detection workaround for children without input
ngDoCheck() {
if (this.actionRef.id.includes('app.viewer')) {
this.cd.markForCheck();
}
}
}