#256: Added category dropdown to app editor

This commit is contained in:
frikky
2021-02-18 17:20:51 +01:00
parent 6d86207c8f
commit e7541320a1
5 changed files with 102 additions and 56 deletions
+61 -23
View File
@@ -444,6 +444,10 @@ const AppCreator = (props) => {
}
if (data.info["x-categories"] !== undefined && data.info["x-categories"].length > 0) {
if (typeof(data.info["x-categories"]) == "array") {
} else {
}
setNewWorkflowCategories(data.info["x-categories"])
}
}
@@ -1991,31 +1995,20 @@ const AppCreator = (props) => {
</FormControl>
</Dialog>
const categories = [
"Communication",
"Cases",
"EDR",
"Intel",
"SIEM",
"Network",
"Assets",
"Other",
]
const tagView =
<div style={{color: "white"}}>
<h2>Tags</h2>
<ChipInput
style={{marginTop: 10}}
InputProps={{
style:{
color: "white",
},
}}
placeholder="Tags"
color="primary"
fullWidth
value={newWorkflowTags}
onAdd={(chip) => {
newWorkflowTags.push(chip)
setNewWorkflowTags(newWorkflowTags)
setUpdate("added"+chip)
}}
onDelete={(chip, index) => {
newWorkflowTags.splice(index, 1)
setNewWorkflowTags(newWorkflowTags)
setUpdate("delete "+chip)
}}
/>
{/*
<ChipInput
style={{marginTop: 10}}
InputProps={{
@@ -2038,6 +2031,51 @@ const AppCreator = (props) => {
setUpdate("delete "+chip)
}}
/>
*/}
<h4>Categories</h4>
<Select
fullWidth
SelectDisplayProps={{
style: {
marginLeft: 10,
}
}}
onChange={(e) => {
setNewWorkflowCategories([e.target.value])
setUpdate("added "+e.target.value)
}}
value={newWorkflowCategories.length === 0 ? "Select a category" : newWorkflowCategories[0]}
style={{backgroundColor: inputColor, color: "white", height: "50px"}}
>
{categories.map(data => (
<MenuItem style={{backgroundColor: inputColor, color: "white"}} value={data}>
{data}
</MenuItem>
))}
</Select>
<h4>Tags</h4>
<ChipInput
style={{marginTop: 10}}
InputProps={{
style:{
color: "white",
},
}}
placeholder="Tags"
color="primary"
fullWidth
value={newWorkflowTags}
onAdd={(chip) => {
newWorkflowTags.push(chip)
setNewWorkflowTags(newWorkflowTags)
setUpdate("added"+chip)
}}
onDelete={(chip, index) => {
newWorkflowTags.splice(index, 1)
setNewWorkflowTags(newWorkflowTags)
setUpdate("delete "+chip)
}}
/>
</div>
const actionView =