Fixed that dynamic var name changes in the parameters
This commit is contained in:
@@ -179,7 +179,7 @@ const ParsedAction = (props) => {
|
|||||||
const [activateHidingBodyButton, setActivateHidingBodyButton] = React.useState(false)
|
const [activateHidingBodyButton, setActivateHidingBodyButton] = React.useState(false)
|
||||||
const [appActionName, setAppActionName] = React.useState(selectedAction.label);
|
const [appActionName, setAppActionName] = React.useState(selectedAction.label);
|
||||||
const [delay, setDelay] = React.useState(selectedAction?.execution_delay || 0);
|
const [delay, setDelay] = React.useState(selectedAction?.execution_delay || 0);
|
||||||
|
const [prevActionName, setPrevActionName] = React.useState(selectedAction.label);
|
||||||
const [fieldCount, setFieldCount] = React.useState(0);
|
const [fieldCount, setFieldCount] = React.useState(0);
|
||||||
const [hiddenDescription, setHiddenDescription] = React.useState(true);
|
const [hiddenDescription, setHiddenDescription] = React.useState(true);
|
||||||
const [autoCompleting, setAutocompleting] = React.useState(false);
|
const [autoCompleting, setAutocompleting] = React.useState(false);
|
||||||
@@ -407,6 +407,10 @@ const ParsedAction = (props) => {
|
|||||||
setAppActionName(selectedAction.label);
|
setAppActionName(selectedAction.label);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(selectedAction.label !== prevActionName){
|
||||||
|
setPrevActionName(selectedAction.label)
|
||||||
|
}
|
||||||
|
|
||||||
// Only set delay if it has changed
|
// Only set delay if it has changed
|
||||||
const newDelay = selectedAction?.execution_delay || 0;
|
const newDelay = selectedAction?.execution_delay || 0;
|
||||||
if (newDelay !== delay) {
|
if (newDelay !== delay) {
|
||||||
@@ -1292,7 +1296,6 @@ const ParsedAction = (props) => {
|
|||||||
|
|
||||||
|
|
||||||
const selectedAppIcon = selectedAction.large_image
|
const selectedAppIcon = selectedAction.large_image
|
||||||
var baselabel = selectedAction.label
|
|
||||||
return (
|
return (
|
||||||
<div style={appApiViewStyle} id="parsed_action_view">
|
<div style={appApiViewStyle} id="parsed_action_view">
|
||||||
|
|
||||||
@@ -1611,8 +1614,8 @@ const ParsedAction = (props) => {
|
|||||||
}
|
}
|
||||||
onBlur={(e) => {
|
onBlur={(e) => {
|
||||||
// Copy the name value
|
// Copy the name value
|
||||||
const name = appActionName
|
const name = e.target.value
|
||||||
const parsedBaseLabel = "$"+baselabel.toLowerCase().replaceAll(" ", "_")
|
const parsedBaseLabel = "$"+prevActionName.toLowerCase().replaceAll(" ", "_")
|
||||||
const newname = "$"+name.toLowerCase().replaceAll(" ", "_")
|
const newname = "$"+name.toLowerCase().replaceAll(" ", "_")
|
||||||
|
|
||||||
// Check if it's the same as the current name in use
|
// Check if it's the same as the current name in use
|
||||||
@@ -1741,7 +1744,6 @@ const ParsedAction = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const params = workflow.actions[key].parameters
|
const params = workflow.actions[key].parameters
|
||||||
console.log(params)
|
|
||||||
if (params === null || params === undefined) {
|
if (params === null || params === undefined) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -1765,7 +1767,6 @@ const ParsedAction = (props) => {
|
|||||||
// Need to make sure e.g. changing the first here doesn't change the 2nd
|
// Need to make sure e.g. changing the first here doesn't change the 2nd
|
||||||
// $change_me
|
// $change_me
|
||||||
// $change_me_2
|
// $change_me_2
|
||||||
|
|
||||||
const foundindex = param.value.toLowerCase().indexOf(parsedBaseLabel, previous)
|
const foundindex = param.value.toLowerCase().indexOf(parsedBaseLabel, previous)
|
||||||
if (foundindex === previous && foundindex !== 0) {
|
if (foundindex === previous && foundindex !== 0) {
|
||||||
break
|
break
|
||||||
@@ -1808,7 +1809,7 @@ const ParsedAction = (props) => {
|
|||||||
|
|
||||||
setWorkflow(workflow);
|
setWorkflow(workflow);
|
||||||
setUpdate(Math.random());
|
setUpdate(Math.random());
|
||||||
baselabel = name
|
setPrevActionName(name)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -21607,9 +21607,6 @@ const releaseToConnectLabel = "Release to Connect"
|
|||||||
</Paper>
|
</Paper>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
//! Logs
|
|
||||||
console.log("Workflow state", workflow)
|
|
||||||
console.log("All revision", allRevisions)
|
|
||||||
const drawerData = originalWorkflow !== undefined && originalWorkflow !== null ?
|
const drawerData = originalWorkflow !== undefined && originalWorkflow !== null ?
|
||||||
<div style={{ height: "100%"}}>
|
<div style={{ height: "100%"}}>
|
||||||
<Typography variant="h5" style={{ paddingLeft: 25, paddingTop:25, backgroundColor: theme.palette.surfaceColor, height: "8%" }}>
|
<Typography variant="h5" style={{ paddingLeft: 25, paddingTop:25, backgroundColor: theme.palette.surfaceColor, height: "8%" }}>
|
||||||
|
|||||||
Reference in New Issue
Block a user