diff --git a/API/Backend/Config/routes/configs.js b/API/Backend/Config/routes/configs.js
index 5706a5a0b..7de41ea10 100644
--- a/API/Backend/Config/routes/configs.js
+++ b/API/Backend/Config/routes/configs.js
@@ -596,7 +596,7 @@ router.get("/missions", function (req, res, next) {
let allMissions = [];
for (let i = 0; i < missions.length; i++)
allMissions.push(missions[i].DISTINCT);
- allMissions.sort();
+ allMissions.sort((a, b) => a.localeCompare(b, undefined, { sensitivity: "base" }));
res.send({ status: "success", missions: allMissions });
return null;
})
diff --git a/configure/src/core/Configure.js b/configure/src/core/Configure.js
index 8d9a97dbc..aab4e4817 100644
--- a/configure/src/core/Configure.js
+++ b/configure/src/core/Configure.js
@@ -36,7 +36,10 @@ export default function Configure() {
"missions",
null,
(res) => {
- dispatch(setMissions(res.missions));
+ const missions = (res?.missions || [])
+ .slice()
+ .sort((a, b) => a.localeCompare(b, undefined, { sensitivity: "base" }));
+ dispatch(setMissions(missions));
},
(res) => {
dispatch(
diff --git a/configure/src/core/Maker.js b/configure/src/core/Maker.js
index 05188e747..6dea942ba 100644
--- a/configure/src/core/Maker.js
+++ b/configure/src/core/Maker.js
@@ -249,11 +249,26 @@ const getComponent = (
inlineHelp,
value,
forceField,
- dispatch
+ dispatch,
+ fieldDefaults
) => {
const directConf =
layer == null ? (tool == null ? configuration : tool) : layer;
let inner;
+ let disabled = false;
+ if (com.disableSwitch) {
+ let switchVal = getIn(configuration, com.disableSwitch, null);
+ if (switchVal == null) {
+ // fall back to defaultChecked of the referenced switch if available
+ const def = fieldDefaults?.[com.disableSwitch];
+ if (def != null && typeof def.defaultChecked === "boolean") {
+ switchVal = def.defaultChecked;
+ } else {
+ switchVal = false;
+ }
+ }
+ disabled = !switchVal;
+ }
switch (com.type) {
case "gap":
return (
@@ -270,6 +285,7 @@ const getComponent = (
label={com.name}
variant="filled"
size="small"
+ disabled={disabled}
inputProps={{
autoComplete: "off",
}}
@@ -309,6 +325,7 @@ const getComponent = (
label={com.name}
variant="filled"
size="small"
+ disabled={disabled}
inputProps={{
autoComplete: "off",
}}
@@ -341,6 +358,7 @@ const getComponent = (
className={c.button}
variant="outlined"
startIcon={}
+ disabled={disabled}
onClick={() => {
if (com.action === "tile-populate-from-x") {
tilePopulateFromX(
@@ -395,6 +413,75 @@ const getComponent = (
);
}
);
+ } else if (com.action === "projection-populate-from-x") {
+ const inputPath = getIn(configuration, "projection.xmlpath", "");
+ if (inputPath == null || inputPath === "") {
+ dispatch(
+ setSnackBarText({
+ text: "Please provide a path or URL to tilemapresource.xml or an ArcGIS MapServer (?f=pjson).",
+ severity: "error",
+ })
+ );
+ return;
+ }
+
+ const missionPath = `Missions/${configuration.msv.mission}/`;
+ projectionPopulateFromX(inputPath, missionPath)
+ .then((vals) => {
+ const { bounds, origin, reszoomlevel, resunitsperpixel } = vals;
+
+ let conf = updateConfiguration(
+ "projection.bounds",
+ bounds || getIn(configuration, "projection.bounds", null),
+ null,
+ true
+ );
+ if (origin != null) {
+ conf = updateConfiguration(
+ "projection.origin",
+ origin,
+ null,
+ true,
+ conf
+ );
+ }
+ if (reszoomlevel != null) {
+ conf = updateConfiguration(
+ "projection.reszoomlevel",
+ reszoomlevel,
+ null,
+ true,
+ conf
+ );
+ }
+ if (resunitsperpixel != null) {
+ conf = updateConfiguration(
+ "projection.resunitsperpixel",
+ resunitsperpixel,
+ null,
+ true,
+ conf
+ );
+ }
+
+ // Final dispatch
+ updateConfiguration("projection.bounds", bounds, null, false, conf);
+
+ dispatch(
+ setSnackBarText({
+ text: "Projection fields populated.",
+ severity: "success",
+ })
+ );
+ })
+ .catch((err) => {
+ dispatch(
+ setSnackBarText({
+ text: `Failed to populate projection fields: ${err?.message || err}`,
+ severity: "error",
+ })
+ );
+ });
}
}}
>
@@ -428,6 +515,7 @@ const getComponent = (
label={com.name}
variant="filled"
size="small"
+ disabled={disabled}
inputProps={{
autoComplete: "off",
}}
@@ -517,6 +605,7 @@ const getComponent = (
label={com.name}
variant="filled"
size="small"
+ disabled={disabled}
inputProps={{
autoComplete: "off",
}}
@@ -559,6 +648,7 @@ const getComponent = (
{com.name}