Skip to content

Commit 45e39c5

Browse files
committed
* added "defaultApp" custom field to config.json. This field can be used to specify custom path for defaultApp if mdx2json doesn't set up properly or different path needed (#449)
1 parent cf6ba88 commit 45e39c5

File tree

8 files changed

+26
-13
lines changed

8 files changed

+26
-13
lines changed

angular.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,16 @@
3131
"assets": [
3232
"src/assets",
3333
"src/favicon.ico",
34-
"src/config.json",
3534
"src/changelog.md",
3635
"src/manifest.webmanifest",
3736
{
3837
"glob": "*",
3938
"input": "dist-addons/src/addons",
4039
"output": "addons"
40+
},
41+
{
42+
"glob": "**/*",
43+
"input": "public"
4144
}
4245
],
4346
"externalDependencies": [
@@ -119,13 +122,16 @@
119122
"inlineStyleLanguage": "scss",
120123
"assets": [
121124
"src/favicon.ico",
122-
"src/config.json",
123125
"src/changelog.md",
124126
"src/manifest.webmanifest",
125127
{
126128
"glob": "*",
127129
"input": "dist-addons/src/addons",
128130
"output": "addons"
131+
},
132+
{
133+
"glob": "**/*",
134+
"input": "public"
129135
}
130136
],
131137
"styles": [

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "deep-see-web",
3-
"version": "4.0.18",
3+
"version": "4.0.19",
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve --proxy-config=proxy.conf.samples-bi.js",

proxy.conf.samples-bi.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
module.exports = {
2-
"/config.json": {
3-
"target": "https://samples-bi-demo.demo.community.intersystems.com/dsw/",
4-
"secure": false,
5-
"logLevel": "debug",
6-
"changeOrigin": true
7-
},
82
"/configs": {
93
"target": "https://samples-bi-demo.demo.community.intersystems.com/dsw/",
104
"secure": false,

config.json renamed to public/config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"namespace": "MDX2JSON",
33
"endpoints": {
44
"mdx2json": "MDX2JSON"
5-
}
5+
},
6+
"defaultApp": ""
67
}

src/app/components/screens/dashboard-screen/dashboard-screen.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,8 @@ export class DashboardScreenComponent extends DashboardEditingClass implements O
621621
mdx = lpt._dataSourcesStack[lpt._dataSourcesStack.length - 1].BASIC_MDX + lpt.dataSource.FILTERS;
622622
}
623623
const folder = this.ss.serverSettings.DefaultApp || ('/csp/' + CURRENT_NAMESPACE);
624-
const url = folder + '/_DeepSee.UI.MDXExcel.zen?MDX=' + encodeURIComponent(mdx || '');
624+
const confPath = this.ds.configDefaultApp;
625+
const url = (confPath || folder) + '/_DeepSee.UI.MDXExcel.zen?MDX=' + encodeURIComponent(mdx || '');
625626
window.open(url, '_blank');
626627
this.hideContextMenu();
627628
return;
@@ -772,7 +773,8 @@ export class DashboardScreenComponent extends DashboardEditingClass implements O
772773
}
773774
const folder = this.ss.serverSettings.DefaultApp || '/csp/' + CURRENT_NAMESPACE;
774775
const filters = this.fs.getFiltersUrlString(w.name, false, '\t', '\n');
775-
let url = folder + '/_DeepSee.UI.Dialog.Analyzer.zen?&PIVOT=' + encodeURIComponent(w.dataSource);
776+
const confPath = this.ds.configDefaultApp;
777+
let url = (confPath || folder) + '/_DeepSee.UI.Dialog.Analyzer.zen?&PIVOT=' + encodeURIComponent(w.dataSource);
776778
if (filters) {
777779
url += '&FILTERSTATE=' + filters;
778780
}

src/app/components/widgets/map-widget/map-widget.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,8 @@ export class MapWidgetComponent extends BaseWidget implements OnInit, OnDestroy,
579579

580580
fileName = this.getDataPropValue('polygonFile') || this.getDataPropValue('coordsJsFile') || fileName;
581581
const folder = this.ss.serverSettings.DefaultApp || '/csp';
582-
const url = folder + '/' + fileName;
582+
const confPath = this.ds.configDefaultApp;
583+
const url = (confPath || folder) + '/' + fileName;
583584
const isJSON = fileName.split('.').pop()?.toString() === 'json';
584585
const p = isJSON ? this.ds.getJSONFile(url) : this.ds.getFile(url);
585586

src/app/services/data.service.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export interface ITileInfo {
5252
providedIn: 'root'
5353
})
5454
export class DataService {
55+
private mainConfig: any;
5556
public firstRun = true;
5657
public dashboardList = new Map<string, string>();
5758
public username = '';
@@ -76,6 +77,10 @@ export class DataService {
7677
private es: ErrorService) {
7778
}
7879

80+
public get configDefaultApp() {
81+
return this.mainConfig?.defaultApp || '';
82+
}
83+
7984
public get url() {
8085
let prefix = '';
8186
const redirect = localStorage.getItem('connectorRedirect');
@@ -350,6 +355,7 @@ export class DataService {
350355
return this.http.get('config.json', {headers: new HttpHeaders({withCredentials: 'false'})})
351356
.toPromise()
352357
.then((conf: any) => {
358+
this.mainConfig = conf;
353359
try {
354360
if (conf && conf.endpoints && conf.endpoints.mdx2json) {
355361
MDX2JSON = conf.endpoints.mdx2json.replace(/\//ig, '').replace(/ /g, '');

src/changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#### 4.0.19
2+
* added "defaultApp" custom field to config.json. This field can be used to specify custom path for defaultApp if mdx2json doesn't set up properly or different path needed
3+
14
#### 4.0.18
25
* fixed infinite loading for mobile
36

0 commit comments

Comments
 (0)