Fiddled with apps
This commit is contained in:
@@ -157,6 +157,7 @@ const AngularWorkflow = (props) => {
|
|||||||
|
|
||||||
const [apps, setApps] = React.useState([]);
|
const [apps, setApps] = React.useState([]);
|
||||||
const [filteredApps, setFilteredApps] = React.useState([]);
|
const [filteredApps, setFilteredApps] = React.useState([]);
|
||||||
|
const [prioritizedApps, setPrioritizedApps] = React.useState([]);
|
||||||
const [firstrequest, setFirstrequest] = React.useState(true)
|
const [firstrequest, setFirstrequest] = React.useState(true)
|
||||||
//const [apps, setApps] = React.useState(appdata);
|
//const [apps, setApps] = React.useState(appdata);
|
||||||
//const [filteredApps, setFilteredApps] = React.useState();
|
//const [filteredApps, setFilteredApps] = React.useState();
|
||||||
@@ -794,6 +795,11 @@ const AngularWorkflow = (props) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const internalIds = [
|
||||||
|
"80a1fdd2-95c2-49ab-81f6-e05689beb745", // Shuffle tools
|
||||||
|
"39c5f8fa-a088-4cdc-826f-19e2e61cb284", // Testing
|
||||||
|
]
|
||||||
|
|
||||||
const getApps = () => {
|
const getApps = () => {
|
||||||
fetch(globalUrl+"/api/v1/workflows/apps", {
|
fetch(globalUrl+"/api/v1/workflows/apps", {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
@@ -819,6 +825,9 @@ const AngularWorkflow = (props) => {
|
|||||||
setApps(responseJson)
|
setApps(responseJson)
|
||||||
setFilteredApps(responseJson)
|
setFilteredApps(responseJson)
|
||||||
getAppAuthentication()
|
getAppAuthentication()
|
||||||
|
|
||||||
|
|
||||||
|
setPrioritizedApps(responseJson.filter(app => internalIds.includes(app.id)))
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
alert.error(error.toString())
|
alert.error(error.toString())
|
||||||
@@ -2206,33 +2215,9 @@ const AngularWorkflow = (props) => {
|
|||||||
setFilteredApps(apps.filter(app => app.name.toLowerCase().includes(event.target.value.trim().toLowerCase())))
|
setFilteredApps(apps.filter(app => app.name.toLowerCase().includes(event.target.value.trim().toLowerCase())))
|
||||||
}
|
}
|
||||||
|
|
||||||
const AppView = () => {
|
const ParsedAppPaper = (props) => {
|
||||||
return(
|
const app = props.app
|
||||||
<div style={appViewStyle}>
|
|
||||||
<div style={{flex: "1"}}>
|
|
||||||
<div style={appScrollStyle}>
|
|
||||||
{/*
|
|
||||||
<TextField
|
|
||||||
style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
|
|
||||||
style={{backgroundColor: inputColor}}
|
|
||||||
InputProps={{
|
|
||||||
style:{
|
|
||||||
color: "white",
|
|
||||||
minHeight: "50px",
|
|
||||||
marginLeft: "5px",
|
|
||||||
maxWidth: "95%",
|
|
||||||
fontSize: "1em",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
fullWidth
|
|
||||||
color="primary"
|
|
||||||
placeholder={"Search apps"}
|
|
||||||
onChange={(event) => {
|
|
||||||
runAppSearch(event)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
*/}
|
|
||||||
{filteredApps.map(app=> {
|
|
||||||
// FIXME - add label to apps, as this might be slow with A LOT of apps
|
// FIXME - add label to apps, as this might be slow with A LOT of apps
|
||||||
var newAppname = app.name
|
var newAppname = app.name
|
||||||
newAppname = newAppname.replace("_", " ").charAt(0).toUpperCase()+newAppname.substring(1)
|
newAppname = newAppname.replace("_", " ").charAt(0).toUpperCase()+newAppname.substring(1)
|
||||||
@@ -2241,15 +2226,9 @@ const AngularWorkflow = (props) => {
|
|||||||
newAppname = newAppname.slice(0, maxlen)+".."
|
newAppname = newAppname.slice(0, maxlen)+".."
|
||||||
}
|
}
|
||||||
|
|
||||||
// Description fucks this up - fix overflow :)
|
|
||||||
//const maxdesclen = 5
|
|
||||||
//var desc = app.description
|
|
||||||
//if (newAppname.length > maxdesclen) {
|
|
||||||
// desc = desc.slice(0, maxdesclen)+".."
|
|
||||||
//}
|
|
||||||
|
|
||||||
const image = "url("+app.large_image+")"
|
const image = "url("+app.large_image+")"
|
||||||
return(
|
|
||||||
|
return (
|
||||||
<Draggable
|
<Draggable
|
||||||
onDrag={(e) => {handleAppDrag(e, app)}}
|
onDrag={(e) => {handleAppDrag(e, app)}}
|
||||||
onStop={(e) => {handleDragStop(e, app)}}
|
onStop={(e) => {handleDragStop(e, app)}}
|
||||||
@@ -2282,6 +2261,43 @@ const AngularWorkflow = (props) => {
|
|||||||
</Paper>
|
</Paper>
|
||||||
</Draggable>
|
</Draggable>
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const AppView = () => {
|
||||||
|
return(
|
||||||
|
<div style={appViewStyle}>
|
||||||
|
<div style={{flex: "1"}}>
|
||||||
|
<div style={appScrollStyle}>
|
||||||
|
{/*
|
||||||
|
<TextField
|
||||||
|
style={{backgroundColor: inputColor, borderRadius: borderRadius,}}
|
||||||
|
style={{backgroundColor: inputColor}}
|
||||||
|
InputProps={{
|
||||||
|
style:{
|
||||||
|
color: "white",
|
||||||
|
minHeight: "50px",
|
||||||
|
marginLeft: "5px",
|
||||||
|
maxWidth: "95%",
|
||||||
|
fontSize: "1em",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
fullWidth
|
||||||
|
color="primary"
|
||||||
|
placeholder={"Search apps"}
|
||||||
|
onChange={(event) => {
|
||||||
|
runAppSearch(event)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
*/}
|
||||||
|
{prioritizedApps.map((app, index) => {
|
||||||
|
return(
|
||||||
|
<ParsedAppPaper app={app} />
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
{filteredApps.filter(innerapp => !internalIds.includes(innerapp.id)).map((app, index) => {
|
||||||
|
return(
|
||||||
|
<ParsedAppPaper app={app} />
|
||||||
|
)
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -3347,6 +3363,7 @@ const AngularWorkflow = (props) => {
|
|||||||
overflow: "scroll",
|
overflow: "scroll",
|
||||||
overflowX: "auto",
|
overflowX: "auto",
|
||||||
overflowY: "auto",
|
overflowY: "auto",
|
||||||
|
zIndex: 1000,
|
||||||
}
|
}
|
||||||
|
|
||||||
const setTriggerFolderWrapperMulti = event => {
|
const setTriggerFolderWrapperMulti = event => {
|
||||||
|
|||||||
Reference in New Issue
Block a user