@alfresco/aca-shared 4.0.0-A.3.3072 → 4.0.0-A.3.3074

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.
@@ -7,7 +7,7 @@ import { CommonModule } from '@angular/common';
7
7
  import * as i1$1 from '@angular/material/icon';
8
8
  import { MatIconModule } from '@angular/material/icon';
9
9
  import * as i2 from '@ngx-translate/core';
10
- import { TranslateModule, TranslateLoader, TranslateService } from '@ngx-translate/core';
10
+ import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
11
11
  import * as i4 from '@angular/material/menu';
12
12
  import { MatMenuItem, MatMenu } from '@angular/material/menu';
13
13
  import { __awaiter } from 'tslib';
@@ -337,7 +337,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
337
337
  */
338
338
  class LockedByComponent {
339
339
  get text() {
340
- return (this.node && this.node.entry.properties && this.node.entry.properties['cm:lockOwner'] && this.node.entry.properties['cm:lockOwner'].displayName);
340
+ var _a, _b, _c, _d;
341
+ return (_d = (_c = (_b = (_a = this.node) === null || _a === void 0 ? void 0 : _a.entry) === null || _b === void 0 ? void 0 : _b.properties) === null || _c === void 0 ? void 0 : _c['cm:lockOwner']) === null || _d === void 0 ? void 0 : _d.displayName;
341
342
  }
342
343
  }
343
344
  LockedByComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: LockedByComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
