Revert "[AAE-5874] Re-evaluate extension rules when context changes" (#2301)

* Revert "[AAE-5874] Re-evaluate extension rules when context changes (#2296)"

This reverts commit fb140531f4.

* [ci:force]
This commit is contained in:
Popovics András
2021-09-16 22:55:16 +02:00
committed by Denys Vuika
parent 38cdbfa9c1
commit de355cc300
17 changed files with 239 additions and 408 deletions

View File

@@ -22,6 +22,7 @@
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
import { ContentActionRef, SidebarTabRef } from '@alfresco/adf-extensions';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
@@ -47,15 +48,14 @@ describe('InfoDrawerComponent', () => {
};
const extensionServiceMock = {
getSidebarTabs: () => {},
getAllowedSidebarActions: () =>
of([
{
id: 'app.sidebar.close',
order: 100,
title: 'close',
icon: 'highlight_off'
}
])
getAllowedSidebarActions: () => [
{
id: 'app.sidebar.close',
order: 100,
title: 'close',
icon: 'highlight_off'
}
]
};
beforeEach(() => {

View File

@@ -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 { SetInfoDrawerStateAction, ToggleInfoDrawerAction, infoDrawerPreview } from '@alfresco/aca-shared/store';
import { getAppSelection, 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.extensions
.getAllowedSidebarActions()
this.store
.select(getAppSelection)
.pipe(takeUntil(this.onDestroy$))
.subscribe((actions) => {
this.actions = actions;
.subscribe(() => {
this.actions = this.extensions.getAllowedSidebarActions();
});
this.store

View File

@@ -6,7 +6,6 @@
[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>

View File

@@ -5,7 +5,6 @@
[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>