mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +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
GitHub
parent
f89833461c
commit
fb140531f4
@@ -47,14 +47,15 @@ describe('InfoDrawerComponent', () => {
|
||||
};
|
||||
const extensionServiceMock = {
|
||||
getSidebarTabs: () => {},
|
||||
getAllowedSidebarActions: () => [
|
||||
{
|
||||
id: 'app.sidebar.close',
|
||||
order: 100,
|
||||
title: 'close',
|
||||
icon: 'highlight_off'
|
||||
}
|
||||
]
|
||||
getAllowedSidebarActions: () =>
|
||||
of([
|
||||
{
|
||||
id: 'app.sidebar.close',
|
||||
order: 100,
|
||||
title: 'close',
|
||||
icon: 'highlight_off'
|
||||
}
|
||||
])
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
|
@@ -27,7 +27,7 @@ import { Component, HostListener, Input, OnChanges, OnDestroy, OnInit } from '@a
|
||||
import { MinimalNodeEntity, MinimalNodeEntryEntity, SiteEntry } from '@alfresco/js-api';
|
||||
import { ContentActionRef, SidebarTabRef } from '@alfresco/adf-extensions';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { getAppSelection, SetInfoDrawerStateAction, ToggleInfoDrawerAction, infoDrawerPreview } from '@alfresco/aca-shared/store';
|
||||
import { SetInfoDrawerStateAction, ToggleInfoDrawerAction, infoDrawerPreview } from '@alfresco/aca-shared/store';
|
||||
import { AppExtensionService } from '../../services/app.extension.service';
|
||||
import { ContentApiService } from '../../services/content-api.service';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
@@ -60,11 +60,11 @@ export class InfoDrawerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
|
||||
ngOnInit() {
|
||||
this.tabs = this.extensions.getSidebarTabs();
|
||||
this.store
|
||||
.select(getAppSelection)
|
||||
this.extensions
|
||||
.getAllowedSidebarActions()
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe(() => {
|
||||
this.actions = this.extensions.getAllowedSidebarActions();
|
||||
.subscribe((actions) => {
|
||||
this.actions = actions;
|
||||
});
|
||||
|
||||
this.store
|
||||
|
@@ -6,6 +6,7 @@
|
||||
[color]="color"
|
||||
[attr.aria-label]="actionRef.description || actionRef.title | translate"
|
||||
[attr.title]="actionRef.description || actionRef.title | translate"
|
||||
[disabled]="actionRef.disabled"
|
||||
(click)="runAction()"
|
||||
>
|
||||
<adf-icon [value]="actionRef.icon"></adf-icon>
|
||||
|
@@ -5,6 +5,7 @@
|
||||
[attr.aria-label]="actionRef.description || actionRef.title | translate"
|
||||
[attr.title]="actionRef.description || actionRef.title | translate"
|
||||
[matMenuTriggerFor]="menu"
|
||||
[disabled]="actionRef.disabled"
|
||||
#matTrigger="matMenuTrigger"
|
||||
>
|
||||
<adf-icon [value]="actionRef.icon"></adf-icon>
|
||||
|
Reference in New Issue
Block a user