Added minor fix to app generation
This commit is contained in:
@@ -91,8 +91,7 @@ const WorkflowPaper = (props) => {
|
||||
}
|
||||
|
||||
//console.log("IMG: ", data)
|
||||
var parsedUrl = `workflows/${data.objectID}`
|
||||
|
||||
var parsedUrl = `/workflows/${data.objectID}`
|
||||
if (data.__queryID !== undefined && data.__queryID !== null) {
|
||||
parsedUrl += `?queryID=${data.__queryID}`
|
||||
}
|
||||
|
||||
@@ -163,8 +163,8 @@ const data = [
|
||||
selector: "node[?isSuggestion]",
|
||||
css: {
|
||||
shape: "ellipse",
|
||||
width: "30px",
|
||||
height: "30px",
|
||||
width: "50px",
|
||||
height: "50px",
|
||||
"z-index": "5002",
|
||||
"font-size": "0px",
|
||||
border: "1px solid rgba(255,255,255,0.9)",
|
||||
|
||||
@@ -3752,6 +3752,7 @@ const AngularWorkflow = (defaultprops) => {
|
||||
) {
|
||||
cy.getElementById(currentNode.data.id).remove();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3892,7 +3893,7 @@ const AngularWorkflow = (defaultprops) => {
|
||||
if (parentNode.data("isButton") || parentNode.data("buttonId")) return;
|
||||
|
||||
const px = parentNode.position("x") + 300;
|
||||
const py = parentNode.position("y") + 0;
|
||||
const py = parentNode.position("y") + 100;
|
||||
const circleId = (newNodeId = uuidv4());
|
||||
|
||||
parentNode.data("circleId", circleId);
|
||||
@@ -3920,8 +3921,51 @@ const AngularWorkflow = (defaultprops) => {
|
||||
position: { x: px, y: py },
|
||||
locked: true,
|
||||
});
|
||||
|
||||
//suggestions[0].id = uuidv4()
|
||||
//cy.add({
|
||||
// group: "nodes",
|
||||
// data: suggestions[0],
|
||||
// position: { x: parentNode.position("x") + 300, y: parentNode.position("y") - 100},
|
||||
// locked: true,
|
||||
//});
|
||||
}
|
||||
|
||||
const addDeleteButton2 = (event) => {
|
||||
var parentNode = cy.$("#" + event.target.data("id"));
|
||||
if (parentNode.data("isButton") || parentNode.data("buttonId")) return;
|
||||
|
||||
const px = parentNode.position("x") + 100;
|
||||
const py = parentNode.position("y") + 35;
|
||||
const circleId = (newNodeId = uuidv4());
|
||||
|
||||
parentNode.data("circleId", circleId);
|
||||
|
||||
const iconInfo = {
|
||||
icon: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z",
|
||||
iconColor: buttonColor,
|
||||
iconBackgroundColor: buttonBackgroundColor,
|
||||
};
|
||||
const svg_pin = `<svg width="${svgSize}" height="${svgSize}" viewBox="0 0 ${svgSize} ${svgSize}" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="${iconInfo.icon}" fill="${iconInfo.iconColor}"></path></svg>`;
|
||||
const svgpin_Url = encodeURI("data:image/svg+xml;utf-8," + svg_pin);
|
||||
|
||||
cy.add({
|
||||
group: "nodes",
|
||||
data: {
|
||||
weight: 30,
|
||||
id: circleId,
|
||||
name: "This is autocomplete",
|
||||
buttonType: "delete",
|
||||
attachedTo: event.target.data("id"),
|
||||
icon: svgpin_Url,
|
||||
iconBackground: iconInfo.iconBackgroundColor,
|
||||
is_valid: true,
|
||||
},
|
||||
position: { x: px, y: py },
|
||||
locked: true,
|
||||
});
|
||||
};
|
||||
|
||||
const addDeleteButton = (event) => {
|
||||
var parentNode = cy.$("#" + event.target.data("id"));
|
||||
if (parentNode.data("isButton") || parentNode.data("buttonId")) return;
|
||||
@@ -3981,12 +4025,19 @@ const AngularWorkflow = (defaultprops) => {
|
||||
for (var key in allNodes) {
|
||||
const currentNode = allNodes[key];
|
||||
if (
|
||||
currentNode.data.isButton &&
|
||||
(currentNode.data.isButton || currentNode.data.isSuggestion) &&
|
||||
currentNode.data.attachedTo !== nodedata.id
|
||||
) {
|
||||
cy.getElementById(currentNode.data.id).remove();
|
||||
}
|
||||
|
||||
/*if (
|
||||
currentNode.data.isSuggestion &&
|
||||
currentNode.data.attachedTo !== nodedata.id
|
||||
) {
|
||||
cy.getElementById(currentNode.data.id).remove();
|
||||
}*/
|
||||
|
||||
if (
|
||||
currentNode.data.isButton &&
|
||||
currentNode.data.attachedTo === nodedata.id
|
||||
@@ -4007,7 +4058,10 @@ const AngularWorkflow = (defaultprops) => {
|
||||
addStartnodeButton(event);
|
||||
}
|
||||
|
||||
//addSuggestionButtons(event)
|
||||
// autocomplete
|
||||
// right click
|
||||
// suggestions
|
||||
//addSuggestionButtons(event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5037,7 +5091,7 @@ const AngularWorkflow = (defaultprops) => {
|
||||
var thisview = (
|
||||
<AppView
|
||||
allApps={apps}
|
||||
extraApps={ExtraApps}
|
||||
extraApps={[]}
|
||||
prioritizedApps={prioritizedApps}
|
||||
filteredApps={filteredApps}
|
||||
/>
|
||||
@@ -5825,15 +5879,10 @@ const AngularWorkflow = (defaultprops) => {
|
||||
if (value.length > 0) {
|
||||
var newApps = allApps.filter(
|
||||
(app) =>
|
||||
app.name
|
||||
.toLowerCase()
|
||||
.includes(
|
||||
value.trim().toLowerCase() ||
|
||||
app.description
|
||||
.toLowerCase()
|
||||
.includes(value.trim().toLowerCase())
|
||||
) && !(!app.activated && app.generated)
|
||||
);
|
||||
app.name.toLowerCase().includes(value.trim().toLowerCase())
|
||||
||
|
||||
app.description.toLowerCase().includes(value.trim().toLowerCase())
|
||||
)
|
||||
|
||||
// Extend search
|
||||
if (newApps.length === 0) {
|
||||
@@ -6914,7 +6963,7 @@ const AngularWorkflow = (defaultprops) => {
|
||||
>
|
||||
contains any of
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
{/*<MenuItem
|
||||
style={menuItemStyle}
|
||||
onClick={(e) => {
|
||||
conditionValue.value = "matches regex";
|
||||
@@ -6924,7 +6973,7 @@ const AngularWorkflow = (defaultprops) => {
|
||||
key={"matches regex"}
|
||||
>
|
||||
matches regex
|
||||
</MenuItem>
|
||||
</MenuItem>*/}
|
||||
<MenuItem
|
||||
style={menuItemStyle}
|
||||
onClick={(e) => {
|
||||
@@ -10665,11 +10714,7 @@ const AngularWorkflow = (defaultprops) => {
|
||||
};
|
||||
|
||||
const BottomCytoscapeBar = () => {
|
||||
if (
|
||||
workflow.id === undefined ||
|
||||
workflow.id === null ||
|
||||
apps.length === 0
|
||||
) {
|
||||
if (workflow.id === undefined || workflow.id === null || (!workflow.public && apps.length === 0)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -11333,7 +11378,7 @@ const AngularWorkflow = (defaultprops) => {
|
||||
</div>
|
||||
: null}
|
||||
|
||||
{userdata.avatar === creatorProfile.github_avatar ?
|
||||
{userdata.avatar === creatorProfile.github_avatar && userdata.avatar !== undefined ?
|
||||
<div style={{marginTop: 50, }}>
|
||||
<Button
|
||||
color="primary"
|
||||
|
||||
@@ -1421,14 +1421,15 @@ const AppCreator = (defaultprops) => {
|
||||
//console.log("SECURITYSCHEMES: ", securitySchemes)
|
||||
if (securitySchemes !== undefined) {
|
||||
console.log("NEWAUTH: ", securitySchemes)
|
||||
var valueset = false
|
||||
// FIXME: Should add Oauth2 (Microsoft) and JWT (Wazuh)
|
||||
//console.log("SECURITY: ", securitySchemes)
|
||||
//if (Object.entries(securitySchemes) > 1 &&
|
||||
var newauth = [];
|
||||
try {
|
||||
var optionset = false
|
||||
for (const [key, value] of Object.entries(securitySchemes)) {
|
||||
console.log(key, value);
|
||||
|
||||
if (key === "jwt") {
|
||||
setAuthenticationOption("JWT");
|
||||
setAuthenticationRequired(true);
|
||||
@@ -1439,19 +1440,21 @@ const AppCreator = (defaultprops) => {
|
||||
value.in.length > 0
|
||||
) {
|
||||
setParameterName(value.in);
|
||||
optionset = true
|
||||
}
|
||||
|
||||
} else if (value.scheme === "bearer") {
|
||||
setAuthenticationOption("Bearer auth");
|
||||
setAuthenticationRequired(true);
|
||||
optionset = true
|
||||
|
||||
} else if (key === "ApiKeyAuth" || key === "Token" || ((value.in === "header" || value.in === "query") && value.name !== undefined)) {
|
||||
if (authenticationOption === "" || authenticationOption === "No authentication") {
|
||||
setAuthenticationOption("API key");
|
||||
}
|
||||
//if (optionset === false) {
|
||||
// optionset = true
|
||||
//}
|
||||
|
||||
if (valueset === false) {
|
||||
valueset = true
|
||||
if (optionset === false) {
|
||||
optionset = true
|
||||
value.in = value.in.charAt(0).toUpperCase() + value.in.slice(1)
|
||||
|
||||
setParameterLocation(value.in);
|
||||
@@ -1461,8 +1464,16 @@ const AppCreator = (defaultprops) => {
|
||||
}
|
||||
|
||||
console.log("PARAM NAME: ", value.name);
|
||||
setAuthenticationOption("API key");
|
||||
setParameterName(value.name);
|
||||
setAuthenticationRequired(true);
|
||||
|
||||
newauth.push({
|
||||
"name": key,
|
||||
"type": value.in.toLowerCase(),
|
||||
"in": value.in.toLowerCase(),
|
||||
"example": "",
|
||||
})
|
||||
} else {
|
||||
newauth.push({
|
||||
"name": key,
|
||||
@@ -1482,15 +1493,18 @@ const AppCreator = (defaultprops) => {
|
||||
} else if (value.scheme === "basic") {
|
||||
setAuthenticationOption("Basic auth");
|
||||
setAuthenticationRequired(true);
|
||||
optionset = true
|
||||
|
||||
} else if (value.scheme === "oauth2") {
|
||||
setAuthenticationOption("Oauth2");
|
||||
setAuthenticationRequired(true);
|
||||
optionset = true
|
||||
|
||||
} else if (value.type === "oauth2" || key === "Oauth2" || key === "Oauth2c" || (key !== undefined && key !== null && key.toLowerCase().includes("oauth2"))) {
|
||||
//alert.info("Can't handle Oauth2 auth yet.")
|
||||
setAuthenticationOption("Oauth2");
|
||||
setAuthenticationRequired(true);
|
||||
optionset = true
|
||||
|
||||
//console.log("FLOW-1: ", value)
|
||||
const flowkey = value.flow === undefined ? "flows" : "flow";
|
||||
@@ -1573,6 +1587,7 @@ const AppCreator = (defaultprops) => {
|
||||
}
|
||||
|
||||
if (newauth.length > 0) {
|
||||
newauth = newauth.filter(data => data.name != "ApiKeyAuth")
|
||||
setExtraAuth(newauth);
|
||||
}
|
||||
}
|
||||
@@ -1645,9 +1660,9 @@ const AppCreator = (defaultprops) => {
|
||||
data.info["contact"] = basedata.info.contact;
|
||||
} else if (contact === "") {
|
||||
data.info["contact"] = {
|
||||
name: "@frikkylikeme",
|
||||
url: "https://twitter.com/frikkylikeme",
|
||||
email: "frikky@shuffler.io",
|
||||
name: "@shuffle_platform",
|
||||
url: "https://twitter.com/shuffleio",
|
||||
email: "support@shuffler.io",
|
||||
};
|
||||
} else {
|
||||
data.info["contact"] = contact;
|
||||
|
||||
Reference in New Issue
Block a user