Cleaned up how keys are handled for duplicates and published workflows. Further changes APIs to use the correct one again for OpenAPI loading

This commit is contained in:
frikky
2022-10-27 18:00:04 +02:00
parent 4ca5fcfeb2
commit be0aed82e3
4 changed files with 41 additions and 34 deletions
+2 -2
View File
@@ -3424,7 +3424,7 @@ class AppBase:
errorstring = f"{e}" errorstring = f"{e}"
if "the JSON object must be" in errorstring: if "the JSON object must be" in errorstring:
self.logger.info("[ERROR] Something is wrong with the input for this function. Are lists and JSON data handled parsed properly?") self.logger.info("[ERROR] Something is wrong with the input for this function. Are lists and JSON data handled parsed properly (0)?")
try: try:
e = json.loads(f"{e}") e = json.loads(f"{e}")
except: except:
@@ -3454,7 +3454,7 @@ class AppBase:
}) })
break break
except Exception as e: except Exception as e:
self.logger.info("[ERROR] Something is wrong with the input for this function. Are lists and JSON data handled parsed properly?") self.logger.info("[ERROR] Something is wrong with the input for this function. Are lists and JSON data handled parsed properly (1)?")
try: try:
e = json.loads(f"{e}") e = json.loads(f"{e}")
+4 -3
View File
@@ -1,5 +1,6 @@
import React, { useState, useEffect, useLayoutEffect } from "react"; import React, { useState, useEffect, useLayoutEffect } from "react";
import ReactDOM from "react-dom" import ReactDOM from "react-dom"
import { useInterval } from "react-powerhooks"; import { useInterval } from "react-powerhooks";
import { makeStyles, useTheme } from "@material-ui/core/styles"; import { makeStyles, useTheme } from "@material-ui/core/styles";
@@ -1400,7 +1401,6 @@ const AngularWorkflow = (defaultprops) => {
setVisited([]) setVisited([])
setExecutionRequest({}) setExecutionRequest({})
stop() stop()
})
var curelements = cy.elements(); var curelements = cy.elements();
for (var i = 0; i < curelements.length; i++) { for (var i = 0; i < curelements.length; i++) {
@@ -1476,6 +1476,7 @@ const AngularWorkflow = (defaultprops) => {
setExecutionRequestStarted(false) setExecutionRequestStarted(false)
console.log("Execute workflow err: ", error.toString()); console.log("Execute workflow err: ", error.toString());
}); });
})
}; };
// This can be used to only show prioritzed ones later // This can be used to only show prioritzed ones later
@@ -13858,7 +13859,7 @@ const AngularWorkflow = (defaultprops) => {
<span style={{ color: "white" }}>Execution Variable</span> <span style={{ color: "white" }}>Execution Variable</span>
</DialogTitle> </DialogTitle>
<DialogContent> <DialogContent>
Execution Variables are TEMPORARY variables that you can ony be set Execution Variables are TEMPORARY variables that you can only be set
and used during execution. Learn more{" "} and used during execution. Learn more{" "}
<a <a
rel="noopener noreferrer" rel="noopener noreferrer"
@@ -13955,7 +13956,7 @@ const AngularWorkflow = (defaultprops) => {
const variable = execution.execution_variables.find( const variable = execution.execution_variables.find(
(data) => data.name === newVariableName (data) => data.name === newVariableName
); )
if (variable === undefined || variable.value === undefined) { if (variable === undefined || variable.value === undefined) {
return null; return null;
} }
+28 -27
View File
@@ -393,35 +393,36 @@ const AppCreator = (defaultprops) => {
return; return;
} }
handleEditApp(urlParams.get("id")) //handleEditApp(urlParams.get("id"))
//fetch(globalUrl + "/api/v1/get_openapi/" + urlParams.get("id"), { // THIS has to stay due to ID may not exist as normal app yet
// method: "GET", fetch(globalUrl + "/api/v1/get_openapi/" + urlParams.get("id"), {
// headers: { method: "GET",
// "Content-Type": "application/json", headers: {
// Accept: "application/json", "Content-Type": "application/json",
// }, Accept: "application/json",
// credentials: "include", },
//}) credentials: "include",
// .then((response) => { })
// if (response.status !== 200) { .then((response) => {
// throw new Error("NOT 200 :O"); if (response.status !== 200) {
// } throw new Error("NOT 200 :O");
}
// return response.json(); return response.json();
// }) })
// .then((responseJson) => { .then((responseJson) => {
// setIsAppLoaded(true); setIsAppLoaded(true);
// if (!responseJson.success) { if (!responseJson.success) {
// alert.error("Failed to verify"); alert.error("Failed to get app config. Do you have access?");
// } else { } else {
// parseIncomingOpenapiData(responseJson); parseIncomingOpenapiData(responseJson);
// } }
// }) })
// .catch((error) => { .catch((error) => {
// console.log("Error: ", error.toString()); console.log("Error: ", error.toString());
// alert.error(error.toString()); alert.error(error.toString());
// }); });
}; };
const setFileFromb64 = () => { const setFileFromb64 = () => {
+7 -2
View File
@@ -1274,8 +1274,12 @@ const Workflows = (props) => {
for (var subkey in data.actions[key].parameters) { for (var subkey in data.actions[key].parameters) {
const param = data.actions[key].parameters[subkey]; const param = data.actions[key].parameters[subkey];
// Removed October 10th, 2022 as key usually isn't
// containing anything secret, but rather necessary configurations.
// param.name.includes("key") ||
//
if ( if (
param.name.includes("key") ||
param.name.includes("user") || param.name.includes("user") ||
param.name.includes("pass") || param.name.includes("pass") ||
param.name.includes("api") || param.name.includes("api") ||
@@ -1322,8 +1326,9 @@ const Workflows = (props) => {
) { ) {
for (key in data.workflow_variables) { for (key in data.workflow_variables) {
const param = data.workflow_variables[key]; const param = data.workflow_variables[key];
//param.name.includes("key") ||
if ( if (
param.name.includes("key") ||
param.name.includes("user") || param.name.includes("user") ||
param.name.includes("pass") || param.name.includes("pass") ||
param.name.includes("api") || param.name.includes("api") ||