Added categories to workflows
This commit is contained in:
@@ -433,7 +433,7 @@ const AngularWorkflow = (props) => {
|
||||
const abortExecution = () => {
|
||||
setExecutionRunning(false)
|
||||
|
||||
alert.info("Aborting execution")
|
||||
//alert.info("Aborting execution")
|
||||
fetch(globalUrl+"/api/v1/workflows/"+props.match.params.key+"/executions/"+executionRequest.execution_id+"/abort", {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
@@ -1859,13 +1859,6 @@ const AngularWorkflow = (props) => {
|
||||
height: "100%",
|
||||
}
|
||||
|
||||
const scrollStyle = {
|
||||
marginTop: 10,
|
||||
overflow: "scroll",
|
||||
height: "100%",
|
||||
overflowX: "auto",
|
||||
overflowY: "auto",
|
||||
}
|
||||
|
||||
const paperAppStyle = {
|
||||
borderRadius: borderRadius,
|
||||
@@ -2429,8 +2422,11 @@ const AngularWorkflow = (props) => {
|
||||
authentication: [],
|
||||
execution_variable: undefined,
|
||||
example: example,
|
||||
category: app.categories !== null && app.categories !== undefined && app.categories.length > 0 ? app.categories[0] : ""
|
||||
}
|
||||
|
||||
// FIXME: overwrite category if the ACTION chosen has a different category
|
||||
|
||||
// const image = "url("+app.large_image+")"
|
||||
|
||||
// FIXME - find the cytoscape offset position
|
||||
@@ -2489,6 +2485,8 @@ const AngularWorkflow = (props) => {
|
||||
}
|
||||
|
||||
workflow.actions.push(newAppData)
|
||||
|
||||
console.log(workflow.categories)
|
||||
setWorkflow(workflow)
|
||||
|
||||
if (newAppPopup) {
|
||||
@@ -2605,7 +2603,6 @@ const AngularWorkflow = (props) => {
|
||||
return null
|
||||
}
|
||||
|
||||
console.log("APP: ", app)
|
||||
return(
|
||||
<ParsedAppPaper key={index} app={app} />
|
||||
)
|
||||
|
||||
@@ -195,7 +195,7 @@ const AppCreator = (props) => {
|
||||
const alert = useAlert()
|
||||
|
||||
var upload = ""
|
||||
const increaseAmount = 30
|
||||
const increaseAmount = 50
|
||||
const actionNonBodyRequest = ["GET", "HEAD", "DELETE", "CONNECT"]
|
||||
const actionBodyRequest = ["POST", "PUT", "PATCH",]
|
||||
const authenticationOptions = ["No authentication", "API key", "Bearer auth", "Basic auth", ]
|
||||
@@ -1230,6 +1230,11 @@ const AppCreator = (props) => {
|
||||
newAction.errors.push("Can't have the same name")
|
||||
|
||||
actions.push(newAction)
|
||||
|
||||
if (actions.length > actionAmount) {
|
||||
setActionAmount(actions.length)
|
||||
}
|
||||
|
||||
setActions(actions)
|
||||
setUpdate(Math.random())
|
||||
}
|
||||
@@ -1539,6 +1544,11 @@ const AppCreator = (props) => {
|
||||
actions[actionIndex] = currentAction
|
||||
}
|
||||
|
||||
|
||||
if (actions.length > actionAmount) {
|
||||
setActionAmount(actions.length)
|
||||
}
|
||||
|
||||
setActions(actions)
|
||||
}
|
||||
|
||||
@@ -1973,6 +1983,7 @@ const AppCreator = (props) => {
|
||||
setUrlPathQueries([])
|
||||
setUrlPath("")
|
||||
setFileUploadEnabled(false)
|
||||
|
||||
}}>
|
||||
Submit
|
||||
</Button>
|
||||
@@ -2053,8 +2064,10 @@ const AppCreator = (props) => {
|
||||
setCurrentActionMethod(actionNonBodyRequest[0])
|
||||
setActionsModalOpen(true)
|
||||
}}>New action</Button>
|
||||
{/*
|
||||
{actionAmount} {actions.length}
|
||||
{actionAmount > 0 && actionAmount < actions.length ? null :
|
||||
<Button color="primary" style={{marginTop: "20px", borderRadius: "0px", textAlign: "center"}} variant="outlined" onClick={() => {
|
||||
<Button color="primary" style={{float: "right", marginTop: "20px", borderRadius: "0px", textAlign: "center"}} variant="outlined" onClick={() => {
|
||||
if (actionAmount+increaseAmount > actions.length) {
|
||||
setActionAmount(actions.length)
|
||||
} else {
|
||||
@@ -2064,6 +2077,7 @@ const AppCreator = (props) => {
|
||||
See more actions
|
||||
</Button>
|
||||
}
|
||||
*/}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2136,7 +2150,7 @@ const AppCreator = (props) => {
|
||||
</h2>
|
||||
</Link>
|
||||
<h2>
|
||||
{name}
|
||||
{name} ({actions === null || actions === undefined ? 0 : actions.length})
|
||||
</h2>
|
||||
</Breadcrumbs>
|
||||
<Paper style={boxStyle}>
|
||||
|
||||
@@ -169,7 +169,7 @@ const Apps = (props) => {
|
||||
|
||||
function sortByKey(array, key) {
|
||||
if (array === undefined || array === null) {
|
||||
return []
|
||||
return array
|
||||
}
|
||||
|
||||
return array.sort(function(a, b) {
|
||||
|
||||
@@ -191,18 +191,21 @@ const Workflows = (props) => {
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.status !== 200) {
|
||||
console.log("Status not 200 for workflows :O!")
|
||||
console.log("Status not 200 for workflows :O!: ", response.status)
|
||||
alert.info("Failed getting workflows.")
|
||||
setWorkflowDone(true)
|
||||
|
||||
return
|
||||
}
|
||||
return response.json()
|
||||
})
|
||||
.then((responseJson) => {
|
||||
.then((responseJson) => {
|
||||
setSelectedExecution({})
|
||||
setWorkflowExecutions([])
|
||||
|
||||
if (responseJson !== undefined) {
|
||||
setWorkflows(responseJson)
|
||||
setWorkflowDone(true)
|
||||
setWorkflowDone(true)
|
||||
} else {
|
||||
if (isLoggedIn) {
|
||||
alert.error("An error occurred while loading workflows")
|
||||
|
||||
Reference in New Issue
Block a user