@yomotech/view-toolkit 0.0.8 → 0.0.11
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.
|
@@ -797,7 +797,7 @@ class CardComponent {
|
|
|
797
797
|
imageDetails = new EventEmitter();
|
|
798
798
|
onPageSizeChange = new EventEmitter();
|
|
799
799
|
onPageChange = new EventEmitter();
|
|
800
|
-
cardPerRow = "
|
|
800
|
+
cardPerRow = "md:col-6 lg:col-";
|
|
801
801
|
isLoading = false;
|
|
802
802
|
layoutSchemaCopy = {};
|
|
803
803
|
headerSchemaCopy = {};
|
|
@@ -817,7 +817,7 @@ class CardComponent {
|
|
|
817
817
|
this.cardPerRow = "col-";
|
|
818
818
|
}
|
|
819
819
|
else {
|
|
820
|
-
this.cardPerRow = "
|
|
820
|
+
this.cardPerRow = "md:col-6 lg:col-";
|
|
821
821
|
}
|
|
822
822
|
}
|
|
823
823
|
ngOnChanges(changes) {
|
|
@@ -2412,8 +2412,6 @@ class Couchdb {
|
|
|
2412
2412
|
async getFileContentFromCouchDb(couchDbName, filePath) {
|
|
2413
2413
|
try {
|
|
2414
2414
|
const dbName = couchDbName;
|
|
2415
|
-
console.log('dbName: ', dbName);
|
|
2416
|
-
console.log('filePath: ', filePath);
|
|
2417
2415
|
const docId = filePath?.trim();
|
|
2418
2416
|
if (!docId) {
|
|
2419
2417
|
console.error('Missing file path');
|
|
@@ -2504,12 +2502,23 @@ class Couchdb {
|
|
|
2504
2502
|
}
|
|
2505
2503
|
async buildTenantHeaders() {
|
|
2506
2504
|
const tenantKey = await this.utilityService.getStorage('tenantKey');
|
|
2507
|
-
|
|
2508
|
-
|
|
2505
|
+
const tenantName = await this.utilityService.getStorage('tenantName');
|
|
2506
|
+
if (tenantKey) {
|
|
2507
|
+
if (typeof tenantKey !== 'string' || !tenantKey.trim()) {
|
|
2508
|
+
throw new Error('Missing tenantKey');
|
|
2509
|
+
}
|
|
2510
|
+
return {
|
|
2511
|
+
'X-Tenant-Key': tenantKey.trim(),
|
|
2512
|
+
};
|
|
2513
|
+
}
|
|
2514
|
+
else {
|
|
2515
|
+
if (typeof tenantName !== 'string' || !tenantName.trim()) {
|
|
2516
|
+
throw new Error('Missing tenantName');
|
|
2517
|
+
}
|
|
2518
|
+
return {
|
|
2519
|
+
'X-Tenant': tenantName.trim(),
|
|
2520
|
+
};
|
|
2509
2521
|
}
|
|
2510
|
-
return {
|
|
2511
|
-
'X-Tenant-Key': tenantKey.trim(),
|
|
2512
|
-
};
|
|
2513
2522
|
}
|
|
2514
2523
|
async getImageSrcFromCouchDb(couchDbName, filePath) {
|
|
2515
2524
|
const dbName = couchDbName;
|
|
@@ -3011,24 +3020,27 @@ class SideMenuComponent {
|
|
|
3011
3020
|
}
|
|
3012
3021
|
}
|
|
3013
3022
|
async setSettingImages() {
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3023
|
+
if (this.settings && this.settings.length > 0) {
|
|
3024
|
+
const tasks = [];
|
|
3025
|
+
console.log('this.settings: ', this.settings);
|
|
3026
|
+
for (const menu of this.settings?.submenu) {
|
|
3027
|
+
if (menu?.submenu?.length) {
|
|
3028
|
+
for (const childMenu of menu.submenu) {
|
|
3029
|
+
if (childMenu.options && childMenu.options.setImageUrl) {
|
|
3030
|
+
tasks.push((async () => {
|
|
3031
|
+
try {
|
|
3032
|
+
childMenu.icon = await this.couchdbService.getFileContentFromCouchDb(`${this.tenantName}_${this.projectSeleted}`, `${childMenu.icon}`);
|
|
3033
|
+
}
|
|
3034
|
+
catch (err) {
|
|
3035
|
+
console.error("Failed to fetch icon:", err);
|
|
3036
|
+
}
|
|
3037
|
+
})());
|
|
3038
|
+
}
|
|
3027
3039
|
}
|
|
3028
3040
|
}
|
|
3029
3041
|
}
|
|
3042
|
+
await Promise.all(tasks);
|
|
3030
3043
|
}
|
|
3031
|
-
await Promise.all(tasks);
|
|
3032
3044
|
this.settingMenu = JSON.parse(JSON.stringify(this.settings));
|
|
3033
3045
|
}
|
|
3034
3046
|
isUrl(value) {
|