mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-10-08 14:51:14 +00:00
added header and search layout changes
This commit is contained in:
committed by
Denys Vuika
parent
ef0aaa3e2a
commit
c577ee2ffa
@@ -25,7 +25,7 @@
|
||||
|
||||
import { DocumentListComponent, ShareDataRow } from '@alfresco/adf-content-services';
|
||||
import { ShowHeaderMode } from '@alfresco/adf-core';
|
||||
import { ContentActionRef, DocumentListPresetRef, SelectionState } from '@alfresco/adf-extensions';
|
||||
import { ContentActionRef, ContentActionType, DocumentListPresetRef, SelectionState } from '@alfresco/adf-extensions';
|
||||
import { OnDestroy, OnInit, OnChanges, ViewChild, SimpleChanges, Directive } from '@angular/core';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { MinimalNodeEntity, MinimalNodeEntryEntity, NodePaging } from '@alfresco/js-api';
|
||||
@@ -68,12 +68,32 @@ export abstract class PageComponent implements OnInit, OnDestroy, OnChanges {
|
||||
nodeResult: NodePaging;
|
||||
showHeader = ShowHeaderMode.Data;
|
||||
filterSorting = 'name-asc';
|
||||
createActions: Array<ContentActionRef> = [];
|
||||
uploadActions: Array<ContentActionRef> = [];
|
||||
mainAction$: Observable<ContentActionRef>;
|
||||
actionTypes = ContentActionType;
|
||||
|
||||
protected subscriptions: Subscription[] = [];
|
||||
|
||||
protected constructor(protected store: Store<AppStore>, protected extensions: AppExtensionService, protected content: DocumentBasePageService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.mainAction$ = this.extensions.getMainAction().pipe(takeUntil(this.onDestroy$));
|
||||
|
||||
this.extensions
|
||||
.getCreateActions()
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe((actions) => {
|
||||
this.createActions = actions;
|
||||
});
|
||||
|
||||
this.extensions
|
||||
.getUploadActions()
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe((actions) => {
|
||||
this.uploadActions = actions;
|
||||
});
|
||||
|
||||
this.sharedPreviewUrl$ = this.store.select(getSharedUrl);
|
||||
this.infoDrawerOpened$ = this.store.select(isInfoDrawerOpened).pipe(map((infoDrawerState) => !this.isOutletPreviewUrl() && infoDrawerState));
|
||||
|
||||
@@ -124,6 +144,10 @@ export abstract class PageComponent implements OnInit, OnDestroy, OnChanges {
|
||||
this.store.dispatch(new SetSelectedNodesAction([]));
|
||||
}
|
||||
|
||||
runAction(action: string): void {
|
||||
this.extensions.runActionById(action);
|
||||
}
|
||||
|
||||
showPreview(node: MinimalNodeEntity, extras?: ViewNodeExtras) {
|
||||
if (node && node.entry) {
|
||||
let id: string;
|
||||
|
@@ -7,8 +7,8 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 0 0 65px;
|
||||
flex-basis: 48px;
|
||||
background: var(--theme-background-color);
|
||||
flex-basis: 96px;
|
||||
background: var(--theme-page-layout-header-background-color);
|
||||
border-bottom: 1px solid var(--theme-border-color, rgba(0, 0, 0, 0.07));
|
||||
padding: 0 24px;
|
||||
}
|
||||
|
@@ -79,6 +79,7 @@ export class AppExtensionService implements RuleContext {
|
||||
private _contextMenuActions = new BehaviorSubject<Array<ContentActionRef>>([]);
|
||||
private _openWithActions = new BehaviorSubject<Array<ContentActionRef>>([]);
|
||||
private _createActions = new BehaviorSubject<Array<ContentActionRef>>([]);
|
||||
private _uploadActions = new BehaviorSubject<Array<ContentActionRef>>([]);
|
||||
private _mainActions = new BehaviorSubject<ContentActionRef>(null);
|
||||
private _sidebarActions = new BehaviorSubject<Array<ContentActionRef>>([]);
|
||||
|
||||
@@ -158,6 +159,7 @@ export class AppExtensionService implements RuleContext {
|
||||
this._contextMenuActions.next(this.loader.getContentActions(config, 'features.contextMenu'));
|
||||
this._openWithActions.next(this.loader.getContentActions(config, 'features.viewer.openWith'));
|
||||
this._createActions.next(this.loader.getElements<ContentActionRef>(config, 'features.create'));
|
||||
this._uploadActions.next(this.loader.getElements<ContentActionRef>(config, 'features.upload'));
|
||||
this._mainActions.next(this.loader.getFeatures(config).mainAction);
|
||||
|
||||
this.navbar = this.loadNavBar(config);
|
||||
@@ -366,6 +368,18 @@ export class AppExtensionService implements RuleContext {
|
||||
);
|
||||
}
|
||||
|
||||
getUploadActions(): Observable<Array<ContentActionRef>> {
|
||||
return this._uploadActions.pipe(
|
||||
map((uploadActions) =>
|
||||
uploadActions
|
||||
.filter((action) => this.filterVisible(action))
|
||||
.map((action) => this.copyAction(action))
|
||||
.map((action) => this.buildMenu(action))
|
||||
.map((action) => this.setActionDisabledFromRule(action))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
getMainAction(): Observable<ContentActionRef> {
|
||||
return this._mainActions.pipe(
|
||||
filter((mainAction) => mainAction && this.filterVisible(mainAction)),
|
||||
|
Reference in New Issue
Block a user