mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[AAE-5874] Re-evaluate extension rules when context changes (#2296)
* [AAE-5874] Re-evaluate extension rules when context changes * [AAE-5874] Add disabled attribute to toolbar actions * [AAE-5874] Fix unit tests
This commit is contained in:
committed by
Denys Vuika
parent
46a179c75a
commit
c4e4b50f8a
@@ -25,8 +25,6 @@
|
||||
|
||||
import { Component, Input, OnInit, OnDestroy, ViewEncapsulation } from '@angular/core';
|
||||
import { ContentActionRef } from '@alfresco/adf-extensions';
|
||||
import { AppStore, getRuleContext } from '@alfresco/aca-shared/store';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { Subject } from 'rxjs';
|
||||
import { AppExtensionService } from '@alfresco/aca-shared';
|
||||
@@ -48,14 +46,14 @@ export class CreateMenuComponent implements OnInit, OnDestroy {
|
||||
@Input()
|
||||
expanded: boolean;
|
||||
|
||||
constructor(private store: Store<AppStore>, private extensions: AppExtensionService) {}
|
||||
constructor(private extensions: AppExtensionService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.store
|
||||
.select(getRuleContext)
|
||||
this.extensions
|
||||
.getCreateActions()
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe(() => {
|
||||
this.createActions = this.extensions.getCreateActions();
|
||||
.subscribe((createActions) => {
|
||||
this.createActions = createActions;
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user