Skip to content

Commit 499fac6

Browse files
committed
fixes
1 parent 5a81780 commit 499fac6

File tree

12 files changed

+38
-305
lines changed

12 files changed

+38
-305
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ _locks
4040
_logs
4141
docs
4242
/.vscode
43+
44+
**/debug.log

debug.log

Lines changed: 0 additions & 246 deletions
This file was deleted.

src/app/Services/API/Requests/debug.log

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/app/Services/API/Requests/index.ts

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
BACKEND_API_URL,
66
BACKEND_WMS_BASE_URL,
77
} from '../../../../utils/constants';
8+
import { NoEncryption } from '@mui/icons-material';
89

910
export interface AuthResponse {
1011
[key: string]: {};
@@ -37,7 +38,7 @@ export class RequestApi extends Http {
3738
downloadScreenshot(href: string, filename: string, lang: string) {
3839
href = href.replaceAll(
3940
'http://localhost:3000',
40-
'https://arpav.geobeyond.dev',
41+
'https://clima.arpa.veneto.it',
4142
);
4243
return (
4344
this.instance
@@ -71,20 +72,24 @@ export class RequestApi extends Http {
7172
);
7273
}
7374
getCapabilities(wms) {
74-
const fullUrl =
75-
BACKEND_WMS_BASE_URL +
76-
'/' +
77-
wms +
78-
'?SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.3.0&verbose=true';
75+
if (wms) {
76+
const fullUrl =
77+
BACKEND_WMS_BASE_URL +
78+
'/' +
79+
wms +
80+
'?SERVICE=WMS&REQUEST=GetCapabilities&VERSION=1.3.0&verbose=true';
7981

80-
return this.instance
81-
.get<string>(fullUrl, {
82-
responseType: 'text',
83-
})
84-
.then(x => {
85-
localStorage.setItem(fullUrl, JSON.stringify(x));
86-
return x;
87-
});
82+
return this.instance
83+
.get<string>(fullUrl, {
84+
responseType: 'text',
85+
})
86+
.then(x => {
87+
localStorage.setItem(fullUrl, JSON.stringify(x));
88+
return x;
89+
});
90+
} else {
91+
return Promise.resolve("");
92+
}
8893
}
8994

9095
/**
@@ -985,12 +990,12 @@ export class RequestApi extends Http {
985990

986991
public pushUserData = (identifier, userData) => {
987992
this.instance
988-
.get<any> (
993+
.get<any>(
989994
`${BACKEND_API_URL}/coverages/time-series-download-request/${identifier}`,
990995
{ params: userData },
991996
)
992997
.then(data => {
993998
console.log(data);
994999
});
995-
}
1000+
};
9961001
}

src/app/components/DownloadDataDialog/debug.log

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/app/components/Map/debug.log

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/app/components/MapMenuBar/debug.log

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/app/components/MultiRadioSelect/debug.log

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/app/components/TimeSeriesDialog/DownloadForm.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,15 @@ export const DownloadForm = props => {
5757
};
5858

5959
const pushUserData = () => {
60-
api.pushUserData(data.current.series[0].info.coverage_identifier, {
61-
...userData,
62-
...{ coords: data.current.series[0].info.location },
63-
});
60+
let sname = api.pushUserData(
61+
data.current.series[0].info.coverage_identifier
62+
? data.current.series[0].info.coverage_identifier
63+
: data.current.series[0].info.series_identifier,
64+
{
65+
...userData,
66+
...{ coords: data.current.series[0].info.location },
67+
},
68+
);
6469
};
6570

6671
const refreshSeriesObject =
@@ -244,7 +249,10 @@ export const DownloadForm = props => {
244249
const pu = PapaParse.unparse(
245250
ffdata.values.slice(filterParams.start, filterParams.end + 1),
246251
);
247-
z.file(ffdata.name.replaceAll('*', '_').replaceAll(':','_') + '.csv', pu);
252+
z.file(
253+
ffdata.name.replaceAll('*', '_').replaceAll(':', '_') + '.csv',
254+
pu,
255+
);
248256
}
249257
}
250258
}
@@ -293,7 +301,7 @@ export const DownloadForm = props => {
293301
filterParams.end + 1,
294302
);
295303
z.file(
296-
ffdata.name.replaceAll('*', '_').replaceAll(':','_') + '.json',
304+
ffdata.name.replaceAll('*', '_').replaceAll(':', '_') + '.json',
297305
JSON.stringify(ffdata),
298306
);
299307
}

src/app/components/TimeSeriesDialog/debug.log

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)