@@ -656,10 +657,10 @@ class AppExtensionService {
656
657
  const [ns, id] = icon.id.split(':');
657
658
  const value = icon.value;
658
659
  if (!value) {
659
- console.warn(`Missing icon value for "${icon.id}".`);
660
+ this.logger.warn(`Missing icon value for "${icon.id}".`);
660
661
  }
661
662
  else if (!ns || !id) {
662
- console.warn(`Incorrect icon id format: "${icon.id}".`);
663
+ this.logger.warn(`Incorrect icon id format.`);
663
664
  }
664
665
  else {
665
666
  this.matIconRegistry.addSvgIconInNamespace(ns, id, this.sanitizer.bypassSecurityTrustResourceUrl(value));
@@ -721,12 +722,9 @@ class AppExtensionService {
721
722
  }
722
723
  let presets = {};
723
724
  presets = this.filterDisabled(mergeObjects(presets, ...elements));
724
- try {
725
- this.appConfig.config['content-metadata'].presets = presets;
726
- }
727
- catch (error) {
728
- this.logger.error(error, '- could not change content-metadata presets from app.config -');
729
- }
725
+ const metadata = this.appConfig.config['content-metadata'] || {};
726
+ metadata.presets = presets;
727
+ this.appConfig.config['content-metadata'] = metadata;
730
728
  return { presets };
731
729
  }
732
730
  loadSearchForms(config) {
@@ -738,12 +736,7 @@ class AppExtensionService {
738
736
  .filter((entry) => !entry.disabled)
739
737
  .filter((entry) => this.filterVisible(entry))
740
738
  .sort(sortByOrder);
741
- try {
742
- this.appConfig.config['search'] = search;
743
- }
744
- catch (error) {
745
- this.logger.error(error, '- could not change search from app.config -');
746
- }
739
+ this.appConfig.config['search'] = search;
747
740
  return search;
748
741
  }
749
742
  filterDisabled(object) {
@@ -1658,13 +1651,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
1658
1651
  * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
1659
1652
  */
1660
1653
  function isLocked(node) {
1661
- const { entry } = node;
1662
- return ((entry && entry.isLocked) ||
1663
- (entry.properties && (entry.properties['cm:lockType'] === 'READ_ONLY_LOCK' || entry.properties['cm:lockType'] === 'WRITE_LOCK')));
1654
+ var _a, _b;
1655
+ if (node === null || node === void 0 ? void 0 : node.entry) {
1656
+ const { entry } = node;
1657
+ return entry.isLocked || ((_a = entry.properties) === null || _a === void 0 ? void 0 : _a['cm:lockType']) === 'READ_ONLY_LOCK' || ((_b = entry.properties) === null || _b === void 0 ? void 0 : _b['cm:lockType']) === 'WRITE_LOCK';
1658
+ }
1659
+ else {
1660
+ return false;
1661
+ }
1664
1662
  }
1665
1663
  function isLibrary(node) {
1666
- const { entry } = node;
1667
- return (entry.guid && entry.id && entry.preset && entry.title && entry.visibility) || entry.nodeType === 'st:site';
1664
+ if (node === null || node === void 0 ? void 0 : node.entry) {
1665
+ const { entry } = node;
1666
+ return !!(entry.guid && entry.id && entry.preset && entry.title && entry.visibility) || entry.nodeType === 'st:site';
1667
+ }
1668
+ else {
1669
+ return false;
1670
+ }
1668
1671
  }
1669
1672
 
1670
1673
  /*
@@ -1775,11 +1778,13 @@ class PageComponent {
1775
1778
  return this.node ? this.node.id : null;
1776
1779
  }
1777
1780
  imageResolver(row) {
1778
- if (isLocked(row.node)) {
1779
- return 'assets/images/baseline-lock-24px.svg';
1780
- }
1781
- if (isLibrary(row.node)) {
1782
- return 'assets/images/baseline-library_books-24px.svg';
1781
+ if (row) {
1782
+ if (isLocked(row.node)) {
1783
+ return 'assets/images/baseline-lock-24px.svg';
1784
+ }
1785
+ if (isLibrary(row.node)) {
1786
+ return 'assets/images/baseline-library_books-24px.svg';
1787
+ }
1783
1788
  }
1784
1789
  return null;
1785
1790
  }
@@ -2349,7 +2354,6 @@ class AppService {
2349
2354
  this.acaMobileAppSwitcherService = acaMobileAppSwitcherService;
2350
2355
  this.hideSidenavConditions = ['/preview/'];
2351
2356
  this.minimizeSidenavConditions = ['search'];
2352
- this.onDestroy$ = new Subject();
2353
2357
  this.ready = new BehaviorSubject(this.authenticationService.isLoggedIn() || this.withCredentials);
2354
2358
  this.ready$ = this.ready.asObservable();
2355
2359
  this.authenticationService.onLogin.subscribe(() => {
@@ -2367,10 +2371,6 @@ class AppService {
2367
2371
  get withCredentials() {
2368
2372
  return this.config.get('auth.withCredentials', false);
2369
2373
  }
2370
- ngOnDestroy() {
2371
- this.onDestroy$.next(true);
2372
- this.onDestroy$.complete();
2373
- }
2374
2374
  init() {
2375
2375
  this.alfrescoApiService.getInstance().on('error', (error) => {
2376
2376
  var _a, _b;
@@ -2396,17 +2396,17 @@ class AppService {
2396
2396
  .subscribe((_event) => {
2397
2397
  this.store.dispatch(new SetCurrentUrlAction(router.url));
2398
2398
  });
2399
- this.router.events
2400
- .pipe(filter((event) => event instanceof NavigationStart), takeUntil(this.onDestroy$))
2401
- .subscribe(() => {
2399
+ this.router.events.pipe(filter((event) => event instanceof NavigationStart)).subscribe(() => {
2402
2400
  this.store.dispatch(new ResetSelectionAction());
2403
2401
  });
2404
2402
  this.routerExtensionService.mapExtensionRoutes();
2405
2403
  this.uploadService.fileUploadError.subscribe((error) => this.onFileUploadedError(error));
2406
- this.sharedLinksApiService.error.pipe(takeUntil(this.onDestroy$)).subscribe((err) => {
2407
- this.store.dispatch(new SnackbarErrorAction(err.message));
2404
+ this.sharedLinksApiService.error.subscribe((err) => {
2405
+ if (err === null || err === void 0 ? void 0 : err.message) {
2406
+ this.store.dispatch(new SnackbarErrorAction(err.message));
2407
+ }
2408
2408
  });
2409
- this.ready$.pipe(takeUntil(this.onDestroy$)).subscribe((isReady) => {
2409
+ this.ready$.subscribe((isReady) => {
2410
2410
  if (isReady) {
2411
2411
  this.loadRepositoryStatus();
2412
2412
  this.loadUserProfile();
@@ -2423,7 +2423,10 @@ class AppService {
2423
2423
  }
2424
2424
  loadRepositoryStatus() {
2425
2425
  this.contentApi.getRepositoryInformation().subscribe((response) => {
2426
- this.store.dispatch(new SetRepositoryInfoAction(response.entry.repository));
2426
+ var _a;
2427
+ if ((_a = response === null || response === void 0 ? void 0 : response.entry) === null || _a === void 0 ? void 0 : _a.repository) {
2428
+ this.store.dispatch(new SetRepositoryInfoAction(response.entry.repository));
2429
+ }
2427
2430
  });
2428
2431
  }
2429
2432
  loadUserProfile() {
@@ -2439,7 +2442,7 @@ class AppService {
2439
2442
  });
2440
2443
  }
2441
2444
  loadAppSettings() {
2442
- let baseShareUrl = this.config.get('baseShareUrl');
2445
+ let baseShareUrl = this.config.get('baseShareUrl', '');
2443
2446
  if (!baseShareUrl.endsWith('/')) {
2444
2447
  baseShareUrl += '/';
2445
2448
  }
@@ -2447,20 +2450,21 @@ class AppService {
2447
2450
  this.store.dispatch(new SetInitialStateAction(state));
2448
2451
  }
2449
2452
  onFileUploadedError(error) {
2453
+ var _a, _b, _c, _d, _e;
2450
2454
  let message = 'APP.MESSAGES.UPLOAD.ERROR.GENERIC';
2451
- if (error.error.status === 403) {
2455
+ if (((_a = error === null || error === void 0 ? void 0 : error.error) === null || _a === void 0 ? void 0 : _a.status) === 403) {
2452
2456
  message = 'APP.MESSAGES.UPLOAD.ERROR.403';
2453
2457
  }
2454
- if (error.error.status === 404) {
2458
+ if (((_b = error === null || error === void 0 ? void 0 : error.error) === null || _b === void 0 ? void 0 : _b.status) === 404) {
2455
2459
  message = 'APP.MESSAGES.UPLOAD.ERROR.404';
2456
2460
  }
2457
- if (error.error.status === 409) {
2461
+ if (((_c = error === null || error === void 0 ? void 0 : error.error) === null || _c === void 0 ? void 0 : _c.status) === 409) {
2458
2462
  message = 'APP.MESSAGES.UPLOAD.ERROR.CONFLICT';
2459
2463
  }
2460
- if (error.error.status === 500) {
2464
+ if (((_d = error === null || error === void 0 ? void 0 : error.error) === null || _d === void 0 ? void 0 : _d.status) === 500) {
2461
2465
  message = 'APP.MESSAGES.UPLOAD.ERROR.500';
2462
2466
  }
2463
- if (error.error.status === 504) {
2467
+ if (((_e = error === null || error === void 0 ? void 0 : error.error) === null || _e === void 0 ? void 0 : _e.status) === 504) {
2464
2468
  message = 'APP.MESSAGES.UPLOAD.ERROR.504';
2465
2469
  }
2466
2470
  this.store.dispatch(new SnackbarErrorAction(message));
@@ -2795,47 +2799,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
2795
2799
  }]
2796
2800
  }] });
2797
2801
 
2798
- /*!
2799
- * @license
2800
- * Alfresco Example Content Application
2801
- *
2802
- * Copyright (C) 2005 - 2020 Alfresco Software Limited
2803
- *
2804
- * This file is part of the Alfresco Example Content Application.
2805
- * If the software was purchased under a paid Alfresco license, the terms of
2806
- * the paid license agreement will prevail. Otherwise, the software is
2807
- * provided under the following open source license terms:
2808
- *
2809
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
2810
- * it under the terms of the GNU Lesser General Public License as published by
2811
- * the Free Software Foundation, either version 3 of the License, or
2812
- * (at your option) any later version.
2813
- *
2814
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
2815
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
2816
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2817
- * GNU Lesser General Public License for more details.
2818
- *
2819
- * You should have received a copy of the GNU Lesser General Public License
2820
- * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
2821
- */
2822
- class TranslateServiceMock extends TranslateService {
2823
- constructor() {
2824
- super(null, null, null, null, null, null, true, null, null);
2825
- }
2826
- get(key) {
2827
- return of(key);
2828
- }
2829
- instant(key) {
2830
- return key;
2831
- }
2832
- }
2833
- TranslateServiceMock.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: TranslateServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2834
- TranslateServiceMock.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: TranslateServiceMock });
2835
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: TranslateServiceMock, decorators: [{
2836
- type: Injectable
2837
- }], ctorParameters: function () { return []; } });
2838
-
2839
2802
  /*!
2840
2803
  * @license
2841
2804
  * Alfresco Example Content Application
@@ -2865,5 +2828,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
2865
2828
  * Generated bundle index. Do not edit.
2866
2829
  */
