Skip to content

Commit

Permalink
#464 More new config fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tariqksoliman committed May 31, 2024
1 parent 5be6153 commit 2762ca3
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 33 deletions.
2 changes: 1 addition & 1 deletion configure/src/components/Main/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const useStyles = makeStyles((theme) => ({
Main: {
width: "100%",
height: "100%",
background: theme.palette.swatches.grey[900],
background: theme.palette.swatches.grey[1000],
boxShadow: `inset 10px 0px 10px -5px rgba(0,0,0,0.3)`,
},
tabPage: {
Expand Down
39 changes: 26 additions & 13 deletions configure/src/core/Maker.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
traverseLayers,
getToolFromConfiguration,
updateToolInConfiguration,
getLayerByUUID,
} from "./utils";

import Map from "../components/Map/Map";
Expand Down Expand Up @@ -570,7 +571,6 @@ const getComponent = (
className={c.objectArrayRemove}
aria-label="remove"
onClick={() => {
/*
if (tool) {
const t = getToolFromConfiguration(
tool.name,
Expand All @@ -579,26 +579,28 @@ const getComponent = (
let next = getIn(t, com.field.split("."), []);
next = JSON.parse(JSON.stringify(next));
if (typeof next.push !== "function") next = [];
let nextObj = {};
com.object.forEach((obj) => {
nextObj[obj.field] = null;
});
next.push(nextObj);

next.splice(idx, 1);

updateConfiguration(com.field, next, configuration);
} else if (layer) {
const l = getLayerByUUID(configuration.layers, layer.uuid);
let next = getIn(l, com.field.split("."), []);
next = JSON.parse(JSON.stringify(next));
if (typeof next.push !== "function") next = [];

next.splice(idx, 1);

updateConfiguration(com.field, next, layer);
} else {
let next = getIn(configuration, com.field.split("."), []);
next = JSON.parse(JSON.stringify(next));
if (typeof next.push !== "function") next = [];
let nextObj = {};
com.object.forEach((obj) => {
nextObj[obj.field] = null;
});
next.push(nextObj);

next.splice(idx, 1);

updateConfiguration(com.field, next, layer);
}
*/
}}
>
<CloseIcon />
Expand Down Expand Up @@ -633,6 +635,18 @@ const getComponent = (
next.push(nextObj);

updateConfiguration(com.field, next, configuration);
} else if (layer) {
const l = getLayerByUUID(configuration.layers, layer.uuid);
let next = getIn(l, com.field.split("."), []);
next = JSON.parse(JSON.stringify(next));
if (typeof next.push !== "function") next = [];
let nextObj = {};
com.object.forEach((obj) => {
nextObj[obj.field] = null;
});
next.push(nextObj);

updateConfiguration(com.field, next, layer);
} else {
let next = getIn(configuration, com.field.split("."), []);
next = JSON.parse(JSON.stringify(next));
Expand All @@ -642,7 +656,6 @@ const getComponent = (
nextObj[obj.field] = null;
});
next.push(nextObj);
console.log(next);

updateConfiguration(com.field, next, layer);
}
Expand Down
6 changes: 3 additions & 3 deletions configure/src/metaconfigs/layer-data-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,10 @@
"components": [
{
"field": "variables.shortcutSuffix",
"name": "A single letter to 'ALT + {letter}' toggle the layer on and off. Please verify that your chosen shortcut does not conflict with other system or browser-level keyboard shortcuts.",
"description": "",
"name": "Alt + {letter} Toggle Shortcut",
"description": "A single letter to 'ALT + {letter}' toggle the layer on and off. Please verify that your chosen shortcut does not conflict with other system or browser-level keyboard shortcuts.",
"type": "text",
"width": 4
"width": 6
}
]
}
Expand Down
20 changes: 10 additions & 10 deletions configure/src/metaconfigs/layer-query-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
]
},
{
"name": "Must",
"subname": "Must",
"description": "ElasticSearch DSL 'must' Array. Make sure any below specified JSON begins as an array: []",
"components": [
{
Expand All @@ -154,7 +154,7 @@
]
},
{
"name": "Sort",
"subname": "Sort",
"components": [
{
"field": "variables.query.sort",
Expand Down Expand Up @@ -183,7 +183,7 @@
]
},
{
"name": "Headers",
"subname": "Headers",
"components": [
{
"field": "variables.query.headers",
Expand Down Expand Up @@ -211,7 +211,7 @@
]
},
{
"name": "Fields",
"subname": "Fields",
"components": [
{
"field": "variables.query.fields",
Expand All @@ -225,7 +225,7 @@
"name": "Field Name",
"description": "A field to search upon.",
"type": "text",
"width": 3
"width": 4
},
{
"field": "aggSize",
Expand All @@ -234,14 +234,14 @@
"type": "number",
"min": 0,
"step": 1,
"width": 2
"width": 3
}
]
}
]
},
{
"name": "Miscellaneous",
"subname": "Miscellaneous",
"components": [
{
"field": "variables.query.bodyWrapper",
Expand Down Expand Up @@ -709,10 +709,10 @@
"components": [
{
"field": "variables.shortcutSuffix",
"name": "A single letter to 'ALT + {letter}' toggle the layer on and off. Please verify that your chosen shortcut does not conflict with other system or browser-level keyboard shortcuts.",
"description": "",
"name": "Alt + {letter} Toggle Shortcut",
"description": "A single letter to 'ALT + {letter}' toggle the layer on and off. Please verify that your chosen shortcut does not conflict with other system or browser-level keyboard shortcuts.",
"type": "text",
"width": 4
"width": 6
}
]
},
Expand Down
6 changes: 3 additions & 3 deletions configure/src/metaconfigs/layer-tile-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,10 @@
"components": [
{
"field": "variables.shortcutSuffix",
"name": "A single letter to 'ALT + {letter}' toggle the layer on and off. Please verify that your chosen shortcut does not conflict with other system or browser-level keyboard shortcuts.",
"description": "",
"name": "Alt + {letter} Toggle Shortcut",
"description": "A single letter to 'ALT + {letter}' toggle the layer on and off. Please verify that your chosen shortcut does not conflict with other system or browser-level keyboard shortcuts.",
"type": "text",
"width": 4
"width": 6
}
]
}
Expand Down
6 changes: 3 additions & 3 deletions configure/src/metaconfigs/layer-vector-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,10 @@
"components": [
{
"field": "variables.shortcutSuffix",
"name": "A single letter to 'ALT + {letter}' toggle the layer on and off. Please verify that your chosen shortcut does not conflict with other system or browser-level keyboard shortcuts.",
"description": "",
"name": "Alt + {letter} Toggle Shortcut",
"description": "A single letter to 'ALT + {letter}' toggle the layer on and off. Please verify that your chosen shortcut does not conflict with other system or browser-level keyboard shortcuts.",
"type": "text",
"width": 4
"width": 6
}
]
},
Expand Down

0 comments on commit 2762ca3

Please sign in to comment.