-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Display agresive spam filter rule warning banner (#1058)
Closes #1047
- Loading branch information
Showing
6 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
tests-qa/acceptance/010_UserRegistration/012_EmailBanner.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
*** Settings *** | ||
Library RequestsLibrary | ||
Resource ../ressources/Authentication.robot | ||
Test Setup Test Setup | ||
|
||
*** Test Cases *** | ||
|
||
Display agresive spam filter rule warning banner | ||
[Documentation] Show a banner for o2/wp.pl domains | ||
Go To Url ${PAGE_REGISTER_URL} | ||
|
||
Input Text ${REGISTRATION_EMAIL_INPUT} [email protected] | ||
Element Should Not Be Visible ${REGISTRATION_BANNER_AGRESSIVE_SPAM_RULES} | ||
|
||
Input Text ${REGISTRATION_EMAIL_INPUT} [email protected] | ||
Wait Until Element Is Visible ${REGISTRATION_BANNER_AGRESSIVE_SPAM_RULES} | ||
|
||
Input Text ${REGISTRATION_EMAIL_INPUT} [email protected] | ||
Element Should Not Be Visible ${REGISTRATION_BANNER_AGRESSIVE_SPAM_RULES} | ||
|
||
Input Text ${REGISTRATION_EMAIL_INPUT} [email protected] | ||
Wait Until Element Is Visible ${REGISTRATION_BANNER_AGRESSIVE_SPAM_RULES} | ||
|
||
Input Text ${REGISTRATION_EMAIL_INPUT} [email protected] | ||
Element Should Not Be Visible ${REGISTRATION_BANNER_AGRESSIVE_SPAM_RULES} | ||
|
||
|
||
*** Keywords *** | ||
|
||
Test Setup | ||
Clear Database | ||
Sign Out Fast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
website/app-templates/smarty/banners/registration_spam_filter.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div id="banner-registration-spam-filter" class="alert alert-danger" role="alert" style="display: none;"> | ||
{t email=GK_SITE_EMAIL escape=no}To o2.pl/wp.pl users, due to agressive spam filter rules with these email service providers, <b>please add <u>%1</u> to your address book</b> before creating your account.{/t} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
website/app-templates/smarty/js/registration/registration.events.tpl.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Display agresive spam filter rule warning banner | ||
const email = document.getElementById("emailInput"); | ||
const banner = document.getElementById("banner-registration-spam-filter"); | ||
const strictDomains = ["o2.pl", "wp.pl"]; | ||
|
||
email.addEventListener("input", () => { | ||
const matches = email.value.match(/.+@(.+)/); | ||
if (matches) { | ||
const domain = matches.pop(); | ||
if (strictDomains.indexOf(domain) > -1) { | ||
banner.style.display = "block"; | ||
return; | ||
} | ||
} | ||
banner.style.display = "none"; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters