@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.
@@ -8,7 +8,7 @@ import { NodesApi, TrashcanApi, SharedlinksApi, DiscoveryApi, FavoritesApi, Cont
8
8
  import * as i1$1 from '@angular/material/icon';
9
9
  import { MatIconModule } from '@angular/material/icon';
10
10
  import * as i2 from '@ngx-translate/core';
11
- import { TranslateModule, TranslateLoader, TranslateService } from '@ngx-translate/core';
11
+ import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
12
12
  import * as i1$3 from '@ngrx/store';
13
13
  import { StoreModule } from '@ngrx/store';
14
14
  import * as i6 from '@angular/platform-browser';
@@ -334,7 +334,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
334
334
  */
335
335
  class LockedByComponent {
336
336
  get text() {
337
- return (this.node && this.node.entry.properties && this.node.entry.properties['cm:lockOwner'] && this.node.entry.properties['cm:lockOwner'].displayName);
337
+ return this.node?.entry?.properties?.['cm:lockOwner']?.displayName;
338
338
  }
339
339
  }
340
340
  LockedByComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: LockedByComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
@@ -675,10 +675,10 @@ class AppExtensionService {
675
675
  const [ns, id] = icon.id.split(':');
676
676
  const value = icon.value;
677
677
  if (!value) {
678
- console.warn(`Missing icon value for "${icon.id}".`);
678
+ this.logger.warn(`Missing icon value for "${icon.id}".`);
679
679
  }
680
680
  else if (!ns || !id) {
681
- console.warn(`Incorrect icon id format: "${icon.id}".`);
681
+ this.logger.warn(`Incorrect icon id format.`);
682
682
  }
683
683
  else {
684
684
  this.matIconRegistry.addSvgIconInNamespace(ns, id, this.sanitizer.bypassSecurityTrustResourceUrl(value));
@@ -759,12 +759,9 @@ class AppExtensionService {
759
759
  }
760
760
  let presets = {};
761
761
  presets = this.filterDisabled(mergeObjects(presets, ...elements));
762
- try {
763
- this.appConfig.config['content-metadata'].presets = presets;
764
- }
765
- catch (error) {
766
- this.logger.error(error, '- could not change content-metadata presets from app.config -');
767
- }
762
+ const metadata = this.appConfig.config['content-metadata'] || {};
763
+ metadata.presets = presets;
764
+ this.appConfig.config['content-metadata'] = metadata;
768
765
  return { presets };
769
766
  }
770
767
  loadSearchForms(config) {
@@ -776,12 +773,7 @@ class AppExtensionService {
776
773
  .filter((entry) => !entry.disabled)
777
774
  .filter((entry) => this.filterVisible(entry))
778
775
  .sort(sortByOrder);
779
- try {
780
- this.appConfig.config['search'] = search;
781
- }
782
- catch (error) {
783
- this.logger.error(error, '- could not change search from app.config -');
784
- }
776
+ this.appConfig.config['search'] = search;
785
777
  return search;
786
778
  }
787
779
  filterDisabled(object) {
@@ -1705,13 +1697,22 @@ class DocumentBasePageService {
1705
1697
  * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
1706
1698
  */
1707
1699
  function isLocked(node) {
1708
- const { entry } = node;
1709
- return ((entry && entry.isLocked) ||
1710
- (entry.properties && (entry.properties['cm:lockType'] === 'READ_ONLY_LOCK' || entry.properties['cm:lockType'] === 'WRITE_LOCK')));
1700
+ if (node?.entry) {
1701
+ const { entry } = node;
1702
+ return entry.isLocked || entry.properties?.['cm:lockType'] === 'READ_ONLY_LOCK' || entry.properties?.['cm:lockType'] === 'WRITE_LOCK';
1703
+ }
1704
+ else {
1705
+ return false;
1706
+ }
1711
1707
  }
1712
1708
  function isLibrary(node) {
1713
- const { entry } = node;
1714
- return (entry.guid && entry.id && entry.preset && entry.title && entry.visibility) || entry.nodeType === 'st:site';
1709
+ if (node?.entry) {
1710
+ const { entry } = node;
1711
+ return !!(entry.guid && entry.id && entry.preset && entry.title && entry.visibility) || entry.nodeType === 'st:site';
1712
+ }
1713
+ else {
1714
+ return false;
1715
+ }
1715
1716
  }
1716
1717
 
1717
1718
  /*!
@@ -1812,11 +1813,13 @@ class PageComponent {
1812
1813
  return this.node ? this.node.id : null;
1813
1814
  }
1814
1815
  imageResolver(row) {
1815
- if (isLocked(row.node)) {
1816
- return 'assets/images/baseline-lock-24px.svg';
1817
- }
1818
- if (isLibrary(row.node)) {
1819
- return 'assets/images/baseline-library_books-24px.svg';
1816
+ if (row) {
1817
+ if (isLocked(row.node)) {
1818
+ return 'assets/images/baseline-lock-24px.svg';
1819
+ }
1820
+ if (isLibrary(row.node)) {
1821
+ return 'assets/images/baseline-library_books-24px.svg';
1822
+ }
1820
1823
  }
1821
1824
  return null;
1822
1825
  }
@@ -2481,7 +2484,6 @@ class AppService {
2481
2484
  this.acaMobileAppSwitcherService = acaMobileAppSwitcherService;
2482
2485
  this.hideSidenavConditions = ['/preview/'];
2483
2486
  this.minimizeSidenavConditions = ['search'];
2484
- this.onDestroy$ = new Subject();
2485
2487
  this.ready = new BehaviorSubject(this.authenticationService.isLoggedIn() || this.withCredentials);
2486
2488
  this.ready$ = this.ready.asObservable();
2487
2489
  this.authenticationService.onLogin.subscribe(() => {
@@ -2499,10 +2501,6 @@ class AppService {
2499
2501
  get withCredentials() {
2500
2502
  return this.config.get('auth.withCredentials', false);
2501
2503
  }
2502
- ngOnDestroy() {
2503
- this.onDestroy$.next(true);
2504
- this.onDestroy$.complete();
2505
- }
2506
2504
  init() {
2507
2505
  this.alfrescoApiService.getInstance().on('error', (error) => {
2508
2506
  if (error.status === 401 && !this.alfrescoApiService.isExcludedErrorListener(error?.response?.req?.url)) {
@@ -2527,17 +2525,17 @@ class AppService {
2527
2525
  .subscribe((_event) => {
2528
2526
  this.store.dispatch(new SetCurrentUrlAction(router.url));
2529
2527
  });
2530
- this.router.events
2531
- .pipe(filter((event) => event instanceof NavigationStart), takeUntil(this.onDestroy$))
2532
- .subscribe(() => {
2528
+ this.router.events.pipe(filter((event) => event instanceof NavigationStart)).subscribe(() => {
2533
2529
  this.store.dispatch(new ResetSelectionAction());
2534
2530
  });
2535
2531
  this.routerExtensionService.mapExtensionRoutes();
2536
2532
  this.uploadService.fileUploadError.subscribe((error) => this.onFileUploadedError(error));
2537
- this.sharedLinksApiService.error.pipe(takeUntil(this.onDestroy$)).subscribe((err) => {
2538
- this.store.dispatch(new SnackbarErrorAction(err.message));
2533
+ this.sharedLinksApiService.error.subscribe((err) => {
2534
+ if (err?.message) {
2535
+ this.store.dispatch(new SnackbarErrorAction(err.message));
2536
+ }
2539
2537
  });
2540
- this.ready$.pipe(takeUntil(this.onDestroy$)).subscribe((isReady) => {
2538
+ this.ready$.subscribe((isReady) => {
2541
2539
  if (isReady) {
2542
2540
  this.loadRepositoryStatus();
2543
2541
  this.loadUserProfile();
@@ -2554,7 +2552,9 @@ class AppService {
2554
2552
  }
2555
2553
  loadRepositoryStatus() {
2556
2554
  this.contentApi.getRepositoryInformation().subscribe((response) => {
2557
- this.store.dispatch(new SetRepositoryInfoAction(response.entry.repository));
2555
+ if (response?.entry?.repository) {
2556
+ this.store.dispatch(new SetRepositoryInfoAction(response.entry.repository));
2557
+ }
2558
2558
  });
2559
2559
  }
2560
2560
  async loadUserProfile() {
@@ -2568,7 +2568,7 @@ class AppService {
2568
2568
  });
2569
2569
  }
2570
2570
  loadAppSettings() {
2571
- let baseShareUrl = this.config.get('baseShareUrl');
2571
+ let baseShareUrl = this.config.get('baseShareUrl', '');
2572
2572
  if (!baseShareUrl.endsWith('/')) {
2573
2573
  baseShareUrl += '/';
2574
2574
  }
@@ -2587,19 +2587,19 @@ class AppService {
2587
2587
  }
2588
2588
  onFileUploadedError(error) {
2589
2589
  let message = 'APP.MESSAGES.UPLOAD.ERROR.GENERIC';
2590
- if (error.error.status === 403) {
2590
+ if (error?.error?.status === 403) {
2591
2591
  message = 'APP.MESSAGES.UPLOAD.ERROR.403';
2592
2592
  }
2593
- if (error.error.status === 404) {
2593
+ if (error?.error?.status === 404) {
2594
2594
  message = 'APP.MESSAGES.UPLOAD.ERROR.404';
2595
2595
  }
2596
- if (error.error.status === 409) {
2596
+ if (error?.error?.status === 409) {
2597
2597
  message = 'APP.MESSAGES.UPLOAD.ERROR.CONFLICT';
2598
2598
  }
2599
- if (error.error.status === 500) {
2599
+ if (error?.error?.status === 500) {
2600
2600
  message = 'APP.MESSAGES.UPLOAD.ERROR.500';
2601
2601
  }
2602
- if (error.error.status === 504) {
2602
+ if (error?.error?.status === 504) {
2603
2603
  message = 'APP.MESSAGES.UPLOAD.ERROR.504';
2604
2604
  }
2605
2605
  this.store.dispatch(new SnackbarErrorAction(message));
@@ -2932,47 +2932,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
2932
2932
  }]
2933
2933
  }] });
2934
2934
 
2935
- /*!
2936
- * @license
2937
- * Alfresco Example Content Application
2938
- *
2939
- * Copyright (C) 2005 - 2020 Alfresco Software Limited
2940
- *
2941
- * This file is part of the Alfresco Example Content Application.
2942
- * If the software was purchased under a paid Alfresco license, the terms of
2943
- * the paid license agreement will prevail. Otherwise, the software is
2944
- * provided under the following open source license terms:
2945
- *
2946
- * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
2947
- * it under the terms of the GNU Lesser General Public License as published by
2948
- * the Free Software Foundation, either version 3 of the License, or
2949
- * (at your option) any later version.
2950
- *
2951
- * The Alfresco Example Content Application is distributed in the hope that it will be useful,
2952
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
2953
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2954
- * GNU Lesser General Public License for more details.
2955
- *
2956
- * You should have received a copy of the GNU Lesser General Public License
2957
- * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
2958
- */
2959
- class TranslateServiceMock extends TranslateService {
2960
- constructor() {
2961
- super(null, null, null, null, null, null, true, null, null);
2962
- }
2963
- get(key) {
2964
- return of(key);
2965
- }
2966
- instant(key) {
2967
- return key;
2968
- }
2969
- }
2970
- TranslateServiceMock.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: TranslateServiceMock, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2971
- TranslateServiceMock.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: TranslateServiceMock });
2972
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: TranslateServiceMock, decorators: [{
2973
- type: Injectable
2974
- }], ctorParameters: function () { return []; } });
2975
-
2976
2935
  /*!
2977
2936
  * @license
2978
2937
  * Alfresco Example Content Application
@@ -3002,5 +2961,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
3002
2961
  * Generated bundle index. Do not edit.
3003
2962
  */
3004
2963
 
3005
- 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 };
2964
+ 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 };
3006
2965
  //# sourceMappingURL=alfresco-aca-shared.mjs.map