From 79af6ed3f9e91abafbd1a57219963f2c7f77fb82 Mon Sep 17 00:00:00 2001 From: Anton Tranelis <31516529+antontranelis@users.noreply.github.com> Date: Tue, 9 Sep 2025 21:38:02 +0200 Subject: [PATCH] fix(backend): extended flows (#374) * extended flows * redeactivated flows * Update flows.json * fix id * fix update_user operations * fix flows --- .../development/collections/flows.json | 4 +- .../development/collections/operations.json | 162 +++++++++--------- .../development/collections/presets.json | 103 ----------- 3 files changed, 86 insertions(+), 183 deletions(-) diff --git a/backend/directus-config/development/collections/flows.json b/backend/directus-config/development/collections/flows.json index 83d35968..d72a202a 100644 --- a/backend/directus-config/development/collections/flows.json +++ b/backend/directus-config/development/collections/flows.json @@ -81,10 +81,10 @@ "_syncId": "6a48c246-2fb2-42ca-bebb-3f605e794d02" }, { - "name": "Ocean Nomads: Create Location", + "name": "Ocean Nomads: Create Location or Home", "icon": "sailing", "color": "#2ECDA7", - "description": "Creates Nomads Current Location", + "description": "Creates Nomads Current Location or Home", "status": "inactive", "trigger": "event", "accountability": "all", diff --git a/backend/directus-config/development/collections/operations.json b/backend/directus-config/development/collections/operations.json index 678b130a..8eb4b1bd 100644 --- a/backend/directus-config/development/collections/operations.json +++ b/backend/directus-config/development/collections/operations.json @@ -45,7 +45,7 @@ "name": "Condition", "key": "condition_ljedr", "type": "condition", - "position_x": 74, + "position_x": 54, "position_y": 1, "options": { "filter": { @@ -122,9 +122,18 @@ "filter": { "$trigger": { "payload": { - "layer": { - "_eq": "bc55bd85-a357-47e0-8bb7-d49063548ac2" - } + "_or": [ + { + "layer": { + "_eq": "98f4cd2f-e1ce-4db8-bb16-f4bbf3d6991a" + } + }, + { + "layer": { + "_eq": "4f22c074-a5c0-47a3-9e76-2bb76eb2e362" + } + } + ] } } } @@ -413,7 +422,7 @@ "options": { "payload": { "name": "{{$trigger.payload.first_name}} {{$trigger.payload.last_name}}", - "layer": "91bc3d4f-1851-4cd9-abd9-ab95a6a596a5", + "layer": "4f22c074-a5c0-47a3-9e76-2bb76eb2e362", "extended": { "external_profile_id": "{{$trigger.payload.id}}" }, @@ -436,17 +445,17 @@ "position_x": 53, "position_y": 18, "options": { - "permissions": "$full", - "emitEvents": false, "payload": { "name": "{{$trigger.payload.first_name}} {{$trigger.payload.last_name}}", - "layer": "91bc3d4f-1851-4cd9-abd9-ab95a6a596a5", + "layer": "4f22c074-a5c0-47a3-9e76-2bb76eb2e362", "extended": { "external_profile_id": "{{$trigger.payload.id}}" }, "image_external": "{{$trigger.payload.avatar_url}}" }, - "collection": "items" + "collection": "items", + "emitEvents": false, + "permissions": "$full" }, "resolve": "fc07cebb-9577-41a2-9c1c-d2ee873b112d", "reject": null, @@ -464,7 +473,7 @@ "end": "{{$trigger.payload.end}}", "name": "{{$trigger.payload.title}}", "text": "{{exec_p5p4r.text}}", - "layer": "7c40ddfa-bc7e-46cb-9580-c8cf6b867377", + "layer": "5b9f713c-74b6-4dcc-a4d0-c7893b267d6e", "start": "{{$trigger.payload.start}}", "position": "{{$last.data.features[0].geometry}}" }, @@ -488,7 +497,7 @@ "end": "{{$trigger.payload.end}}", "name": "{{$trigger.payload.title}}", "text": "{{exec_p5p4r.text}}", - "layer": "7c40ddfa-bc7e-46cb-9580-c8cf6b867377", + "layer": "5b9f713c-74b6-4dcc-a4d0-c7893b267d6e", "start": "{{$trigger.payload.start}}" }, "collection": "items", @@ -556,7 +565,7 @@ "_and": [ { "layer": { - "_eq": "91bc3d4f-1851-4cd9-abd9-ab95a6a596a5" + "_eq": "4f22c074-a5c0-47a3-9e76-2bb76eb2e362" } }, { @@ -583,14 +592,12 @@ "position_x": 73, "position_y": 1, "options": { - "permissions": "$full", - "emitEvents": false, "query": { "filter": { "_and": [ { "layer": { - "_eq": "bc55bd85-a357-47e0-8bb7-d49063548ac2" + "_eq": "98f4cd2f-e1ce-4db8-bb16-f4bbf3d6991a" } }, { @@ -601,7 +608,9 @@ ] } }, - "collection": "items" + "collection": "items", + "emitEvents": false, + "permissions": "$full" }, "resolve": "d6eb9087-481b-407c-af0d-bc37527d0fc4", "reject": null, @@ -697,7 +706,7 @@ "position_x": 19, "position_y": 1, "options": { - "permissions": "$trigger", + "permissions": "$full", "emitEvents": false, "collection": "oceannomads_profiles", "key": [ @@ -796,7 +805,7 @@ "position_x": 37, "position_y": 1, "options": { - "permissions": "$trigger", + "permissions": "$full", "emitEvents": false, "collection": "directus_users", "key": [ @@ -859,38 +868,6 @@ "flow": "a78d01a4-13b3-46a4-8938-9606bf26e329", "_syncId": "810b13ca-f884-4b1d-84db-8f71ed067337" }, - { - "name": "Read Data", - "key": "item_read_soekq", - "type": "item-read", - "position_x": 56, - "position_y": 1, - "options": { - "query": { - "filter": { - "_and": [ - { - "layer": { - "_eq": "91bc3d4f-1851-4cd9-abd9-ab95a6a596a5" - } - }, - { - "user_created": { - "_eq": "{{$last[0].id}}" - } - } - ] - } - }, - "collection": "items", - "emitEvents": false, - "permissions": "$trigger" - }, - "resolve": "7e647ad3-8a87-43c6-aee3-08600f0382e0", - "reject": null, - "flow": "cb772a2c-150c-4cca-bc2c-1f8498a5cd92", - "_syncId": "31bdf2e1-23f2-41e5-b40b-8e9076065119" - }, { "name": "Read Data", "key": "item_read_ym92c", @@ -910,7 +887,7 @@ }, "key": [] }, - "resolve": "31bdf2e1-23f2-41e5-b40b-8e9076065119", + "resolve": "7e647ad3-8a87-43c6-aee3-08600f0382e0", "reject": null, "flow": "cb772a2c-150c-4cca-bc2c-1f8498a5cd92", "_syncId": "840b0278-ff8a-4f2f-bf67-c75a2e7e00b6" @@ -963,7 +940,7 @@ "name": "Update Nomads Current Location", "key": "item_update_5eu19", "type": "item-update", - "position_x": 146, + "position_x": 129, "position_y": 1, "options": { "key": [], @@ -972,7 +949,7 @@ "_and": [ { "layer": { - "_eq": "bc55bd85-a357-47e0-8bb7-d49063548ac2" + "_eq": "98f4cd2f-e1ce-4db8-bb16-f4bbf3d6991a" } }, { @@ -1000,8 +977,8 @@ "name": "Update Nomads Current Location", "key": "item_update_5eu19_prdze", "type": "item-update", - "position_x": 139, - "position_y": 18, + "position_x": 119, + "position_y": 17, "options": { "key": [], "query": { @@ -1009,7 +986,7 @@ "_and": [ { "layer": { - "_eq": "bc55bd85-a357-47e0-8bb7-d49063548ac2" + "_eq": "98f4cd2f-e1ce-4db8-bb16-f4bbf3d6991a" } }, { @@ -1105,7 +1082,7 @@ "name": "Update Nomads User", "key": "item_update_e3pl5", "type": "item-update", - "position_x": 127, + "position_x": 110, "position_y": 1, "options": { "permissions": "$full", @@ -1128,8 +1105,8 @@ "name": "Update Nomads User", "key": "item_update_e3pl5_wansj", "type": "item-update", - "position_x": 119, - "position_y": 18, + "position_x": 100, + "position_y": 17, "options": { "permissions": "$full", "emitEvents": false, @@ -1140,7 +1117,8 @@ "payload": { "first_name": "{{item_read_i7dz7.first_name}} {{item_read_i7dz7.last_name}}", "email": "{{item_read_i7dz7.email}}" - } + }, + "query": null }, "resolve": "4dc368cc-6fc1-411e-b0f0-b39490c3efe0", "reject": null, @@ -1151,20 +1129,34 @@ "name": "Update Nomads Home", "key": "item_update_o6cn8", "type": "item-update", - "position_x": 109, + "position_x": 91, "position_y": 1, "options": { "permissions": "$full", "emitEvents": false, - "collection": "items", - "key": [ - "{{item_read_soekq[0].id}}" - ], + "key": [], + "query": { + "filter": { + "_and": [ + { + "layer": { + "_eq": "4f22c074-a5c0-47a3-9e76-2bb76eb2e362" + } + }, + { + "user_created": { + "_eq": "{{item_read_ym92c[0].id}}" + } + } + ] + } + }, "payload": { "name": "{{item_read_i7dz7.first_name}} {{item_read_i7dz7.last_name}}", - "position": "{{$last.data.features[0].geometry}}", - "image_external": "{{item_read_i7dz7.avatar_url}}" - } + "image_external": "{{item_read_i7dz7.avatar_url}}", + "position": "{{$last.data.features[0].geometry}}" + }, + "collection": "items" }, "resolve": "e7b3b7b8-c34a-4024-8aa4-d7d4687d6752", "reject": null, @@ -1175,20 +1167,34 @@ "name": "Update Nomads Home", "key": "item_update_o6cn8_nitpl", "type": "item-update", - "position_x": 99, - "position_y": 18, + "position_x": 81, + "position_y": 17, "options": { "permissions": "$full", "emitEvents": false, - "collection": "items", - "key": [ - "{{item_read_soekq[0].id}}" - ], + "key": [], + "query": { + "filter": { + "_and": [ + { + "layer": { + "_eq": "4f22c074-a5c0-47a3-9e76-2bb76eb2e362" + } + }, + { + "user_created": { + "_eq": "{{item_read_ym92c[0].id}}" + } + } + ] + } + }, "payload": { "name": "{{item_read_i7dz7.first_name}} {{item_read_i7dz7.last_name}}", - "image_external": "{{item_read_i7dz7.avatar_url}}", - "position": null - } + "position": null, + "image_external": "{{item_read_i7dz7.avatar_url}}" + }, + "collection": "items" }, "resolve": "b22755ba-4ec5-4e04-a3fe-a390a9bc75ab", "reject": null, @@ -1407,7 +1413,7 @@ "name": "Webhook / Request URL", "key": "request_hfzgd", "type": "request", - "position_x": 92, + "position_x": 73, "position_y": 1, "options": { "method": "GET", diff --git a/backend/directus-config/development/collections/presets.json b/backend/directus-config/development/collections/presets.json index fbab7234..aabcbfcd 100644 --- a/backend/directus-config/development/collections/presets.json +++ b/backend/directus-config/development/collections/presets.json @@ -29,69 +29,6 @@ "color": null, "_syncId": "053f9b93-aa94-4ad8-b64e-babb69f0ea6c" }, - { - "bookmark": null, - "role": null, - "collection": "layers", - "search": "", - "layout": "tabular", - "layout_query": { - "tabular": { - "page": 1, - "fields": [ - "sort", - "menuColor", - "name", - "itemType.name", - "maps.maps_id.name" - ], - "sort": [ - "sort" - ] - } - }, - "layout_options": { - "tabular": { - "widths": { - "sort": 92, - "menuColor": 41.5, - "itemType.name": 235, - "maps.maps_id.name": 248 - }, - "spacing": "compact" - } - }, - "refresh_interval": null, - "filter": null, - "icon": "bookmark", - "color": null, - "_syncId": "0b2cc1ac-347b-438c-874e-6190c8ea0ef6" - }, - { - "bookmark": null, - "role": null, - "collection": "layers", - "search": "", - "layout": "tabular", - "layout_query": { - "tabular": { - "page": 1 - } - }, - "layout_options": { - "tabular": { - "widths": { - "maps.maps_id.name": 1003.888916015625 - }, - "spacing": "compact" - } - }, - "refresh_interval": null, - "filter": null, - "icon": "bookmark", - "color": null, - "_syncId": "1b452db1-8add-4a5e-948d-b380d99121c3" - }, { "bookmark": null, "role": null, @@ -183,45 +120,5 @@ "icon": "bookmark", "color": null, "_syncId": "3789cfe7-78f9-428e-9770-d8e1c5de1145" - }, - { - "bookmark": null, - "role": null, - "collection": "layers", - "search": "", - "layout": "tabular", - "layout_query": { - "tabular": { - "page": 1, - "fields": [ - "sort", - "markerIcon.image.$thumbnail", - "menuColor", - "name", - "itemType.name", - "maps.maps_id.name" - ], - "sort": [ - "sort" - ] - } - }, - "layout_options": { - "tabular": { - "widths": { - "sort": 91.5, - "markerIcon.image.$thumbnail": 58, - "menuColor": 65.5, - "itemType.name": 235, - "maps.maps_id.name": 248 - }, - "spacing": "compact" - } - }, - "refresh_interval": null, - "filter": null, - "icon": "bookmark", - "color": null, - "_syncId": "85c6dba0-1906-4c16-a245-4a8eab8a6855" } ]