@yomotech/view-toolkit 0.0.28 → 0.0.30
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.
|
@@ -2635,6 +2635,7 @@ class Couchdb {
|
|
|
2635
2635
|
async buildTenantHeaders() {
|
|
2636
2636
|
const tenantKey = await this.utilityService.getStorage('tenantKey');
|
|
2637
2637
|
const tenantName = await this.utilityService.getStorage('tenantName');
|
|
2638
|
+
const selectedTenant = await this.utilityService.getLocalStorage('selectedTenant');
|
|
2638
2639
|
if (tenantKey) {
|
|
2639
2640
|
if (typeof tenantKey !== 'string' || !tenantKey.trim()) {
|
|
2640
2641
|
throw new Error('Missing tenantKey');
|
|
@@ -2644,11 +2645,11 @@ class Couchdb {
|
|
|
2644
2645
|
};
|
|
2645
2646
|
}
|
|
2646
2647
|
else {
|
|
2647
|
-
if (typeof tenantName !== 'string' || !tenantName.trim()) {
|
|
2648
|
+
if (typeof tenantName !== 'string' || !tenantName.trim() || !tenantName.trim()) {
|
|
2648
2649
|
throw new Error('Missing tenantName');
|
|
2649
2650
|
}
|
|
2650
2651
|
return {
|
|
2651
|
-
'X-Tenant': tenantName.trim(),
|
|
2652
|
+
'X-Tenant': tenantName ? tenantName.trim() : selectedTenant.trim(),
|
|
2652
2653
|
};
|
|
2653
2654
|
}
|
|
2654
2655
|
}
|
|
@@ -2707,9 +2708,12 @@ class ConfigService {
|
|
|
2707
2708
|
tenantName = await this.utilityService.getStorage('tenantName');
|
|
2708
2709
|
}
|
|
2709
2710
|
if (tenantName) {
|
|
2711
|
+
console.log('tenantName-44: ', tenantName);
|
|
2712
|
+
console.log('projectName-55: ', projectName);
|
|
2710
2713
|
this.config = await this.couchdbService.getFileContentFromCouchDb(`${tenantName}_${projectName}`, 'environments/environment.json');
|
|
2711
2714
|
}
|
|
2712
2715
|
else {
|
|
2716
|
+
console.log('projectName--66: ', projectName);
|
|
2713
2717
|
this.config = await this.couchdbService.getFileContentFromCouchDb(`${projectName}`, 'environments/environment.json');
|
|
2714
2718
|
}
|
|
2715
2719
|
if (this.platform.ANDROID || this.platform.IOS) {
|
|
@@ -2768,9 +2772,12 @@ class ConfigService {
|
|
|
2768
2772
|
}
|
|
2769
2773
|
let env = {};
|
|
2770
2774
|
if (tenantName) {
|
|
2775
|
+
console.log('tenantName-11: ', tenantName);
|
|
2776
|
+
console.log('projectName-22: ', projectName);
|
|
2771
2777
|
env = await this.couchdbService.getFileContentFromCouchDb(`${tenantName}_${projectName}`, 'environments/environment.json');
|
|
2772
2778
|
}
|
|
2773
2779
|
else {
|
|
2780
|
+
console.log('projectName--33: ', projectName);
|
|
2774
2781
|
env = await this.couchdbService.getFileContentFromCouchDb(`${projectName}`, 'environments/environment.json');
|
|
2775
2782
|
}
|
|
2776
2783
|
if (env?.environment?.login.type === "keycloak") {
|