From 92fce6f14af73286043e8ec050bf96032802302e Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Thu, 20 Mar 2025 11:02:54 +1100 Subject: [PATCH] wf work --- front/css/app.css | 9 +- front/workflowsCore.php | 194 ++++++++++++++++++++++------------------ 2 files changed, 116 insertions(+), 87 deletions(-) diff --git a/front/css/app.css b/front/css/app.css index a0342a85..4f887860 100755 --- a/front/css/app.css +++ b/front/css/app.css @@ -1891,13 +1891,18 @@ input[readonly] { padding: 10px; } -.workflow-card, .condition-list, .actions-list +.workflow-card, .actions-list { - display: grid; + display: contents; padding: 5px; padding-left: 10px; } +.condition-list +{ + z-index:1; +} + .condition { padding: 5px; diff --git a/front/workflowsCore.php b/front/workflowsCore.php index 5edbeb00..13a27d88 100755 --- a/front/workflowsCore.php +++ b/front/workflowsCore.php @@ -52,6 +52,7 @@ let actionTypes = [ // -------------------------------------- // Retrieve and process the data function getData() { + showSpinner(); getSetting() @@ -60,9 +61,7 @@ function getData() { workflows = res; console.log(workflows); - // Store the updated workflows object back into cache - setCache('workflows', JSON.stringify(workflows)); - + updateWorkflowsJson(workflows); renderWorkflows(); hideSpinner(); }); @@ -75,6 +74,11 @@ function renderWorkflows() { let $container = $("#workflowContainer"); $container.empty(); // Clear previous UI + workflows = getWorkflowsJson(); + + console.log("renderWorkflows"); + console.log(workflows); + $.each(workflows, function (index, wf) { let $wfElement = generateWorkflowUI(wf, index); $container.append($wfElement); @@ -87,14 +91,14 @@ function renderWorkflows() { function generateWorkflowUI(wf, wfIndex) { let $wfContainer = $("
", { - class: "workflow-card box box-solid box-primary panel panel-default", + class: "workflow-card col-sm-12 col-sx-12", id: `wf-${wfIndex}-container` }); // Workflow Name let $wfLinkWrap = $("
", { - class: " ", + class: "box box-solid box-primary ", id: `wf-${wfIndex}-header` } ) @@ -150,7 +154,7 @@ function generateWorkflowUI(wf, wfIndex) { // Trigger Section with dropdowns let $triggerSection = $("
", { - class: "condition-list box box-secondary" + class: "box box-secondary col-sm-12 col-sx-12" } ).append($triggerTitle); @@ -203,7 +207,11 @@ function generateWorkflowUI(wf, wfIndex) { lastActionIndex = 0 $.each(wf.actions, function (actionIndex, action) { let $actionEl = $("
", { - class: "panel" + class: "col-sm-11 col-sx-12" + }); + + let $actionElWrap = $("
", { + class: "panel col-sm-12 col-sx-12" }); // Dropdown for action.field @@ -241,10 +249,10 @@ function generateWorkflowUI(wf, wfIndex) { // Actions - let $actionRemoveButtonWrap = $("
", { class: "button-container col-sm-12 col-sx-12" }); + let $actionRemoveButtonWrap = $("
", { class: "button-container col-sm-1 col-sx-12" }); let $actionRemoveIcon = $("", { - class: "fa-solid fa-minus" + class: "fa-solid fa-trash" }); let $actionRemoveButton = $("