@@ -1010,45 +934,61 @@ const modalView = notificationWorkflowModal ? (
) : null
+ const checkIfAlreadyGenerated = async (appList, workflows) => { // fixxxxxxxxxxxxxxxxxxxxx
+
+ var workflowName = workflows.find(workflow => workflow.id === notificationWorkflow)
+ if (workflowName) {
+ workflowName = workflowName.name
+ }
+ else {
+ console.log("no workflow set")
+ return
+ }
+ if (workflowName) {
+ const parts = workflowName.split(' ');
+ console.log("parts", parts)
+ if (parts[0].toString() === "[GENERATED]" && parts.length > 1) {
+ console.log("parts1", parts[1])
+ if ((appList.includes(parts[1]))) {
+ console.log("workflow already generated")
+ setGeneatedWorkflow({"app_name": parts[1]})
+ }
+ }
+ }
+ else {
+ return
+ }
+ }
+
const renderChips = (apps) => {
-if (!apps || apps.length === 0) {
- return (
- {
- console.log(`Clicked EMAIL`)
- setSelectedAppDetails("email")
- setNotificationWorkflowModal(true)
- // setNotificationWorkflowModal(true)
- }}
- avatar={
}
- />
- )
-}
+ return (
+
+ {apps.map((app) => (
+ {
+ console.log(`Clicked ${app.name}`)
+ console.log("app: ",app)
+ setSelectedAppDetails(app)
+ if (app.authentication_data && app.authentication_data.length > 0){ //fixxxxxxxx
+ console.log("authdata: ",app.authentication_data[0])
+ setSelectedAuth(app.authentication_data[app.authentication_data.length-1].id)
+ }
+ setNotificationWorkflowModal(true)
+ // getAppAuth(app.name)
+ console.log("selectedAppDEtails",selectedAppDetails)
+ }}
+ avatar={
}
-return (
-
- {apps.map((app) => (
- {
- console.log(`Clicked ${app.name}`)
- setSelectedAppDetails(app)
- setNotificationWorkflowModal(true)
- // getAppAuth(app.name)
- console.log("selectedAppDEtails",selectedAppDetails)
- }}
- avatar={
}
- />
- ))}
-
-);
+ />
+ ))}
+
+ );
};
-
return (
@@ -1058,12 +998,8 @@ return (
{modalView}
{/*{testWorkflowModal} */}
- {renderChips(notificationAppDetails)}
- {/*
-
- Add a Workflow that receives notifications from Shuffle when an error occurs in one of your workflows
-
- */}
+ {renderChips(notificationAppDetails.length > 0 ? notificationAppDetails : emailData)}
+
{workflows !== undefined && workflows !== null && workflows.length > 0 ?