From e2af992d43bd80edbdb6ea16990739b257394181 Mon Sep 17 00:00:00 2001 From: Carrie Hanscom Date: Wed, 10 Jan 2024 09:50:25 -0500 Subject: [PATCH] LEAF 3428 start menu, step dropdown, FIX dialogController off specificity --- .../admin/templates/mod_workflow.tpl | 116 +++++++++++------- LEAF_Request_Portal/js/dialogController.js | 2 +- 2 files changed, 72 insertions(+), 46 deletions(-) diff --git a/LEAF_Request_Portal/admin/templates/mod_workflow.tpl b/LEAF_Request_Portal/admin/templates/mod_workflow.tpl index 272aaa11a..1e1e6a9bf 100644 --- a/LEAF_Request_Portal/admin/templates/mod_workflow.tpl +++ b/LEAF_Request_Portal/admin/templates/mod_workflow.tpl @@ -1,33 +1,45 @@ - -
+
+ +
+
@@ -921,7 +933,7 @@ success: function(res) { let buffer = ''; buffer = ''; - buffer += '
'; var reservedDependencies = [-3, -2, -1, 1, 8]; var maskedDependencies = [5]; @@ -947,11 +959,13 @@ buffer += '
'; buffer += - '



If a requirement does not exist: Create a new requirement
'; + '


If a requirement does not exist:
'; $('#dependencyList').html(buffer); - $('#dependencyID').chosen({disable_search_threshold: 5}); - + $('#xhrDialog').css('overflow', 'visible'); + $('#dependencyID').chosen({ + disable_search_threshold: 5 + }); $('#dependencyID_chosen input.chosen-search-input').attr('role', 'combobox'); $('#dependencyID_chosen input.chosen-search-input').attr('aria-labelledby', 'requirements_label'); dialog.setSaveHandler(function() { @@ -1455,7 +1469,7 @@ first.addEventListener('keydown', actionTabbing); last.addEventListener('keydown', actionTabbing); } - $('*#closeModal').on('click', ()=> { + $('#closeModal').on('click', ()=> { $('.workflowStepInfo').css('display', 'none'); $('#stepInfo_' + stepID).html(""); }); @@ -1824,7 +1838,7 @@ stepID + ')">Email Reminder
'; $('#stepInfo_' + stepID).html(output); - $('*#closeModal').on('click', ()=> { + $('#closeModal').on('click', ()=> { $('.workflowStepInfo').css('display', 'none'); $('#stepInfo_' + stepID).html(""); }); @@ -2014,14 +2028,6 @@ var currentWorkflow = 0; function loadWorkflow(workflowID) { - $('#btn_createStep').css('display', 'block'); - $('#btn_deleteWorkflow').css('display', 'block'); - $('#btn_listActionType').css('display', 'block'); - $('#btn_listEvents').css('display', 'block'); - $('#btn_viewHistory').css('display', 'block'); - $('#btn_renameWorkflow').css('display', 'block'); - $('#btn_duplicateWorkflow').css('display', 'block'); - currentWorkflow = workflowID; jsPlumb.reset(); endPoints = []; @@ -2124,6 +2130,7 @@ $('#workflow').css('height', 300 + maxY + 'px'); drawRoutes(workflowID); + buildStepList(steps) }, error: (err) => console.log(err), cache: false @@ -2183,6 +2190,25 @@ }); } + function buildStepList(steps = {}) { + let output = ''; + $('#stepList').html(output); + $('#workflow_steps').chosen({ + disable_search_threshold: 5, + width: '100%' + }); + $('#workflow_steps_chosen input.chosen-search-input').attr('role', 'combobox'); + $('#workflow_steps_chosen input.chosen-search-input').attr('aria-labelledby', 'steps_label'); + } + function viewHistory() { $('.workflowStepInfo').css('display', 'none'); dialog_simple.setContent(''); diff --git a/LEAF_Request_Portal/js/dialogController.js b/LEAF_Request_Portal/js/dialogController.js index 34595ff6d..34eccd54d 100644 --- a/LEAF_Request_Portal/js/dialogController.js +++ b/LEAF_Request_Portal/js/dialogController.js @@ -231,7 +231,7 @@ dialogController.prototype.clearValidators = function() { this.validatorErrors = {}; this.requirements = {}; this.requirementErrors = {}; - $('input[type="text"]').off(); + $('#' + this.containerID + ' input[type="text"]').off(); }; dialogController.prototype.setSubmitValid = function(id, func) {