Skip to content

Commit

Permalink
Merge pull request #33445 from dimagi/bmb/b5-bug-report-prelogin
Browse files Browse the repository at this point in the history
[B5] fix issue on prelogin pages with bug report modal throwing error
  • Loading branch information
biyeun authored Sep 7, 2023
2 parents 90ba51b + 484848d commit 1097061
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ hqDefine('hqwebapp/js/bootstrap5/hq-bug-report', [
let self = {};

self.$bugReportModalElement = $('#modalReportIssue');
if (self.$bugReportModalElement.length === 0) {
// If the modal element is not present on the page, don't continue
return;
}

self.bugReportModal = new bootstrap.Modal(self.$bugReportModalElement);
self.$hqwebappBugReportForm = $('#hqwebapp-bugReportForm');
self.$hqwebappBugReportSubmit = $('#bug-report-submit');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
+++
@@ -1,49 +1,58 @@
@@ -1,49 +1,63 @@
-hqDefine('hqwebapp/js/bootstrap3/hq-bug-report', [
- "jquery", "jquery-form/dist/jquery.form.min", "hqwebapp/js/bootstrap3/hq.helpers",
-], function ($) {
Expand Down Expand Up @@ -32,6 +32,11 @@
- $emailFormGroup.removeClass('has-error has-feedback');
- $emailFormGroup.find(".label-danger").addClass('hide');
+ self.$bugReportModalElement = $('#modalReportIssue');
+ if (self.$bugReportModalElement.length === 0) {
+ // If the modal element is not present on the page, don't continue
+ return;
+ }
+
+ self.bugReportModal = new bootstrap.Modal(self.$bugReportModalElement);
+ self.$hqwebappBugReportForm = $('#hqwebapp-bugReportForm');
+ self.$hqwebappBugReportSubmit = $('#bug-report-submit');
Expand Down Expand Up @@ -91,7 +96,7 @@
return false;
}
}
@@ -51,57 +60,61 @@
@@ -51,57 +65,61 @@
return false;
}

Expand Down

0 comments on commit 1097061

Please sign in to comment.