shaffuru files sync

This commit is contained in:
Lalit Deore
2026-05-07 15:27:32 +05:30
parent 0bc92c9fa7
commit 4cff6addde
54 changed files with 5857 additions and 3687 deletions
+24 -14
View File
@@ -4458,7 +4458,7 @@ const AppCreator = (defaultprops) => {
const hasFile = (data["file_field"] !== undefined && data["file_field"] !== null && data["file_field"].length > 0) || data["example_response"] === "shuffle_file_download"
if (data?.action_label[0] !== 'No Label') {
console.log("Action label: ", data?.name, data?.action_label)
//console.log("Action label: ", data?.name, data?.action_label)
}
var currentActionLabels = JSON.parse(JSON.stringify(actionLabels))
@@ -4478,7 +4478,7 @@ const AppCreator = (defaultprops) => {
}
if (!found) {
console.log(`Not found: '${label}' in ${currentActionLabels}`)
//console.log(`Not found: '${label}' in ${currentActionLabels}`)
currentActionLabels.push(data?.action_label[labelKey])
}
}
@@ -4575,22 +4575,32 @@ const AppCreator = (defaultprops) => {
if (e.target.value.length === 0) {
e.target.value = ["No Label"]
}
const foundIndex = actions.findIndex((action) => action.name === data.name)
if (foundIndex !== undefined && foundIndex !== null && foundIndex >= 0) {
if (e.target.value.includes("no_label") || e.target.value.includes("No_Label") || e.target.value.includes("No Label")) {
actions[foundIndex].action_label = ["No Label"]
setActions(actions)
setUpdate(Math.random())
return
} else if (e.target.value.length >= 1) {
var foundother = false
for (var labelkey in e.target.value) {
const label = e.target.value[labelkey]
if (label !== "no_label" && label !== "No_Label" && label !== "No Label") {
foundother = true
break
}
}
console.log("Should change: ", e.target.value, " Index: ", index)
actions[foundIndex].action_label = e.target.value
if (foundother) {
e.target.value = e.target.value.filter(label => label !== "no_label" && label !== "No_Label" && label !== "No Label")
} else {
e.target.value = ["No Label"]
}
}
const foundActionIndex = actions.findIndex((action) => action.name === data.name)
if (foundActionIndex !== undefined && foundActionIndex !== null && foundActionIndex >= 0) {
actions[foundActionIndex].action_label = e.target.value
setActions(actions)
setUpdate(Math.random())
} else {
console.log("Could not find action: ", data.name)
}
}}
value={data?.action_label}