2867
2830
 
2868
- export { AlfrescoOfficeExtensionService, AppExtensionService, AppHookService, AppService, AppSharedRuleGuard, ContentApiService, ContextActionsDirective, ContextActionsModule, DefaultExtensionLoaderFactory, DocumentBasePageService, EXTENSION_DATA_LOADERS, ExtensionsDataLoaderGuard, GenericErrorComponent, GenericErrorModule, InfoDrawerComponent, LibTestingModule, LockedByComponent, LockedByModule, NodePermissionService, PageComponent, PageLayoutComponent, PageLayoutContentComponent, PageLayoutErrorComponent, PageLayoutHeaderComponent, PageLayoutModule, PaginationDirective, RouterExtensionService, SharedDirectivesModule, SharedInfoDrawerModule, SharedModule, SharedToolbarModule, ToolbarActionComponent, ToolbarButtonComponent, ToolbarButtonType, ToolbarMenuComponent, ToolbarMenuItemComponent, TranslateServiceMock, initialState, isLibrary, isLocked };
2831
+ export { AlfrescoOfficeExtensionService, AppExtensionService, AppHookService, AppService, AppSharedRuleGuard, ContentApiService, ContextActionsDirective, ContextActionsModule, DefaultExtensionLoaderFactory, DocumentBasePageService, EXTENSION_DATA_LOADERS, ExtensionsDataLoaderGuard, GenericErrorComponent, GenericErrorModule, InfoDrawerComponent, LibTestingModule, LockedByComponent, LockedByModule, NodePermissionService, PageComponent, PageLayoutComponent, PageLayoutContentComponent, PageLayoutErrorComponent, PageLayoutHeaderComponent, PageLayoutModule, PaginationDirective, RouterExtensionService, SharedDirectivesModule, SharedInfoDrawerModule, SharedModule, SharedToolbarModule, ToolbarActionComponent, ToolbarButtonComponent, ToolbarButtonType, ToolbarMenuComponent, ToolbarMenuItemComponent, initialState, isLibrary, isLocked };
2869
2832
  //# sourceMappingURL=alfresco-aca-shared.mjs.map