Skip to content

Commit a81768b

Browse files
committed
Merge branch 'development' into explore-openapi
2 parents 798576a + 2e3d82b commit a81768b

File tree

11 files changed

+62
-20
lines changed

11 files changed

+62
-20
lines changed

API/Backend/Config/routes/configs.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -668,18 +668,24 @@ function openWebSocket(body, response, info, forceClientUpdate) {
668668
}
669669

670670
const port = parseInt(process.env.PORT || "8888", 10);
671-
const path = `ws://localhost:${port}${
671+
const path = `${
672+
process.env.HTTPS == "true" ? "wss" : "ws"
673+
}://localhost:${port}${
672674
process.env.WEBSOCKET_ROOT_PATH || process.env.ROOT_PATH || ""
673675
}/`;
674-
const ws = new WebSocket(path);
675-
ws.onopen = function () {
676-
const data = {
677-
info,
678-
body,
679-
forceClientUpdate,
676+
try {
677+
const ws = new WebSocket(path);
678+
ws.onopen = function () {
679+
const data = {
680+
info,
681+
body,
682+
forceClientUpdate,
683+
};
684+
ws.send(JSON.stringify(data));
680685
};
681-
ws.send(JSON.stringify(data));
682-
};
686+
} catch (err) {
687+
console.log(err);
688+
}
683689
}
684690

685691
// === Quick API Functions ===

API/Backend/Draw/routes/draw.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ const clipOver = function (
204204
historyIndex: lastHistory[0].history_id + 1,
205205
history: lastHistory[0].history,
206206
};
207-
} else return { historyIndex: 0, history: [] };
207+
} else return { historyIndex: 0, history: null };
208208
})
209209
.then((historyObj) => {
210210
let history = historyObj.history;
@@ -335,7 +335,7 @@ const clipUnder = function (
335335
historyIndex: lastHistory[0].history_id + 1,
336336
history: lastHistory[0].history,
337337
};
338-
} else return { historyIndex: 0, history: [] };
338+
} else return { historyIndex: 0, history: null };
339339
})
340340
.then((historyObj) => {
341341
let history = historyObj.history;

configure/src/core/Maker.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ const getComponent = (
256256
}}
257257
value={value != null ? value : getIn(directConf, com.field, "")}
258258
onChange={(e) => {
259+
updateConfiguration(forceField || com.field, e.target.value, layer);
260+
}}
261+
onBlur={(e) => {
259262
let v = e.target.value;
260263
// remove surrounding whitespace, " hi " -> "hi"
261264
if (typeof v === "string") v = v.trim();
@@ -280,6 +283,39 @@ const getComponent = (
280283
)}
281284
</div>
282285
);
286+
case "textnotrim":
287+
inner = (
288+
<TextField
289+
className={c.text}
290+
label={com.name}
291+
variant="filled"
292+
size="small"
293+
inputProps={{
294+
autoComplete: "off",
295+
}}
296+
value={value != null ? value : getIn(directConf, com.field, "")}
297+
onChange={(e) => {
298+
updateConfiguration(forceField || com.field, e.target.value, layer);
299+
}}
300+
/>
301+
);
302+
return (
303+
<div>
304+
{inlineHelp ? (
305+
<>
306+
{inner}
307+
<div
308+
className={c.subtitle2}
309+
dangerouslySetInnerHTML={{ __html: com.description || "" }}
310+
></div>
311+
</>
312+
) : (
313+
<Tooltip title={com.description || ""} placement="top" arrow>
314+
{inner}
315+
</Tooltip>
316+
)}
317+
</div>
318+
);
283319
case "button":
284320
inner = (
285321
<Button

configure/src/metaconfigs/layer-data-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"field": "name",
2828
"name": "Layer Name",
2929
"description": "",
30-
"type": "text",
30+
"type": "textnotrim",
3131
"width": 8
3232
},
3333
{

configure/src/metaconfigs/layer-header-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"field": "name",
2828
"name": "Layer Name",
2929
"description": "",
30-
"type": "text",
30+
"type": "textnotrim",
3131
"width": 8
3232
}
3333
]

configure/src/metaconfigs/layer-model-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"field": "name",
2828
"name": "Layer Name",
2929
"description": "A display name for the layer.",
30-
"type": "text",
30+
"type": "textnotrim",
3131
"width": 6
3232
},
3333
{

configure/src/metaconfigs/layer-query-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"field": "name",
2828
"name": "Layer Name",
2929
"description": "A display name for the layer.",
30-
"type": "text",
30+
"type": "textnotrim",
3131
"width": 6
3232
},
3333
{

configure/src/metaconfigs/layer-tile-config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"field": "name",
2828
"name": "Layer Name",
2929
"description": "",
30-
"type": "text",
30+
"type": "textnotrim",
3131
"width": 4
3232
},
3333
{
@@ -201,7 +201,7 @@
201201
"field": "cogUnits",
202202
"name": "Units",
203203
"description": "Units string by which to suffix values. For instance if the units are meters, use 'm' so that values are displayed as '100m'.",
204-
"type": "text",
204+
"type": "textnotrim",
205205
"width": 2
206206
},
207207
{

configure/src/metaconfigs/layer-vector-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"field": "name",
2828
"name": "Layer Name",
2929
"description": "A display name for the layer.",
30-
"type": "text",
30+
"type": "textnotrim",
3131
"width": 6
3232
},
3333
{

configure/src/metaconfigs/layer-vectortile-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"field": "name",
2828
"name": "Layer Name",
2929
"description": "A display name for the layer.",
30-
"type": "text",
30+
"type": "textnotrim",
3131
"width": 6
3232
},
3333
{

0 commit comments

Comments
 (0)