[AAE-3405] - Optimise attach file widget UI (#6271)

* Optimise attach file widget UI

* Show filter button only when there are custom models
This commit is contained in:
arditdomi
2020-10-21 14:21:37 +01:00
committed by GitHub
parent dc8117711a
commit 2273dd7035
9 changed files with 130 additions and 13 deletions

View File

@@ -47,6 +47,7 @@ import { NodeEntryEvent, ShareDataRow } from '../document-list';
import { Subject } from 'rxjs';
import { SEARCH_QUERY_SERVICE_TOKEN } from '../search/search-query-service.token';
import { SearchQueryBuilderService } from '../search/search-query-builder.service';
import { ContentNodeSelectorPanelService } from './content-node-selector-panel.service';
export type ValidationFunction = (entry: Node) => boolean;
@@ -240,6 +241,8 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy {
target: PaginatedComponent;
preselectNodes: NodeEntry[] = [];
searchPanelExpanded: boolean = false;
private onDestroy$ = new Subject<boolean>();
constructor(private customResourcesService: CustomResourcesService,
@@ -247,7 +250,8 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy {
private userPreferencesService: UserPreferencesService,
private nodesApiService: NodesApiService,
private uploadService: UploadService,
private sitesService: SitesService) {
private sitesService: SitesService,
private contentNodeSelectorPanelService: ContentNodeSelectorPanelService) {
}
set chosenNode(value: Node[]) {
@@ -317,6 +321,14 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy {
this.onDestroy$.complete();
}
toggleSearchPanel() {
this.searchPanelExpanded = !this.searchPanelExpanded;
}
hasCustomModels(): boolean {
return this.contentNodeSelectorPanelService?.customModels?.length > 0;
}
private onFileUploadEvent() {
this.uploadService.fileUploadComplete
.pipe(