diff --git a/src/public/modules/forms/base/components/start-page.client.component.js b/src/public/modules/forms/base/components/start-page.client.component.js
index df8213b3c4..e34893a636 100644
--- a/src/public/modules/forms/base/components/start-page.client.component.js
+++ b/src/public/modules/forms/base/components/start-page.client.component.js
@@ -12,6 +12,7 @@ angular.module('forms').component('startPageComponent', {
logoState: '@',
formTitle: '@',
authType: '<',
+ myInfoError: '<',
isAdminPreview: '<',
hasMyinfoFields: '<',
isTemplate: '<',
diff --git a/src/public/modules/forms/base/css/form.css b/src/public/modules/forms/base/css/form.css
index f740a766b8..b4059c1c80 100644
--- a/src/public/modules/forms/base/css/form.css
+++ b/src/public/modules/forms/base/css/form.css
@@ -87,15 +87,21 @@
.public-form .form-locked-msg {
text-align: center;
- color: #484848;
+ color: white;
font-size: 18px;
- margin-bottom: 70px;
- margin-left: 15px;
- margin-right: 15px;
+ margin-bottom: 0;
+ margin-top: 40px;
+
+ /* Offset container padding */
+ margin-left: -35px;
+ margin-right: -35px;
}
.public-form.submit-form .form-locked-msg.myinfo-error {
color: #a94442;
+ margin-left: 0;
+ margin-right: 0;
+ margin-bottom: 40px;
}
.public-form.submit-form .form-locked-msg.myinfo-error i {
diff --git a/src/public/modules/forms/base/directiveViews/submit-form.directive.view.html b/src/public/modules/forms/base/directiveViews/submit-form.directive.view.html
index d51fe881d1..ad3859a9db 100644
--- a/src/public/modules/forms/base/directiveViews/submit-form.directive.view.html
+++ b/src/public/modules/forms/base/directiveViews/submit-form.directive.view.html
@@ -7,6 +7,7 @@
paragraph="{{ form.startPage.paragraph }}"
logo-state="{{ form.startPage.logo.state }}"
form-title="{{ form.title }}"
+ my-info-error="myInfoError"
auth-type="form.authType"
is-admin-preview="false"
has-myinfo-fields="hasMyInfoFields"
@@ -63,29 +64,6 @@
-
-
- Login with SingPass to access this form. Your SingPass ID will be included
- with your form submission.
-
-
- Login with CorpPass to access this form. Your Entity ID and CorpPass ID
- will be included with your form submission.
-
-
- An error occurred while retrieving your MyInfo details. Kindly refresh
- your browser, or try again later.
-
-
From 0c3d778618f450d017a9189c2445d5326c783d53 Mon Sep 17 00:00:00 2001
From: Jiayee Lim
Date: Mon, 9 Nov 2020 11:34:05 +0800
Subject: [PATCH 16/26] feat: display a Toast when reCAPTCHA fails while users
are filling up a form (#582)
---
.../base/directiveViews/submit-form.directive.view.html | 1 +
src/public/modules/forms/services/captcha.client.service.js | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/src/public/modules/forms/base/directiveViews/submit-form.directive.view.html b/src/public/modules/forms/base/directiveViews/submit-form.directive.view.html
index ad3859a9db..8e908b3e4c 100644
--- a/src/public/modules/forms/base/directiveViews/submit-form.directive.view.html
+++ b/src/public/modules/forms/base/directiveViews/submit-form.directive.view.html
@@ -112,6 +112,7 @@
size="invisible"
on-create="captchaService.setWidget(widgetId)"
on-success="captchaService.onSuccess(response, submitForm)"
+ on-error="captchaService.onError()"
on-expire="captchaService.expire()"
data-badge="inline"
>
diff --git a/src/public/modules/forms/services/captcha.client.service.js b/src/public/modules/forms/services/captcha.client.service.js
index e7e50e2ea2..a6f29df6c6 100644
--- a/src/public/modules/forms/services/captcha.client.service.js
+++ b/src/public/modules/forms/services/captcha.client.service.js
@@ -64,6 +64,12 @@ function captchaService($window, vcRecaptchaService, Toastr) {
cb()
}
+ this.onError = function () {
+ Toastr.error(
+ 'Error: Cannot connect to reCAPTCHA. Please check your internet connectivity or try submitting on another device.',
+ )
+ }
+
/**
* Expire captcha if captcha enabled
*/
From aaacd5b07e34b1e47112e92b3879c414c1fd6812 Mon Sep 17 00:00:00 2001
From: Antariksh Mahajan