Merging fixes from cloud. Detailed changes TBA with next release

This commit is contained in:
frikky
2022-10-11 16:19:27 +02:00
parent bd170df0f0
commit b85a56f4b5
9 changed files with 137 additions and 25 deletions
+2
View File
@@ -3932,6 +3932,7 @@ const Admin = (props) => {
defaultValue={""}
autoFocus
/>}</div>
<CodeEditor
expansionModalOpen={openEditor}
setExpansionModalOpen={setOpenEditor}
@@ -3941,6 +3942,7 @@ const Admin = (props) => {
key = {fileContent} //https://reactjs.org/docs/reconciliation.html#recursing-on-children
runUpdateText = {runUpdateText}
/>
<Divider
style={{
marginTop: 20,
+3 -8
View File
@@ -254,7 +254,6 @@ const AngularWorkflow = (defaultprops) => {
const yellow = "#FECC00";
//const theme = useTheme();
const [bodyWidth, bodyHeight] = useWindowSize();
var to_be_copied = "";
const [firstrequest, setFirstrequest] = React.useState(true);
@@ -395,6 +394,9 @@ const AngularWorkflow = (defaultprops) => {
const triggerEnvironments = isCloud ? ["cloud"] : ["onprem", "cloud"];
const unloadText = "Are you sure you want to leave without saving (CTRL+S)?";
const classes = useStyles();
const [bodyWidth, bodyHeight] = useWindowSize()
//console.log("Mobile: ", isMobile, bodyWidth, bodyHeight)
const cytoscapeWidth = isMobile ? bodyWidth - leftBarSize : bodyWidth - leftBarSize - 25
@@ -427,8 +429,6 @@ const AngularWorkflow = (defaultprops) => {
})
.then((responseJson) => {
if (responseJson.success === true) {
console.log("RESPONSE FOR APP: ", responseJson.reason);
if (responseJson.reason !== undefined && responseJson.reason !== undefined && responseJson.reason.length > 0) {
if (!responseJson.reason.includes("404: Not Found") && responseJson.reason.length > 25) {
selectedApp.documentation = responseJson.reason
@@ -651,7 +651,6 @@ const AngularWorkflow = (defaultprops) => {
};
const setNewAppAuth = (appAuthData) => {
console.log("DAta: ", appAuthData);
fetch(globalUrl + "/api/v1/apps/authentication", {
method: "PUT",
headers: {
@@ -1511,8 +1510,6 @@ const AngularWorkflow = (defaultprops) => {
}
if (cy !== undefined) {
console.log("NEW AUTH = reset cy's onnodeselect");
// Remove the old listener for select, run with new one
cy.removeListener("select");
cy.on("select", "node", (e) => onNodeSelect(e, newauth));
@@ -14180,7 +14177,6 @@ const AngularWorkflow = (defaultprops) => {
}
const handleSubmitCheck = () => {
console.log("NEW AUTH: ", authenticationOption);
if (authenticationOption.label.length === 0) {
authenticationOption.label = `Auth for ${selectedApp.name}`;
}
@@ -14244,7 +14240,6 @@ const AngularWorkflow = (defaultprops) => {
});
}
console.log("FIELDS: ", newFields);
newAuthOption.fields = newFields;
setNewAppAuth(newAuthOption);
+46 -3
View File
@@ -670,7 +670,8 @@ const AppCreator = (defaultprops) => {
if (newaction.url !== undefined && newaction.url !== null && newaction.url.includes("_shuffle_replace_")) {
const regex = /_shuffle_replace_\d/i;
//console.log("NEW: ",
newaction.url = newaction.url.replace(regex, "")
newaction.url = newaction.url.replaceAll(new RegExp(regex, 'g'), "")
console.log("Replaced: ", newaction.url)
}
// Finding category
@@ -679,6 +680,12 @@ const AppCreator = (defaultprops) => {
var categoryindex = -1;
// Stupid way of finding a category/grouping
for (var key in pathsplit) {
if (pathsplit[key].includes("_shuffle_replace_")) {
const regex = /_shuffle_replace_\d/i;
//console.log("NEW: ",
pathsplit[key] = pathsplit[key].replaceAll(new RegExp(regex, 'g'), "")
}
if (
pathsplit[key].length > 0 &&
pathsplit[key] !== "v1" &&
@@ -1697,7 +1704,6 @@ const AppCreator = (defaultprops) => {
// Basic way to allow multiple of the same path
var pathjoin = item.url+"_"+item.method.toLowerCase()
if (handledPaths.includes(pathjoin)) {
console.log("ALREADY INCLUDED: ", pathjoin)
// Max 100 of same lol
for (var i = 0; i < 100; i++) {
@@ -1708,7 +1714,6 @@ const AppCreator = (defaultprops) => {
continue
}
console.log("FOUND NEW: ", item.url)
break
}
}
@@ -1978,6 +1983,37 @@ const AppCreator = (defaultprops) => {
item.body.length > 0
) {
console.log("GOT BODY: ", item.url, item.method)
// Replacing dollarsign insertions that aren't escaped
// This is to stop it from messing with systems in Shuffle.
// This MAY cause it to be a little weird in other systems however,
// but it's the only way we can properly support e.g. GraphQL
// with good examples
var newbody = ""
for (var key in item.body) {
if (item.body[key] === "$") {
if (key > 0) {
//console.log("Found: ", item.body[key-1])
if (item.body[key-1] !== "\\") {
newbody += "\\"
}
newbody += item.body[key]
} else {
newbody += "\\"
newbody += item.body[key]
}
//newbody += item.body[key]
} else {
newbody += item.body[key]
}
}
if (newbody !== item.body) {
//console.log("New body: ", newbody)
item.body = newbody
}
//var pathjoin = item.url+"_"+item.method.toLowerCase()
const required = false;
@@ -4656,6 +4692,12 @@ const AppCreator = (defaultprops) => {
<div style={{ marginTop: 10, marginBottom: 10 }}>
{projectCategories.map((tag, index) => {
const newname = tag.charAt(0).toUpperCase() + tag.slice(1);
//var regex = /_shuffle_replace_\d/i;
////console.log("NEW: ",
//newname = newname.replaceAll(regex, "")
//console.log("Replaced: ", newname)
return (
<Chip
key={index}
@@ -4888,6 +4930,7 @@ const AppCreator = (defaultprops) => {
imageUploadError.length > 0 ? (
<div style={{ marginTop: 10 }}>Error: {imageUploadError}</div>
) : null;
const imageUploadModalView = openImageModal ? (
<Dialog
open={openImageModal}
+7 -2
View File
@@ -77,10 +77,12 @@ export const FindJsonPath = (path, inputdata) => {
var parsedValues = [];
if (inputdata === undefined || inputdata === null) {
console.log("Input is ", inputdata, ". Returning.")
return inputdata
}
if (typeof inputdata !== "object") {
console.log("Input is NOT an object. Returning.")
return inputdata
}
@@ -90,6 +92,7 @@ export const FindJsonPath = (path, inputdata) => {
}
if (keysplit.length === 0) {
console.log("Couldn't find key: length is 0 for keysplit.")
return inputdata
}
@@ -114,9 +117,11 @@ export const FindJsonPath = (path, inputdata) => {
}
}
var found = false
for (const [key, value] of Object.entries(inputdata)) {
if (key === keysplit[0]) {
const newkey = key.valueOf().toLowerCase().replaceAll(" ", "_")
if (key === keysplit[0] || newkey === keysplit[0]) {
found = true
// Return if no more keys
// Else, dig deeper