@alfresco/aca-shared 8.1.0-39379629667 → 8.1.0-39393175653
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, inject, Input, HostBinding, ChangeDetectionStrategy, ViewEncapsulation, Component, Injectable, NgModule, provideAppInitializer, ViewChild, QueryList, HostListener, ViewChildren, ChangeDetectorRef, DestroyRef, Directive } from '@angular/core';
|
|
3
|
-
import { of, forkJoin, from, BehaviorSubject, Subject } from 'rxjs';
|
|
4
|
-
import { map, tap, catchError, filter,
|
|
3
|
+
import { of, forkJoin, from, BehaviorSubject, Subject, combineLatest } from 'rxjs';
|
|
4
|
+
import { map, tap, catchError, filter, startWith, distinctUntilChanged, debounceTime } from 'rxjs/operators';
|
|
5
5
|
import { UserPreferencesService, AppConfigService, CloseButtonPosition, AuthenticationService, PageTitleService, StorageService, NotificationService, LogService, IconComponent, InfoDrawerComponent as InfoDrawerComponent$1, InfoDrawerTabComponent, ShowHeaderMode, PaginationComponent, NoopTranslateModule } from '@alfresco/adf-core';
|
|
6
6
|
import { AlfrescoApiService, GroupService, UploadService, SharedLinksApiService, SearchQueryBuilderService, AutoFocusDirective, NodesApiService, ContentService, FileAutoDownloadComponent, DocumentListService, DocumentListComponent, AlfrescoApiServiceMock } from '@alfresco/adf-content-services';
|
|
7
7
|
import { OverlayContainer, OverlayModule } from '@angular/cdk/overlay';
|
|
@@ -2096,14 +2096,36 @@ class AppExtensionService {
|
|
|
2096
2096
|
return null;
|
|
2097
2097
|
}
|
|
2098
2098
|
const metadata = this.appConfig.config['content-metadata'] || {};
|
|
2099
|
-
|
|
2100
|
-
if (
|
|
2101
|
-
|
|
2099
|
+
this.appConfigPresets ??= structuredClone(metadata.presets ?? {});
|
|
2100
|
+
if (this.contentMetadataSource !== config) {
|
|
2101
|
+
this.contentMetadataSource = config;
|
|
2102
|
+
const presets = mergeObjects(...elements);
|
|
2103
|
+
const isMergeable = (preset) => !!preset && typeof preset === 'object' && !Array.isArray(preset);
|
|
2104
|
+
Object.entries(this.appConfigPresets).forEach(([presetName, appConfigGroups]) => {
|
|
2105
|
+
const groups = presets[presetName];
|
|
2106
|
+
if (!Array.isArray(groups) || !Array.isArray(appConfigGroups)) {
|
|
2107
|
+
presets[presetName] =
|
|
2108
|
+
isMergeable(groups) && isMergeable(appConfigGroups) ? mergeObjects(groups, appConfigGroups) : (groups ?? appConfigGroups);
|
|
2109
|
+
return;
|
|
2110
|
+
}
|
|
2111
|
+
const extensionTitles = new Set(groups.map((group) => group.title).filter(Boolean));
|
|
2112
|
+
presets[presetName] = mergeArrays(groups, appConfigGroups
|
|
2113
|
+
.map((group) => {
|
|
2114
|
+
if (group.id || !extensionTitles.has(group.title)) {
|
|
2115
|
+
return group;
|
|
2116
|
+
}
|
|
2117
|
+
const settings = { ...group };
|
|
2118
|
+
delete settings.title;
|
|
2119
|
+
delete settings.items;
|
|
2120
|
+
return settings;
|
|
2121
|
+
})
|
|
2122
|
+
.filter((settings) => Object.keys(settings).length));
|
|
2123
|
+
});
|
|
2124
|
+
this.contentMetadataPresets = this.filterDisabled(presets);
|
|
2102
2125
|
}
|
|
2103
|
-
presets = this.
|
|
2104
|
-
metadata.presets = presets;
|
|
2126
|
+
metadata.presets = this.contentMetadataPresets;
|
|
2105
2127
|
this.appConfig.config['content-metadata'] = metadata;
|
|
2106
|
-
return { presets };
|
|
2128
|
+
return { presets: metadata.presets };
|
|
2107
2129
|
}
|
|
2108
2130
|
loadSearchForms(config) {
|
|
2109
2131
|
const elements = this.loader.getElements(config, 'features.search');
|
|
@@ -2121,17 +2143,16 @@ class AppExtensionService {
|
|
|
2121
2143
|
if (Array.isArray(object)) {
|
|
2122
2144
|
return object.filter((item) => !item.disabled).map((item) => this.filterDisabled(item));
|
|
2123
2145
|
}
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
});
|
|
2129
|
-
return object;
|
|
2146
|
+
if (object !== null && typeof object === 'object') {
|
|
2147
|
+
const entry = object;
|
|
2148
|
+
if (entry.disabled) {
|
|
2149
|
+
return undefined;
|
|
2130
2150
|
}
|
|
2151
|
+
Object.keys(entry).forEach((prop) => {
|
|
2152
|
+
entry[prop] = this.filterDisabled(entry[prop]);
|
|
2153
|
+
});
|
|
2131
2154
|
}
|
|
2132
|
-
|
|
2133
|
-
return object;
|
|
2134
|
-
}
|
|
2155
|
+
return object;
|
|
2135
2156
|
}
|
|
2136
2157
|
getSidebarTabs() {
|
|
2137
2158
|
return this.sidebarTabs.filter((action) => this.filterVisible(action));
|
|
@@ -2891,6 +2912,7 @@ class PageComponent {
|
|
|
2891
2912
|
this.router = inject(Router);
|
|
2892
2913
|
this.destroyRef = inject(DestroyRef);
|
|
2893
2914
|
this.autoDownloadService = inject(AutoDownloadService, { optional: true });
|
|
2915
|
+
this.activatedRoute = inject(ActivatedRoute, { optional: true });
|
|
2894
2916
|
this.subscriptions = [];
|
|
2895
2917
|
}
|
|
2896
2918
|
ngOnInit() {
|
|
@@ -2900,7 +2922,13 @@ class PageComponent {
|
|
|
2900
2922
|
.subscribe((actions) => {
|
|
2901
2923
|
this.createActions = actions;
|
|
2902
2924
|
});
|
|
2903
|
-
|
|
2925
|
+
if (this.isRenderedInViewerOutlet()) {
|
|
2926
|
+
this.infoDrawerOpened$ = this.store.select(isInfoDrawerOpened);
|
|
2927
|
+
}
|
|
2928
|
+
else {
|
|
2929
|
+
const viewerOpened$ = this.router.events.pipe(filter((event) => event instanceof NavigationEnd), map((event) => this.isViewerOutletUrl(event.urlAfterRedirects)), startWith(this.isViewerOutletUrl(this.router.url)), distinctUntilChanged());
|
|
2930
|
+
this.infoDrawerOpened$ = combineLatest([this.store.select(isInfoDrawerOpened), viewerOpened$]).pipe(map(([infoDrawerOpened, viewerOpened]) => infoDrawerOpened && !viewerOpened));
|
|
2931
|
+
}
|
|
2904
2932
|
this.store
|
|
2905
2933
|
.select(getAppSelection)
|
|
2906
2934
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
@@ -3002,6 +3030,12 @@ class PageComponent {
|
|
|
3002
3030
|
isOutletPreviewUrl() {
|
|
3003
3031
|
return location.href.includes('viewer:view');
|
|
3004
3032
|
}
|
|
3033
|
+
isViewerOutletUrl(url) {
|
|
3034
|
+
return !!url?.includes('viewer:view');
|
|
3035
|
+
}
|
|
3036
|
+
isRenderedInViewerOutlet() {
|
|
3037
|
+
return !!this.activatedRoute?.pathFromRoot?.some((route) => route.outlet === 'viewer');
|
|
3038
|
+
}
|
|
3005
3039
|
onSortingChanged(event) {
|
|
3006
3040
|
this.filterSorting = event.detail.key + '-' + event.detail.direction;
|
|
3007
3041
|
}
|