Changed the UI for the Workflow revisions
This commit is contained in:
@@ -2094,12 +2094,14 @@ const releaseToConnectLabel = "Release to Connect"
|
|||||||
}
|
}
|
||||||
|
|
||||||
setWorkflow(workflow);
|
setWorkflow(workflow);
|
||||||
|
setSelectedRevision(workflow);
|
||||||
}
|
}
|
||||||
|
|
||||||
setSavingState(1);
|
setSavingState(1);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setSavingState(0);
|
setSavingState(0);
|
||||||
}, 1500);
|
}, 1500);
|
||||||
|
getRevisionHistory(useworkflow.id)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -17027,6 +17029,10 @@ const releaseToConnectLabel = "Release to Connect"
|
|||||||
style={{ height: 50, marginLeft: 10 }}
|
style={{ height: 50, marginLeft: 10 }}
|
||||||
variant={"outlined"}
|
variant={"outlined"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
if(!lastSaved){
|
||||||
|
toast("Save the workflow first")
|
||||||
|
return
|
||||||
|
}
|
||||||
setShowWorkflowRevisions(true)
|
setShowWorkflowRevisions(true)
|
||||||
setSelectedRevision(workflow)
|
setSelectedRevision(workflow)
|
||||||
//setOriginalWorkflow(workflow)
|
//setOriginalWorkflow(workflow)
|
||||||
@@ -21336,13 +21342,11 @@ const releaseToConnectLabel = "Release to Connect"
|
|||||||
|
|
||||||
const RevisionBox = (props) => {
|
const RevisionBox = (props) => {
|
||||||
const { revision, } = props
|
const { revision, } = props
|
||||||
|
if (revision === undefined || revision === null) {
|
||||||
if (revision === undefined || revision === null || revision === {}) {
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
var newrevision = JSON.parse(JSON.stringify(revision))
|
var newrevision = JSON.parse(JSON.stringify(revision))
|
||||||
|
|
||||||
// Make unix timestamp into ISO timestamp in the format July 27th, 3:05 AM
|
// Make unix timestamp into ISO timestamp in the format July 27th, 3:05 AM
|
||||||
// Format: July 27th, 3:05 AM
|
// Format: July 27th, 3:05 AM
|
||||||
//console.log("Edited time: ", revision.edited)
|
//console.log("Edited time: ", revision.edited)
|
||||||
@@ -21402,9 +21406,9 @@ const releaseToConnectLabel = "Release to Connect"
|
|||||||
setElements([])
|
setElements([])
|
||||||
}
|
}
|
||||||
|
|
||||||
// // Remove all edges
|
// Remove all edges
|
||||||
// cy.edges().remove()
|
cy.edges().remove()
|
||||||
// cy.nodes().remove()
|
cy.nodes().remove()
|
||||||
|
|
||||||
// Remove all cy nodes
|
// Remove all cy nodes
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -21456,6 +21460,7 @@ const releaseToConnectLabel = "Release to Connect"
|
|||||||
<span style={{flex: 5, }}>
|
<span style={{flex: 5, }}>
|
||||||
<Typography variant="body1">
|
<Typography variant="body1">
|
||||||
{translatedDate}
|
{translatedDate}
|
||||||
|
{/* {newrevision.edited.toString().slice(6,10)} | {newrevision.revision_id.slice(0,5)} */}
|
||||||
</Typography>
|
</Typography>
|
||||||
</span>
|
</span>
|
||||||
<span style={{flex: 2, }}>
|
<span style={{flex: 2, }}>
|
||||||
@@ -21538,20 +21543,42 @@ const releaseToConnectLabel = "Release to Connect"
|
|||||||
</Paper>
|
</Paper>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
//! Logs
|
||||||
const drawerData = originalWorkflow !== undefined && originalWorkflow !== null && originalWorkflow !== {} ?
|
console.log("Selected Revision", selectedRevision)
|
||||||
<div style={{padding: "0px 25px 100px 25px", }}>
|
console.log("Workflow state", workflow)
|
||||||
<Typography variant="h6" style={{marginTop: 10, marginBottom: 15, }}>
|
console.log("All revision", allRevisions)
|
||||||
|
const drawerData = originalWorkflow !== undefined && originalWorkflow !== null ?
|
||||||
|
<div style={{ height: "100%"}}>
|
||||||
|
<Typography variant="h5" style={{ paddingLeft: 25, paddingTop:25, backgroundColor: theme.palette.surfaceColor, height: "8%" }}>
|
||||||
Version History (Beta)
|
Version History (Beta)
|
||||||
</Typography>
|
</Typography>
|
||||||
|
<div style={{height: "92%" }}>
|
||||||
|
<div style={{paddingLeft: "25px", paddingRight: "25px", paddingTop: "10px"}}>
|
||||||
|
<div style={{marginBottom: "20px", }}>
|
||||||
|
<Typography variant="h6" style={{marginTop: 10, marginBottom: 5, }}>
|
||||||
|
Current Version
|
||||||
|
</Typography>
|
||||||
<RevisionBox
|
<RevisionBox
|
||||||
revision={originalWorkflow}
|
revision={selectedRevision}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Divider
|
||||||
|
style={{
|
||||||
|
marginBottom: 15,
|
||||||
|
height: 1,
|
||||||
|
width: "100%",
|
||||||
|
backgroundColor: "rgb(91, 96, 100)",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{allRevisions.length > 0 ?
|
{allRevisions.length > 0 ?
|
||||||
|
<div style={{overflow: "auto", width: "100%" , height: "75%", paddingLeft: "25px", paddingRight: "20px", paddingTop: "10px", paddingBottom: "10px"}}>
|
||||||
|
{
|
||||||
allRevisions.map((revision, index) => {
|
allRevisions.map((revision, index) => {
|
||||||
if (revision.edited === originalWorkflow.edited) {
|
if(revision.edited === selectedRevision.edited){
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21563,6 +21590,9 @@ const releaseToConnectLabel = "Release to Connect"
|
|||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
:
|
:
|
||||||
<div style={{padding: 5, }}>
|
<div style={{padding: 5, }}>
|
||||||
<Typography variant="body2">
|
<Typography variant="body2">
|
||||||
@@ -21571,6 +21601,7 @@ const releaseToConnectLabel = "Release to Connect"
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
: null
|
: null
|
||||||
|
|
||||||
const workflowRevisions = !showWorkflowRevisions ? null :
|
const workflowRevisions = !showWorkflowRevisions ? null :
|
||||||
@@ -21581,7 +21612,7 @@ const releaseToConnectLabel = "Release to Connect"
|
|||||||
onClose={() => {
|
onClose={() => {
|
||||||
//setShowWorkflowRevisions(false)
|
//setShowWorkflowRevisions(false)
|
||||||
}}
|
}}
|
||||||
style={{ resize: "both", overflow: "auto", zIndex: 10005 }}
|
style={{ resize: "both", overflow: "hidden", zIndex: 10005 }}
|
||||||
hideBackdrop={true}
|
hideBackdrop={true}
|
||||||
variant="persistent"
|
variant="persistent"
|
||||||
BackdropProps={{
|
BackdropProps={{
|
||||||
@@ -21592,7 +21623,7 @@ const releaseToConnectLabel = "Release to Connect"
|
|||||||
PaperProps={{
|
PaperProps={{
|
||||||
style: {
|
style: {
|
||||||
resize: "both",
|
resize: "both",
|
||||||
overflow: "auto",
|
overflow: "hidden",
|
||||||
minWidth: isMobile ? "100%" : 360,
|
minWidth: isMobile ? "100%" : 360,
|
||||||
maxWidth: isMobile ? "100%" : 360,
|
maxWidth: isMobile ? "100%" : 360,
|
||||||
backgroundColor: theme.palette.platformColor,
|
backgroundColor: theme.palette.platformColor,
|
||||||
@@ -21600,7 +21631,6 @@ const releaseToConnectLabel = "Release to Connect"
|
|||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
zIndex: 15001,
|
zIndex: 15001,
|
||||||
borderRight: theme.palette.defaultBorder,
|
borderRight: theme.palette.defaultBorder,
|
||||||
paddingTop: 15,
|
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user