From 6147e5b8c1482c58354020337a327a9ea5e28e64 Mon Sep 17 00:00:00 2001 From: Carrie Hanscom Date: Wed, 10 Jan 2024 12:13:30 -0500 Subject: [PATCH] LEAF 3428 add initial connection methods --- .../admin/templates/mod_form.tpl | 5 +- .../admin/templates/mod_workflow.tpl | 66 ++++++++++++++++--- 2 files changed, 59 insertions(+), 12 deletions(-) diff --git a/LEAF_Request_Portal/admin/templates/mod_form.tpl b/LEAF_Request_Portal/admin/templates/mod_form.tpl index 286c1989b..70cae2661 100644 --- a/LEAF_Request_Portal/admin/templates/mod_form.tpl +++ b/LEAF_Request_Portal/admin/templates/mod_form.tpl @@ -1377,10 +1377,9 @@ function getForm(indicatorID, series) { type: 'GET', url: '../api/form/_' + currCategoryID + '/flat', success: function(res) { - const shortName = (name = "") => { - const maxLen = 65; + const shortName = (name = "", len = 50) => { const displayName = XSSHelpers.stripAllTags(name || "").trim(); - return displayName.length <= maxLen ? displayName : displayName.slice(0, maxLen) + '...'; + return displayName.length <= len ? displayName : displayName.slice(0, len) + '...'; } let buffer = ''; - output += ''; + const stepKeys = Object.keys(steps); + let step_options = "" + stepKeys.forEach(k => { + step_options += ``; + }); + output += `
+ Options +
+
+ + +
+
+ + +
+
+
`; // button options for steps output += '
'; @@ -1873,11 +1911,11 @@ } position = $('#step_' + stepID).offset(); - width = $('#step_' + stepID).width(); + height = $('#step_' + stepID).height(); $('#stepInfo_' + stepID).css({ - left: position.left + width + 'px', - top: position.top + 'px' + left: position.left + 'px', + top: position.top + height + 20 + 'px' }); $('#stepInfo_' + stepID).show('slide', null, 200); } @@ -2207,6 +2245,16 @@ }); $('#workflow_steps_chosen input.chosen-search-input').attr('role', 'combobox'); $('#workflow_steps_chosen input.chosen-search-input').attr('aria-labelledby', 'steps_label'); + $('#workflow_steps').on('change', function() { + showStepInfo($('#workflow_steps').val()); + }); + $('#workflow_steps + .chosen-container').on('keydown', function(event) { + const code = (event?.code || "").toLowerCase() + if (code === 'space') { + event.preventDefault(); + showStepInfo($('#workflow_steps').val()); + } + }); } function viewHistory() {