Skip to content

Commit 3632801

Browse files
authoredMar 7, 2025
Merge pull request #1247 from NASA-IMPACT/1246-minor-enhancement-document-type-pattern-form-require-document-type-or-show-appropriate-error
Minor Enhancement: Document Type Pattern Form – Require Document Type or Show Appropriate Error
2 parents a173a80 + baedb88 commit 3632801

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
 

‎CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,9 @@ For each PR made, an entry should be added to this changelog. It should contain
113113
- Changes:
114114
- Added `escapeHtml` function in the `delta_url_list.js` file to handle special character escaping correctly.
115115
- Called this function while retrieving the titles in `getGeneratedTitleColumn()` and `getCuratedGeneratedTitleColumn()` functions.
116+
117+
- 1246-minor-enhancement-document-type-pattern-form-require-document-type-or-show-appropriate-error
118+
- Description: In the Document Type Pattern Form, if the user does not select a Document Type while filling out the form, an appropriate error message is displayed.
119+
- Changes:
120+
- Added a JavaScript validation check on form submission to ensure the document type (stored in a hidden input) is not empty.
121+
- Display an error message and prevent form submission if the field is empty.

‎sde_indexing_helper/static/js/delta_url_list.js

+6
Original file line numberDiff line numberDiff line change
@@ -2075,6 +2075,12 @@ $("#document_type_pattern_form").on("submit", function (e) {
20752075
inputs[field.name] = field.value;
20762076
});
20772077

2078+
// Validate that the document_type_pattern field is not empty
2079+
if (!inputs.document_type_pattern) {
2080+
toastr.error("Please select a Document Type");
2081+
return; // Prevent form submission
2082+
}
2083+
20782084
postDocumentTypePatterns(
20792085
inputs.match_pattern,
20802086
inputs.match_pattern_type,

0 commit comments

Comments
 (0)