Skip to content

Commit

Permalink
Merge pull request #2224 from department-of-veterans-affairs/enhance/…
Browse files Browse the repository at this point in the history
…LEAF-4111/gridInput_file_cleanup

LEAF 4111 gridInput file cleanup
  • Loading branch information
Pelentan authored Nov 21, 2023
2 parents 24ef710 + 1091bc2 commit ecf68df
Show file tree
Hide file tree
Showing 3 changed files with 203 additions and 515 deletions.
32 changes: 6 additions & 26 deletions LEAF_Request_Portal/admin/templates/mod_form.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,12 @@ function makeGrid(columns) {
}
$(gridBodyElement + ' > div:eq(' + i + ')').css('padding-bottom', '11px');
if($(gridBodyElement + ' > div:eq(' + i + ') > span.dropdown').length === 0){
$(gridBodyElement + ' > div:eq(' + i + ')').append('<span class="dropdown"><div>One option per line</div><textarea aria-label="Dropdown options, one option per line" style="width: 153px; resize: none;"value="">' + options + '</textarea></span>');
$(gridBodyElement + ' > div:eq(' + i + ')').append(
`<span class="dropdown">
<div>One option per line</div>
<textarea aria-label="Dropdown options, one option per line" style="width: 153px; resize: none;"value="">${options}</textarea>
</span>`
);
}
}
if(gridJSON[i].type.toString() === 'dropdown_file') {
Expand Down Expand Up @@ -1691,31 +1696,6 @@ function gridDropdown(dropDownOptions){
return returnArray;
}
/**
* Purpose: Create Array for Multi-Select Options
* @param multiSelectOptions
* @returns {[]|*}
*/
function gridMultiselect(multiSelectOptions){
if(multiSelectOptions == null || multiSelectOptions.length === 0){
return multiSelectOptions;
}
let uniqueNames = multiSelectOptions.split("\n");
let returnArray = [];
uniqueNames = uniqueNames.filter(function(elem, index, self) {
return index == self.indexOf(elem);
});
$.each(uniqueNames, function(i, el){
if(el === "no") {
uniqueNames[i] = "No";
}
returnArray.push(uniqueNames[i]);
});
return returnArray;
}
/**
* Purpose: Create Array for Multi-Answer Text
* @param multiAnswerValue
Expand Down
Loading

0 comments on commit ecf68df

Please sign in to comment.