@flusys/ng-storage 5.5.0 → 6.0.0-beta.2
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.
- package/fesm2022/{flusys-ng-storage-file-manager-form.component--W6sWv7W.mjs → flusys-ng-storage-file-manager-form.component-V-ZDWkKU.mjs} +83 -126
- package/fesm2022/flusys-ng-storage-file-manager-form.component-V-ZDWkKU.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-file-manager-list.component-D_shqU2a.mjs → flusys-ng-storage-file-manager-list.component-DqHH9lI0.mjs} +76 -74
- package/fesm2022/flusys-ng-storage-file-manager-list.component-DqHH9lI0.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-folder-form.component-BK2EWeV4.mjs → flusys-ng-storage-folder-form.component-Up9luV7j.mjs} +17 -17
- package/fesm2022/flusys-ng-storage-folder-form.component-Up9luV7j.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-folder-list.component-aQXBRZiN.mjs → flusys-ng-storage-folder-list.component-B52N1JaK.mjs} +32 -35
- package/fesm2022/flusys-ng-storage-folder-list.component-B52N1JaK.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-storage-config-form.component-ByRs-CSx.mjs → flusys-ng-storage-storage-config-form.component-CEW5gpSt.mjs} +63 -68
- package/fesm2022/flusys-ng-storage-storage-config-form.component-CEW5gpSt.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-storage-config-list.component-cjiA8k2G.mjs → flusys-ng-storage-storage-config-list.component-C-jaO7xD.mjs} +34 -38
- package/fesm2022/flusys-ng-storage-storage-config-list.component-C-jaO7xD.mjs.map +1 -0
- package/fesm2022/flusys-ng-storage.mjs +72 -83
- package/fesm2022/flusys-ng-storage.mjs.map +1 -1
- package/package.json +5 -7
- package/types/flusys-ng-storage.d.ts +5 -11
- package/fesm2022/flusys-ng-storage-file-manager-form.component--W6sWv7W.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-file-manager-list.component-D_shqU2a.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-folder-form.component-BK2EWeV4.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-folder-list.component-aQXBRZiN.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-storage-config-form.component-ByRs-CSx.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-storage-config-list.component-cjiA8k2G.mjs.map +0 -1
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, signal, computed, Directive, DestroyRef, Injectable, Component } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
-
import { Router, RouterOutlet
|
|
4
|
+
import { Router, RouterOutlet } from '@angular/router';
|
|
5
5
|
import { APP_CONFIG, DEFAULT_APP_NAME, BaseApiService, getDefaultStorageConfigId } from '@flusys/ng-core';
|
|
6
6
|
import { LAYOUT_AUTH_STATE } from '@flusys/ng-layout';
|
|
7
|
-
import { TranslateService, ApiResourceService, FILE_PROVIDER, permissionGuard, FILE_PERMISSIONS, FOLDER_PERMISSIONS, STORAGE_CONFIG_PERMISSIONS, resolveTranslationModule, SHARED_MESSAGES, PermissionValidatorService, TranslatePipe } from '@flusys/ng-shared';
|
|
8
|
-
import { MessageService, ConfirmationService } from '
|
|
7
|
+
import { TranslateService, ApiResourceService, FILE_PROVIDER, permissionGuard, FILE_PERMISSIONS, FOLDER_PERMISSIONS, STORAGE_CONFIG_PERMISSIONS, resolveTranslationModule, SHARED_MESSAGES, PermissionValidatorService, RouterTabsComponent, TranslatePipe } from '@flusys/ng-shared';
|
|
8
|
+
import { MessageService, ConfirmationService } from '@flusys/ng-ui';
|
|
9
9
|
import { from, switchMap, map } from 'rxjs';
|
|
10
|
-
import { CommonModule } from '@angular/common';
|
|
11
10
|
|
|
12
11
|
const STORAGE_MESSAGES = {
|
|
13
12
|
// File entity CRUD (API keys)
|
|
@@ -201,22 +200,22 @@ const PROVIDER_LABEL_KEYS = {
|
|
|
201
200
|
const PROVIDER_CONFIGS = {
|
|
202
201
|
[FileLocationEnum.LOCAL]: {
|
|
203
202
|
labelKey: 'storage.local.title',
|
|
204
|
-
icon: '
|
|
203
|
+
icon: 'folder',
|
|
205
204
|
severity: 'secondary',
|
|
206
205
|
},
|
|
207
206
|
[FileLocationEnum.AWS]: {
|
|
208
207
|
labelKey: 'storage.aws.title',
|
|
209
|
-
icon: '
|
|
208
|
+
icon: 'cloud',
|
|
210
209
|
severity: 'warn',
|
|
211
210
|
},
|
|
212
211
|
[FileLocationEnum.AZURE]: {
|
|
213
212
|
labelKey: 'storage.azure.title',
|
|
214
|
-
icon: '
|
|
213
|
+
icon: 'cloud',
|
|
215
214
|
severity: 'info',
|
|
216
215
|
},
|
|
217
216
|
[FileLocationEnum.SFTP]: {
|
|
218
217
|
labelKey: 'storage.sftp.title',
|
|
219
|
-
icon: '
|
|
218
|
+
icon: 'server',
|
|
220
219
|
severity: 'contrast',
|
|
221
220
|
},
|
|
222
221
|
};
|
|
@@ -232,10 +231,10 @@ function getProviderLabelKey(storage) {
|
|
|
232
231
|
*/
|
|
233
232
|
function getProviderIcon(storage) {
|
|
234
233
|
const enumValue = storage;
|
|
235
|
-
return PROVIDER_CONFIGS[enumValue]?.icon ?? '
|
|
234
|
+
return PROVIDER_CONFIGS[enumValue]?.icon ?? 'database';
|
|
236
235
|
}
|
|
237
236
|
/**
|
|
238
|
-
* Get provider severity for
|
|
237
|
+
* Get provider severity for f-tag
|
|
239
238
|
*/
|
|
240
239
|
function getProviderSeverity(storage) {
|
|
241
240
|
const enumValue = storage;
|
|
@@ -246,18 +245,18 @@ function getProviderSeverity(storage) {
|
|
|
246
245
|
*/
|
|
247
246
|
function getFileIcon(contentType) {
|
|
248
247
|
if (contentType.startsWith('image/'))
|
|
249
|
-
return '
|
|
248
|
+
return 'image';
|
|
250
249
|
if (contentType.startsWith('video/'))
|
|
251
|
-
return '
|
|
250
|
+
return 'video';
|
|
252
251
|
if (contentType.startsWith('audio/'))
|
|
253
|
-
return '
|
|
252
|
+
return 'volume-up';
|
|
254
253
|
if (contentType.includes('pdf'))
|
|
255
|
-
return '
|
|
254
|
+
return 'file-pdf';
|
|
256
255
|
if (contentType.includes('word') || contentType.includes('document'))
|
|
257
|
-
return '
|
|
256
|
+
return 'file-word';
|
|
258
257
|
if (contentType.includes('excel') || contentType.includes('spreadsheet'))
|
|
259
|
-
return '
|
|
260
|
-
return '
|
|
258
|
+
return 'file-excel';
|
|
259
|
+
return 'file';
|
|
261
260
|
}
|
|
262
261
|
/** File size unit keys for translation */
|
|
263
262
|
const FILE_SIZE_UNIT_KEYS = [
|
|
@@ -327,10 +326,10 @@ class BaseStoragePage {
|
|
|
327
326
|
navigateTo(path) {
|
|
328
327
|
this.router.navigate(path);
|
|
329
328
|
}
|
|
330
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
331
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.
|
|
329
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseStoragePage, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
330
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: BaseStoragePage, isStandalone: true, ngImport: i0 });
|
|
332
331
|
}
|
|
333
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
332
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseStoragePage, decorators: [{
|
|
334
333
|
type: Directive
|
|
335
334
|
}] });
|
|
336
335
|
class BaseStorageListPage {
|
|
@@ -409,7 +408,7 @@ class BaseStorageListPage {
|
|
|
409
408
|
this.confirmationService.confirm({
|
|
410
409
|
message: this.getDeleteConfirmMessage(item),
|
|
411
410
|
header: options?.header ?? this.t('shared.confirm.delete.header'),
|
|
412
|
-
icon: '
|
|
411
|
+
icon: 'exclamation-triangle',
|
|
413
412
|
acceptButtonStyleClass: 'p-button-danger',
|
|
414
413
|
accept: () => {
|
|
415
414
|
from(deleteApiCall(idGetter(item)))
|
|
@@ -428,7 +427,7 @@ class BaseStorageListPage {
|
|
|
428
427
|
this.confirmationService.confirm({
|
|
429
428
|
message: this.getDeleteConfirmMessage(item),
|
|
430
429
|
header: options?.header ?? this.t('shared.confirm.delete.header'),
|
|
431
|
-
icon: '
|
|
430
|
+
icon: 'exclamation-triangle',
|
|
432
431
|
acceptButtonStyleClass: 'p-button-danger',
|
|
433
432
|
accept: async () => {
|
|
434
433
|
const res = await deleteApiCall(idGetter(item));
|
|
@@ -444,10 +443,10 @@ class BaseStorageListPage {
|
|
|
444
443
|
t(key, variables) {
|
|
445
444
|
return this.translateAdapter?.translate(key, variables) ?? key;
|
|
446
445
|
}
|
|
447
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
448
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.
|
|
446
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseStorageListPage, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
447
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.6", type: BaseStorageListPage, isStandalone: true, ngImport: i0 });
|
|
449
448
|
}
|
|
450
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
449
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseStorageListPage, decorators: [{
|
|
451
450
|
type: Directive
|
|
452
451
|
}] });
|
|
453
452
|
|
|
@@ -465,10 +464,10 @@ class FileManagerApiService extends ApiResourceService {
|
|
|
465
464
|
createFiles(dtos) {
|
|
466
465
|
return this.http.post(`${this.baseUrl}/insert-many`, dtos);
|
|
467
466
|
}
|
|
468
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
469
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
467
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FileManagerApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
468
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FileManagerApiService, providedIn: 'root' });
|
|
470
469
|
}
|
|
471
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
470
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FileManagerApiService, decorators: [{
|
|
472
471
|
type: Injectable,
|
|
473
472
|
args: [{ providedIn: 'root' }]
|
|
474
473
|
}], ctorParameters: () => [] });
|
|
@@ -484,10 +483,10 @@ class FolderApiService extends ApiResourceService {
|
|
|
484
483
|
constructor() {
|
|
485
484
|
super('folder', 'storage');
|
|
486
485
|
}
|
|
487
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
488
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
486
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FolderApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
487
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FolderApiService, providedIn: 'root' });
|
|
489
488
|
}
|
|
490
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
489
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FolderApiService, decorators: [{
|
|
491
490
|
type: Injectable,
|
|
492
491
|
args: [{
|
|
493
492
|
providedIn: 'root',
|
|
@@ -505,10 +504,10 @@ class StorageConfigApiService extends ApiResourceService {
|
|
|
505
504
|
constructor() {
|
|
506
505
|
super('storage-config', 'storage');
|
|
507
506
|
}
|
|
508
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
509
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
507
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: StorageConfigApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
508
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: StorageConfigApiService, providedIn: 'root' });
|
|
510
509
|
}
|
|
511
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
510
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: StorageConfigApiService, decorators: [{
|
|
512
511
|
type: Injectable,
|
|
513
512
|
args: [{
|
|
514
513
|
providedIn: 'root',
|
|
@@ -618,10 +617,10 @@ class UploadService extends BaseApiService {
|
|
|
618
617
|
const configId = this.resolveConfigId(storageConfigId);
|
|
619
618
|
return { ...data, ...(configId && { storageConfigId: configId }) };
|
|
620
619
|
}
|
|
621
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
622
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
620
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: UploadService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
621
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: UploadService, providedIn: 'root' });
|
|
623
622
|
}
|
|
624
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
623
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: UploadService, decorators: [{
|
|
625
624
|
type: Injectable,
|
|
626
625
|
args: [{ providedIn: 'root' }]
|
|
627
626
|
}], ctorParameters: () => [] });
|
|
@@ -688,10 +687,10 @@ class FileProviderAdapter {
|
|
|
688
687
|
size: parseFloat(f.size) * 1024,
|
|
689
688
|
contentType: f.contentType,
|
|
690
689
|
});
|
|
691
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
692
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
690
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FileProviderAdapter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
691
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FileProviderAdapter });
|
|
693
692
|
}
|
|
694
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
693
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FileProviderAdapter, decorators: [{
|
|
695
694
|
type: Injectable
|
|
696
695
|
}] });
|
|
697
696
|
|
|
@@ -737,17 +736,17 @@ const STORAGE_ROUTES = [
|
|
|
737
736
|
children: [
|
|
738
737
|
{
|
|
739
738
|
path: '',
|
|
740
|
-
loadComponent: () => import('./flusys-ng-storage-file-manager-list.component-
|
|
739
|
+
loadComponent: () => import('./flusys-ng-storage-file-manager-list.component-DqHH9lI0.mjs').then((m) => m.FileManagerListComponent),
|
|
741
740
|
},
|
|
742
741
|
{
|
|
743
742
|
path: 'new',
|
|
744
743
|
canActivate: [permissionGuard(FILE_PERMISSIONS.CREATE)],
|
|
745
|
-
loadComponent: () => import('./flusys-ng-storage-file-manager-form.component
|
|
744
|
+
loadComponent: () => import('./flusys-ng-storage-file-manager-form.component-V-ZDWkKU.mjs').then((m) => m.FileManagerFormComponent),
|
|
746
745
|
},
|
|
747
746
|
{
|
|
748
747
|
path: ':id',
|
|
749
748
|
canActivate: [permissionGuard(FILE_PERMISSIONS.UPDATE)],
|
|
750
|
-
loadComponent: () => import('./flusys-ng-storage-file-manager-form.component
|
|
749
|
+
loadComponent: () => import('./flusys-ng-storage-file-manager-form.component-V-ZDWkKU.mjs').then((m) => m.FileManagerFormComponent),
|
|
751
750
|
},
|
|
752
751
|
],
|
|
753
752
|
},
|
|
@@ -758,17 +757,17 @@ const STORAGE_ROUTES = [
|
|
|
758
757
|
children: [
|
|
759
758
|
{
|
|
760
759
|
path: '',
|
|
761
|
-
loadComponent: () => import('./flusys-ng-storage-folder-list.component-
|
|
760
|
+
loadComponent: () => import('./flusys-ng-storage-folder-list.component-B52N1JaK.mjs').then((m) => m.FolderListComponent),
|
|
762
761
|
},
|
|
763
762
|
{
|
|
764
763
|
path: 'new',
|
|
765
764
|
canActivate: [permissionGuard(FOLDER_PERMISSIONS.CREATE)],
|
|
766
|
-
loadComponent: () => import('./flusys-ng-storage-folder-form.component-
|
|
765
|
+
loadComponent: () => import('./flusys-ng-storage-folder-form.component-Up9luV7j.mjs').then((m) => m.FolderFormComponent),
|
|
767
766
|
},
|
|
768
767
|
{
|
|
769
768
|
path: ':id',
|
|
770
769
|
canActivate: [permissionGuard(FOLDER_PERMISSIONS.UPDATE)],
|
|
771
|
-
loadComponent: () => import('./flusys-ng-storage-folder-form.component-
|
|
770
|
+
loadComponent: () => import('./flusys-ng-storage-folder-form.component-Up9luV7j.mjs').then((m) => m.FolderFormComponent),
|
|
772
771
|
},
|
|
773
772
|
],
|
|
774
773
|
},
|
|
@@ -779,17 +778,17 @@ const STORAGE_ROUTES = [
|
|
|
779
778
|
children: [
|
|
780
779
|
{
|
|
781
780
|
path: '',
|
|
782
|
-
loadComponent: () => import('./flusys-ng-storage-storage-config-list.component-
|
|
781
|
+
loadComponent: () => import('./flusys-ng-storage-storage-config-list.component-C-jaO7xD.mjs').then((m) => m.StorageConfigListComponent),
|
|
783
782
|
},
|
|
784
783
|
{
|
|
785
784
|
path: 'new',
|
|
786
785
|
canActivate: [permissionGuard(STORAGE_CONFIG_PERMISSIONS.CREATE)],
|
|
787
|
-
loadComponent: () => import('./flusys-ng-storage-storage-config-form.component-
|
|
786
|
+
loadComponent: () => import('./flusys-ng-storage-storage-config-form.component-CEW5gpSt.mjs').then((m) => m.StorageConfigFormComponent),
|
|
788
787
|
},
|
|
789
788
|
{
|
|
790
789
|
path: ':id',
|
|
791
790
|
canActivate: [permissionGuard(STORAGE_CONFIG_PERMISSIONS.UPDATE)],
|
|
792
|
-
loadComponent: () => import('./flusys-ng-storage-storage-config-form.component-
|
|
791
|
+
loadComponent: () => import('./flusys-ng-storage-storage-config-form.component-CEW5gpSt.mjs').then((m) => m.StorageConfigFormComponent),
|
|
793
792
|
},
|
|
794
793
|
],
|
|
795
794
|
},
|
|
@@ -808,83 +807,73 @@ const STORAGE_ROUTES = [
|
|
|
808
807
|
*/
|
|
809
808
|
class StorageContainerComponent {
|
|
810
809
|
permissionValidator = inject(PermissionValidatorService);
|
|
810
|
+
translateService = inject(TranslateService);
|
|
811
811
|
/** All available tabs with required permissions */
|
|
812
812
|
allTabs = [
|
|
813
813
|
{
|
|
814
814
|
id: 'files',
|
|
815
815
|
labelKey: 'storage.file.title',
|
|
816
|
-
icon: '
|
|
816
|
+
icon: 'file',
|
|
817
817
|
route: 'files',
|
|
818
818
|
permission: FILE_PERMISSIONS.READ,
|
|
819
819
|
},
|
|
820
820
|
{
|
|
821
821
|
id: 'folders',
|
|
822
822
|
labelKey: 'storage.folder.title',
|
|
823
|
-
icon: '
|
|
823
|
+
icon: 'folder',
|
|
824
824
|
route: 'folders',
|
|
825
825
|
permission: FOLDER_PERMISSIONS.READ,
|
|
826
826
|
},
|
|
827
827
|
{
|
|
828
828
|
id: 'configs',
|
|
829
829
|
labelKey: 'storage.config.title',
|
|
830
|
-
icon: '
|
|
830
|
+
icon: 'cog',
|
|
831
831
|
route: 'configs',
|
|
832
832
|
permission: STORAGE_CONFIG_PERMISSIONS.READ,
|
|
833
833
|
},
|
|
834
834
|
];
|
|
835
835
|
/** Visible tabs based on user permissions */
|
|
836
|
-
visibleTabs = computed(() => this.allTabs
|
|
836
|
+
visibleTabs = computed(() => this.allTabs
|
|
837
|
+
.filter((tab) => this.permissionValidator.hasPermission(tab.permission))
|
|
838
|
+
.map((tab) => ({
|
|
839
|
+
id: tab.id,
|
|
840
|
+
label: this.translateService.translate(tab.labelKey),
|
|
841
|
+
icon: tab.icon,
|
|
842
|
+
route: tab.route,
|
|
843
|
+
})), /* @ts-ignore */
|
|
837
844
|
...(ngDevMode ? [{ debugName: "visibleTabs" }] : /* istanbul ignore next */ []));
|
|
838
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
839
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
845
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: StorageContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
846
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: StorageContainerComponent, isStandalone: true, selector: "lib-storage-container", ngImport: i0, template: `
|
|
840
847
|
<div class="p-2 sm:p-4">
|
|
841
848
|
<div class="mb-4">
|
|
842
849
|
<h1 class="text-xl sm:text-2xl font-bold m-0">{{ 'storage.title' | translate }}</h1>
|
|
843
850
|
<p class="text-muted-color mt-1 text-sm sm:text-base">{{ 'storage.subtitle' | translate }}</p>
|
|
844
851
|
</div>
|
|
845
852
|
|
|
846
|
-
<
|
|
847
|
-
@for (tab of visibleTabs(); track tab.id) {
|
|
848
|
-
<a
|
|
849
|
-
[routerLink]="tab.route"
|
|
850
|
-
routerLinkActive="tab-active"
|
|
851
|
-
class="flex items-center gap-2 px-4 py-2 rounded-t-lg cursor-pointer transition-colors text-muted-color no-underline border-b-2 border-transparent -mb-px hover:bg-surface-hover [&.tab-active]:text-primary [&.tab-active]:border-primary [&.tab-active]:bg-surface-ground whitespace-nowrap shrink-0"
|
|
852
|
-
>
|
|
853
|
-
<i [class]="tab.icon"></i>
|
|
854
|
-
<span>{{ tab.labelKey | translate }}</span>
|
|
855
|
-
</a>
|
|
856
|
-
}
|
|
857
|
-
</div>
|
|
853
|
+
<lib-router-tabs [tabs]="visibleTabs()" class="mb-4" />
|
|
858
854
|
|
|
859
855
|
<router-outlet />
|
|
860
856
|
</div>
|
|
861
|
-
`, isInline: true,
|
|
857
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: RouterTabsComponent, selector: "lib-router-tabs", inputs: ["tabs"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
862
858
|
}
|
|
863
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
859
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: StorageContainerComponent, decorators: [{
|
|
864
860
|
type: Component,
|
|
865
|
-
args: [{
|
|
861
|
+
args: [{
|
|
862
|
+
selector: 'lib-storage-container',
|
|
863
|
+
imports: [RouterOutlet, TranslatePipe, RouterTabsComponent],
|
|
864
|
+
template: `
|
|
866
865
|
<div class="p-2 sm:p-4">
|
|
867
866
|
<div class="mb-4">
|
|
868
867
|
<h1 class="text-xl sm:text-2xl font-bold m-0">{{ 'storage.title' | translate }}</h1>
|
|
869
868
|
<p class="text-muted-color mt-1 text-sm sm:text-base">{{ 'storage.subtitle' | translate }}</p>
|
|
870
869
|
</div>
|
|
871
870
|
|
|
872
|
-
<
|
|
873
|
-
@for (tab of visibleTabs(); track tab.id) {
|
|
874
|
-
<a
|
|
875
|
-
[routerLink]="tab.route"
|
|
876
|
-
routerLinkActive="tab-active"
|
|
877
|
-
class="flex items-center gap-2 px-4 py-2 rounded-t-lg cursor-pointer transition-colors text-muted-color no-underline border-b-2 border-transparent -mb-px hover:bg-surface-hover [&.tab-active]:text-primary [&.tab-active]:border-primary [&.tab-active]:bg-surface-ground whitespace-nowrap shrink-0"
|
|
878
|
-
>
|
|
879
|
-
<i [class]="tab.icon"></i>
|
|
880
|
-
<span>{{ tab.labelKey | translate }}</span>
|
|
881
|
-
</a>
|
|
882
|
-
}
|
|
883
|
-
</div>
|
|
871
|
+
<lib-router-tabs [tabs]="visibleTabs()" class="mb-4" />
|
|
884
872
|
|
|
885
873
|
<router-outlet />
|
|
886
874
|
</div>
|
|
887
|
-
`,
|
|
875
|
+
`,
|
|
876
|
+
}]
|
|
888
877
|
}] });
|
|
889
878
|
|
|
890
879
|
var storageContainer_component = /*#__PURE__*/Object.freeze({
|