mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-543] Disable Share feature based on repository property (#658)
* add visibility type to navigation schema * repository data model * add repository state * add repository state * add repository evaluator * allot navigation elements to called again * AppRuleContext extends * repository status resolver * map repository evaluator * reevaluate navigation elements * generic route evaluator * add route guard on Share * evaluate guard based on data property * changed old imports * add Action suffix * set state false by default * tree shakable services to simplify rebase * fix rebase * isQuickShareEnabled initial null state * repository store effects * repository store actions * refactored * refactored
This commit is contained in:
committed by
Denys Vuika
parent
30863e7bdd
commit
8d9d3dbc45
@@ -23,9 +23,20 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
OnInit,
|
||||
ViewEncapsulation,
|
||||
OnDestroy
|
||||
} from '@angular/core';
|
||||
import { AppExtensionService } from '../../extensions/extension.service';
|
||||
import { NavBarGroupRef } from '@alfresco/adf-extensions';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { AppStore } from '../../store/states';
|
||||
import { ruleContext } from '../../store/selectors/app.selectors';
|
||||
import { Subject } from 'rxjs';
|
||||
import { takeUntil, distinctUntilChanged, map } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
selector: 'app-sidenav',
|
||||
@@ -34,19 +45,40 @@ import { NavBarGroupRef } from '@alfresco/adf-extensions';
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
host: { class: 'app-sidenav' }
|
||||
})
|
||||
export class SidenavComponent implements OnInit {
|
||||
export class SidenavComponent implements OnInit, OnDestroy {
|
||||
private onDestroy$: Subject<boolean> = new Subject<boolean>();
|
||||
|
||||
@Input()
|
||||
showLabel: boolean;
|
||||
|
||||
groups: Array<NavBarGroupRef> = [];
|
||||
|
||||
constructor(private extensions: AppExtensionService) {}
|
||||
constructor(
|
||||
private store: Store<AppStore>,
|
||||
private extensions: AppExtensionService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.groups = this.extensions.getNavigationGroups();
|
||||
this.store
|
||||
.select(ruleContext)
|
||||
.pipe(
|
||||
takeUntil(this.onDestroy$),
|
||||
map(rules => rules.repository),
|
||||
distinctUntilChanged()
|
||||
)
|
||||
.subscribe(() => {
|
||||
this.groups = this.extensions.getApplicationNavigation(
|
||||
this.extensions.navbar
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
trackById(index: number, obj: { id: string }) {
|
||||
return obj.id;
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.onDestroy$.next(true);
|
||||
this.onDestroy$.complete();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user