Skip to content
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

feat: verified sms modal #274

Merged
merged 6 commits into from
Sep 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Verified?
<i
class="glyphicon glyphicon-question-sign"
uib-tooltip="When enabled, users will need to verify their mobile before they can submit the form"
uib-tooltip="When enabled, respondents must verify by entering a code sent to their mobile number"
tooltip-trigger="'click mouseenter'"
></i>
</div>
Expand All @@ -14,7 +14,11 @@
ng-class="field.isVerifiable? 'toggle-selector-on' : ''"
onclick=""
>
<input type="checkbox" ng-model="field.isVerifiable" />
<input
type="checkbox"
ng-model="field.isVerifiable"
ng-click="openVerifiedSMSModal()"
/>
<div class="toggle-selector-switch">
<i ng-class="field.isVerifiable ? 'bx bx-check' : 'bx bx-x' "></i>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,45 @@ function configureMobileDirective() {
name: '=',
characterLimit: '=',
},
controller: [
'$uibModal',
'$scope',
'$translate',
function ($uibModal, $scope, $translate) {
// Get support form link from translation json.
$translate('LINKS.SUPPORT_FORM_LINK').then((supportFormLink) => {
$scope.supportFormLink = supportFormLink
})

$scope.openVerifiedSMSModal = function () {
const isTogglingOnVerifiedSms = !$scope.field.isVerifiable
$scope.verifiedSMSModal =
isTogglingOnVerifiedSms &&
$uibModal.open({
arshadali172 marked this conversation as resolved.
Show resolved Hide resolved
animation: true,
backdrop: 'static',
keyboard: false,
templateUrl: 'modules/forms/admin/views/pop-up.client.modal.html',
windowClass: 'pop-up-modal-window',
controller: 'PopUpModalController',
controllerAs: 'vm',
resolve: {
externalScope: function () {
return {
title: 'Verified SMS',
confirmButtonText: 'OK, Noted',
description: `
FormSG provides free verified SMS <b>up to 10,000 responses</b>
<b>per form</b>. If you expect >10k responses, please <a href=${$scope.supportFormLink} target="_blank" class="">contact us</a>
to arrange billing for verified SMS. <b>Failure to do so risks your form</b>
<b>being deactivated for submissions</b>.
`,
}
},
},
})
}
},
],
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ function editFormController(
backdrop: 'static',
keyboard: false,
templateUrl: 'modules/forms/admin/views/edit-fields.client.modal.html',
windowClass: 'edit-modal-window full-page-modal modal-on-top',
backdropClass: 'custom-modal-backdrop',
windowClass: 'edit-modal-window full-page-modal',
resolve: {
externalScope: function () {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ <h2 class="modal-title">
Verified?
<i
class="glyphicon glyphicon-question-sign"
uib-tooltip="When enabled, users will need to verify their email before they can submit the form"
uib-tooltip="When enabled, respondents must verify by entering a code sent to their email address"
tooltip-trigger="'click mouseenter'"
></i>
</div>
Expand Down