@flusys/ng-storage 5.4.1 → 6.0.0-beta.1
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-DnE4Whts.mjs → flusys-ng-storage-file-manager-form.component-V-ZDWkKU.mjs} +135 -153
- package/fesm2022/flusys-ng-storage-file-manager-form.component-V-ZDWkKU.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-file-manager-list.component-Go5Gqptd.mjs → flusys-ng-storage-file-manager-list.component-DqHH9lI0.mjs} +126 -97
- package/fesm2022/flusys-ng-storage-file-manager-list.component-DqHH9lI0.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-folder-form.component-BYOD0A_5.mjs → flusys-ng-storage-folder-form.component-Up9luV7j.mjs} +51 -35
- package/fesm2022/flusys-ng-storage-folder-form.component-Up9luV7j.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-folder-list.component-N6RjQQwv.mjs → flusys-ng-storage-folder-list.component-B52N1JaK.mjs} +60 -51
- package/fesm2022/flusys-ng-storage-folder-list.component-B52N1JaK.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-storage-config-form.component-BdpCYR3c.mjs → flusys-ng-storage-storage-config-form.component-CEW5gpSt.mjs} +99 -87
- package/fesm2022/flusys-ng-storage-storage-config-form.component-CEW5gpSt.mjs.map +1 -0
- package/fesm2022/{flusys-ng-storage-storage-config-list.component-CtsIrKSq.mjs → flusys-ng-storage-storage-config-list.component-C-jaO7xD.mjs} +62 -54
- package/fesm2022/flusys-ng-storage-storage-config-list.component-C-jaO7xD.mjs.map +1 -0
- package/fesm2022/flusys-ng-storage.mjs +95 -94
- package/fesm2022/flusys-ng-storage.mjs.map +1 -1
- package/package.json +10 -11
- package/types/flusys-ng-storage.d.ts +5 -11
- package/fesm2022/flusys-ng-storage-file-manager-form.component-DnE4Whts.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-file-manager-list.component-Go5Gqptd.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-folder-form.component-BYOD0A_5.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-folder-list.component-N6RjQQwv.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-storage-config-form.component-BdpCYR3c.mjs.map +0 -1
- package/fesm2022/flusys-ng-storage-storage-config-list.component-CtsIrKSq.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 = [
|
|
@@ -310,9 +309,12 @@ class BaseStoragePage {
|
|
|
310
309
|
appConfig = inject(APP_CONFIG);
|
|
311
310
|
companyContext = inject(LAYOUT_AUTH_STATE);
|
|
312
311
|
translateAdapter = inject(TranslateService);
|
|
313
|
-
isLoading = signal(false,
|
|
314
|
-
|
|
315
|
-
|
|
312
|
+
isLoading = signal(false, /* @ts-ignore */
|
|
313
|
+
...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
314
|
+
showCompanyInfo = computed(() => this.appConfig.enableCompanyFeature, /* @ts-ignore */
|
|
315
|
+
...(ngDevMode ? [{ debugName: "showCompanyInfo" }] : /* istanbul ignore next */ []));
|
|
316
|
+
currentCompanyName = computed(() => this.companyContext.currentCompanyInfo()?.name ?? DEFAULT_APP_NAME, /* @ts-ignore */
|
|
317
|
+
...(ngDevMode ? [{ debugName: "currentCompanyName" }] : /* istanbul ignore next */ []));
|
|
316
318
|
showSuccess(detail, summaryKey = 'shared.success') {
|
|
317
319
|
const summary = this.translateAdapter.translate(summaryKey);
|
|
318
320
|
this.messageService.add({ severity: 'success', summary, detail });
|
|
@@ -324,10 +326,10 @@ class BaseStoragePage {
|
|
|
324
326
|
navigateTo(path) {
|
|
325
327
|
this.router.navigate(path);
|
|
326
328
|
}
|
|
327
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
328
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
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 });
|
|
329
331
|
}
|
|
330
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
332
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseStoragePage, decorators: [{
|
|
331
333
|
type: Directive
|
|
332
334
|
}] });
|
|
333
335
|
class BaseStorageListPage {
|
|
@@ -338,15 +340,23 @@ class BaseStorageListPage {
|
|
|
338
340
|
destroyRef = inject(DestroyRef);
|
|
339
341
|
translateAdapter = inject(TranslateService);
|
|
340
342
|
companyContext = inject(LAYOUT_AUTH_STATE);
|
|
341
|
-
items = signal([],
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
343
|
+
items = signal([], /* @ts-ignore */
|
|
344
|
+
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
345
|
+
isLoading = signal(false, /* @ts-ignore */
|
|
346
|
+
...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
347
|
+
total = signal(0, /* @ts-ignore */
|
|
348
|
+
...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
349
|
+
pageSize = signal(50, /* @ts-ignore */
|
|
350
|
+
...(ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []));
|
|
351
|
+
first = signal(0, /* @ts-ignore */
|
|
352
|
+
...(ngDevMode ? [{ debugName: "first" }] : /* istanbul ignore next */ []));
|
|
353
|
+
currentPage = computed(() => Math.floor(this.first() / this.pageSize()), /* @ts-ignore */
|
|
354
|
+
...(ngDevMode ? [{ debugName: "currentPage" }] : /* istanbul ignore next */ []));
|
|
355
|
+
showCompanyInfo = computed(() => this.appConfig.enableCompanyFeature, /* @ts-ignore */
|
|
356
|
+
...(ngDevMode ? [{ debugName: "showCompanyInfo" }] : /* istanbul ignore next */ []));
|
|
348
357
|
totalRecords = this.total;
|
|
349
|
-
currentCompanyName = computed(() => this.companyContext.currentCompanyInfo()?.name ?? DEFAULT_APP_NAME,
|
|
358
|
+
currentCompanyName = computed(() => this.companyContext.currentCompanyInfo()?.name ?? DEFAULT_APP_NAME, /* @ts-ignore */
|
|
359
|
+
...(ngDevMode ? [{ debugName: "currentCompanyName" }] : /* istanbul ignore next */ []));
|
|
350
360
|
getDeleteConfirmMessage(item) {
|
|
351
361
|
const itemName = item.name;
|
|
352
362
|
const name = itemName ?? this.translateAdapter.translate('storage.delete.this.item');
|
|
@@ -398,7 +408,7 @@ class BaseStorageListPage {
|
|
|
398
408
|
this.confirmationService.confirm({
|
|
399
409
|
message: this.getDeleteConfirmMessage(item),
|
|
400
410
|
header: options?.header ?? this.t('shared.confirm.delete.header'),
|
|
401
|
-
icon: '
|
|
411
|
+
icon: 'exclamation-triangle',
|
|
402
412
|
acceptButtonStyleClass: 'p-button-danger',
|
|
403
413
|
accept: () => {
|
|
404
414
|
from(deleteApiCall(idGetter(item)))
|
|
@@ -417,7 +427,7 @@ class BaseStorageListPage {
|
|
|
417
427
|
this.confirmationService.confirm({
|
|
418
428
|
message: this.getDeleteConfirmMessage(item),
|
|
419
429
|
header: options?.header ?? this.t('shared.confirm.delete.header'),
|
|
420
|
-
icon: '
|
|
430
|
+
icon: 'exclamation-triangle',
|
|
421
431
|
acceptButtonStyleClass: 'p-button-danger',
|
|
422
432
|
accept: async () => {
|
|
423
433
|
const res = await deleteApiCall(idGetter(item));
|
|
@@ -433,10 +443,10 @@ class BaseStorageListPage {
|
|
|
433
443
|
t(key, variables) {
|
|
434
444
|
return this.translateAdapter?.translate(key, variables) ?? key;
|
|
435
445
|
}
|
|
436
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
437
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
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 });
|
|
438
448
|
}
|
|
439
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
449
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseStorageListPage, decorators: [{
|
|
440
450
|
type: Directive
|
|
441
451
|
}] });
|
|
442
452
|
|
|
@@ -454,10 +464,10 @@ class FileManagerApiService extends ApiResourceService {
|
|
|
454
464
|
createFiles(dtos) {
|
|
455
465
|
return this.http.post(`${this.baseUrl}/insert-many`, dtos);
|
|
456
466
|
}
|
|
457
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
458
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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' });
|
|
459
469
|
}
|
|
460
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
470
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FileManagerApiService, decorators: [{
|
|
461
471
|
type: Injectable,
|
|
462
472
|
args: [{ providedIn: 'root' }]
|
|
463
473
|
}], ctorParameters: () => [] });
|
|
@@ -473,10 +483,10 @@ class FolderApiService extends ApiResourceService {
|
|
|
473
483
|
constructor() {
|
|
474
484
|
super('folder', 'storage');
|
|
475
485
|
}
|
|
476
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
477
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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' });
|
|
478
488
|
}
|
|
479
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
489
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FolderApiService, decorators: [{
|
|
480
490
|
type: Injectable,
|
|
481
491
|
args: [{
|
|
482
492
|
providedIn: 'root',
|
|
@@ -494,10 +504,10 @@ class StorageConfigApiService extends ApiResourceService {
|
|
|
494
504
|
constructor() {
|
|
495
505
|
super('storage-config', 'storage');
|
|
496
506
|
}
|
|
497
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
498
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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' });
|
|
499
509
|
}
|
|
500
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
510
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: StorageConfigApiService, decorators: [{
|
|
501
511
|
type: Injectable,
|
|
502
512
|
args: [{
|
|
503
513
|
providedIn: 'root',
|
|
@@ -607,10 +617,10 @@ class UploadService extends BaseApiService {
|
|
|
607
617
|
const configId = this.resolveConfigId(storageConfigId);
|
|
608
618
|
return { ...data, ...(configId && { storageConfigId: configId }) };
|
|
609
619
|
}
|
|
610
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
611
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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' });
|
|
612
622
|
}
|
|
613
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
623
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: UploadService, decorators: [{
|
|
614
624
|
type: Injectable,
|
|
615
625
|
args: [{ providedIn: 'root' }]
|
|
616
626
|
}], ctorParameters: () => [] });
|
|
@@ -677,10 +687,10 @@ class FileProviderAdapter {
|
|
|
677
687
|
size: parseFloat(f.size) * 1024,
|
|
678
688
|
contentType: f.contentType,
|
|
679
689
|
});
|
|
680
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
681
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
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 });
|
|
682
692
|
}
|
|
683
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
693
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FileProviderAdapter, decorators: [{
|
|
684
694
|
type: Injectable
|
|
685
695
|
}] });
|
|
686
696
|
|
|
@@ -726,17 +736,17 @@ const STORAGE_ROUTES = [
|
|
|
726
736
|
children: [
|
|
727
737
|
{
|
|
728
738
|
path: '',
|
|
729
|
-
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),
|
|
730
740
|
},
|
|
731
741
|
{
|
|
732
742
|
path: 'new',
|
|
733
743
|
canActivate: [permissionGuard(FILE_PERMISSIONS.CREATE)],
|
|
734
|
-
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),
|
|
735
745
|
},
|
|
736
746
|
{
|
|
737
747
|
path: ':id',
|
|
738
748
|
canActivate: [permissionGuard(FILE_PERMISSIONS.UPDATE)],
|
|
739
|
-
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),
|
|
740
750
|
},
|
|
741
751
|
],
|
|
742
752
|
},
|
|
@@ -747,17 +757,17 @@ const STORAGE_ROUTES = [
|
|
|
747
757
|
children: [
|
|
748
758
|
{
|
|
749
759
|
path: '',
|
|
750
|
-
loadComponent: () => import('./flusys-ng-storage-folder-list.component-
|
|
760
|
+
loadComponent: () => import('./flusys-ng-storage-folder-list.component-B52N1JaK.mjs').then((m) => m.FolderListComponent),
|
|
751
761
|
},
|
|
752
762
|
{
|
|
753
763
|
path: 'new',
|
|
754
764
|
canActivate: [permissionGuard(FOLDER_PERMISSIONS.CREATE)],
|
|
755
|
-
loadComponent: () => import('./flusys-ng-storage-folder-form.component-
|
|
765
|
+
loadComponent: () => import('./flusys-ng-storage-folder-form.component-Up9luV7j.mjs').then((m) => m.FolderFormComponent),
|
|
756
766
|
},
|
|
757
767
|
{
|
|
758
768
|
path: ':id',
|
|
759
769
|
canActivate: [permissionGuard(FOLDER_PERMISSIONS.UPDATE)],
|
|
760
|
-
loadComponent: () => import('./flusys-ng-storage-folder-form.component-
|
|
770
|
+
loadComponent: () => import('./flusys-ng-storage-folder-form.component-Up9luV7j.mjs').then((m) => m.FolderFormComponent),
|
|
761
771
|
},
|
|
762
772
|
],
|
|
763
773
|
},
|
|
@@ -768,17 +778,17 @@ const STORAGE_ROUTES = [
|
|
|
768
778
|
children: [
|
|
769
779
|
{
|
|
770
780
|
path: '',
|
|
771
|
-
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),
|
|
772
782
|
},
|
|
773
783
|
{
|
|
774
784
|
path: 'new',
|
|
775
785
|
canActivate: [permissionGuard(STORAGE_CONFIG_PERMISSIONS.CREATE)],
|
|
776
|
-
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),
|
|
777
787
|
},
|
|
778
788
|
{
|
|
779
789
|
path: ':id',
|
|
780
790
|
canActivate: [permissionGuard(STORAGE_CONFIG_PERMISSIONS.UPDATE)],
|
|
781
|
-
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),
|
|
782
792
|
},
|
|
783
793
|
],
|
|
784
794
|
},
|
|
@@ -797,82 +807,73 @@ const STORAGE_ROUTES = [
|
|
|
797
807
|
*/
|
|
798
808
|
class StorageContainerComponent {
|
|
799
809
|
permissionValidator = inject(PermissionValidatorService);
|
|
810
|
+
translateService = inject(TranslateService);
|
|
800
811
|
/** All available tabs with required permissions */
|
|
801
812
|
allTabs = [
|
|
802
813
|
{
|
|
803
814
|
id: 'files',
|
|
804
815
|
labelKey: 'storage.file.title',
|
|
805
|
-
icon: '
|
|
816
|
+
icon: 'file',
|
|
806
817
|
route: 'files',
|
|
807
818
|
permission: FILE_PERMISSIONS.READ,
|
|
808
819
|
},
|
|
809
820
|
{
|
|
810
821
|
id: 'folders',
|
|
811
822
|
labelKey: 'storage.folder.title',
|
|
812
|
-
icon: '
|
|
823
|
+
icon: 'folder',
|
|
813
824
|
route: 'folders',
|
|
814
825
|
permission: FOLDER_PERMISSIONS.READ,
|
|
815
826
|
},
|
|
816
827
|
{
|
|
817
828
|
id: 'configs',
|
|
818
829
|
labelKey: 'storage.config.title',
|
|
819
|
-
icon: '
|
|
830
|
+
icon: 'cog',
|
|
820
831
|
route: 'configs',
|
|
821
832
|
permission: STORAGE_CONFIG_PERMISSIONS.READ,
|
|
822
833
|
},
|
|
823
834
|
];
|
|
824
835
|
/** Visible tabs based on user permissions */
|
|
825
|
-
visibleTabs = computed(() => this.allTabs
|
|
826
|
-
|
|
827
|
-
|
|
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 */
|
|
844
|
+
...(ngDevMode ? [{ debugName: "visibleTabs" }] : /* istanbul ignore next */ []));
|
|
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: `
|
|
828
847
|
<div class="p-2 sm:p-4">
|
|
829
848
|
<div class="mb-4">
|
|
830
849
|
<h1 class="text-xl sm:text-2xl font-bold m-0">{{ 'storage.title' | translate }}</h1>
|
|
831
850
|
<p class="text-muted-color mt-1 text-sm sm:text-base">{{ 'storage.subtitle' | translate }}</p>
|
|
832
851
|
</div>
|
|
833
852
|
|
|
834
|
-
<
|
|
835
|
-
@for (tab of visibleTabs(); track tab.id) {
|
|
836
|
-
<a
|
|
837
|
-
[routerLink]="tab.route"
|
|
838
|
-
routerLinkActive="tab-active"
|
|
839
|
-
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"
|
|
840
|
-
>
|
|
841
|
-
<i [class]="tab.icon"></i>
|
|
842
|
-
<span>{{ tab.labelKey | translate }}</span>
|
|
843
|
-
</a>
|
|
844
|
-
}
|
|
845
|
-
</div>
|
|
853
|
+
<lib-router-tabs [tabs]="visibleTabs()" class="mb-4" />
|
|
846
854
|
|
|
847
855
|
<router-outlet />
|
|
848
856
|
</div>
|
|
849
|
-
`, 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" }] });
|
|
850
858
|
}
|
|
851
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
859
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: StorageContainerComponent, decorators: [{
|
|
852
860
|
type: Component,
|
|
853
|
-
args: [{
|
|
861
|
+
args: [{
|
|
862
|
+
selector: 'lib-storage-container',
|
|
863
|
+
imports: [RouterOutlet, TranslatePipe, RouterTabsComponent],
|
|
864
|
+
template: `
|
|
854
865
|
<div class="p-2 sm:p-4">
|
|
855
866
|
<div class="mb-4">
|
|
856
867
|
<h1 class="text-xl sm:text-2xl font-bold m-0">{{ 'storage.title' | translate }}</h1>
|
|
857
868
|
<p class="text-muted-color mt-1 text-sm sm:text-base">{{ 'storage.subtitle' | translate }}</p>
|
|
858
869
|
</div>
|
|
859
870
|
|
|
860
|
-
<
|
|
861
|
-
@for (tab of visibleTabs(); track tab.id) {
|
|
862
|
-
<a
|
|
863
|
-
[routerLink]="tab.route"
|
|
864
|
-
routerLinkActive="tab-active"
|
|
865
|
-
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"
|
|
866
|
-
>
|
|
867
|
-
<i [class]="tab.icon"></i>
|
|
868
|
-
<span>{{ tab.labelKey | translate }}</span>
|
|
869
|
-
</a>
|
|
870
|
-
}
|
|
871
|
-
</div>
|
|
871
|
+
<lib-router-tabs [tabs]="visibleTabs()" class="mb-4" />
|
|
872
872
|
|
|
873
873
|
<router-outlet />
|
|
874
874
|
</div>
|
|
875
|
-
`,
|
|
875
|
+
`,
|
|
876
|
+
}]
|
|
876
877
|
}] });
|
|
877
878
|
|
|
878
879
|
var storageContainer_component = /*#__PURE__*/Object.freeze({
|