-
-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: disable the Invite Users button until at least one email address has been entered #10136
fix: disable the Invite Users button until at least one email address has been entered #10136
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10136 +/- ##
==========================================
+ Coverage 49.54% 49.65% +0.10%
==========================================
Files 67 71 +4
Lines 20650 20978 +328
Branches 4980 5027 +47
==========================================
+ Hits 10231 10416 +185
- Misses 9131 9270 +139
- Partials 1288 1292 +4 ☔ View full report in Codecov by Sentry. |
<p>[% lang('enter_email_addresses_of_users') %]</p> | ||
<textarea id="email_list" name="email_list" style="height:100px;width:50vw"></textarea> | ||
<textarea id="email_list" name="email_list" style="height:100px;width:50vw" oninput="toggleInviteButton()"></textarea> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oninput does not exists in HTML ! Some JS framework provide it but they transform it to an event listener.
The way to do it is to use JQuery, something like:
$(document).ready(function () {
// observe email entry
$("#email_list").on("input", function(event) {
// handle event, eg. toggle Invite button
// you can get the textarea with event.target
});
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh okay, I'll check this out. Thanks
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great ! Also tested and it works as expected.
… has been entered (#10136) * validate invite users button values * update validateEmail regex to address the concern of potential denial of service * handle event with jquery * fix sonarcloud integrity issue
What
I added a script to the
templates/web/pages/org_form/org_form.tt.html
file that toggles off the Invite Users button until at least one email address has been entered.This script also uses Regex to validate the value of each email address entered to ensure users are inviting valid email addresses and not just random texts.
Fixes Disable Invite Users button on organisation page until email address is entered #10130