Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(sms-limiting): email for disabling sms verification (#2133) * feat(templates): add html template for email when verification is disabled * feat(mail.utils.ts): added new method for generation of email html * feat(mail.service): new service method to send mail when sms verification disabled * chore(sms-verification-disabled.view): updated wording * test(mail.service.spec): adds tests for verification disabled email sending * feat(sms limit): sms warning for different limits (#2104) * feat(templates): adds new sms verification warning template * feat(mail.service): adds new method to send sms verification warning mail * chore(templates): added colon for proper punctuation for sms verification template * chore(sms-verification-warning): updated wording to reflect limit is on admin level * refactor(mail.service): updated the api for mail service * feat(verified-sms): disabling sms verifications (#2262) feat(sms_count.server.model): adds new isOnboardedAcc key and scripts to add/delete the key chore(sms_count.server.model): remove unrelated code changes chore(scripts): added extra checks for verifiction counts style(scripts): updated whitespace for formatting feat(form.server.model): add new static method for disabling sms verifications for an admin feat(admin-form.service): adds new service method to disable sms verifications for a certain user fix(form.server.model): disabling sms verifications does not show as an update fix(types): updated return type for disabling sms and added extra db types test(form.server.model): added unit tests for disabling sms on the model scehma test(admin-form.service.spec): added tests for disabling sms on admin service chore(form.server.model): addressed PR comments refactor(sms.config): shifts limiting to be on env var refactor(sms.config): reworked to use env-vars * feat(sms-limiting): admin facing frontend (#2280) * feat(configure-mobile.client.directive): updated modal to use new messages with hard-coded data * refactor(verification.constants): shifted sms_verification_limit to shared/util/verification * feat(configure-mobile.client): added frontend ui for toggling on/off * feat(configure-mobile.client.view): added lock and disabled state when limit exceeded * refactor(configure-mobile.client.view): changed text message to be error themed * refactor(edit-form.css): added inline-padding for error message display * fix(configure-mobile.client.view): updated form twilio account link * feat(configure-mobile.client.directive): added loading state for toggle * refactor(configure-mobile.client.view): update wording for error message * fix(configure-mobile.client.view.html): added ng-show so that error only shows when limit exceeded * feat(public/services): adds new smsservice * feat(configure-mobile.client.directive): connected sms counts to fetch from backend * refactor(pop-up-modal): adds variable to check if we should display red button \ * test(smsservice): adds tests for sms service * refactor(configure-mobile.client): adds error reporting and handling on FE * refactor(smsservice): renamed SmsService to AdminMetaService * refactor(adminmetaservice): renamed method for greater clarity * chore(configure-mobile.client): addressed PR comments * refactor(configure-mobile.client): uses env var instead of using constants * refactor(mail.service): changes to use env var instead of const * refactor(adminmetaservice): updated definitions to fit BE * refactor(configure-mobile.client): changed condition to be same as BE * refactor(configure-mobile.client.directive): extracts formatting to own function * feat(sms-limiting): disable sms verifications toggling (#2300) * feat(verification): added utility method to check if admin has exceeded sms limit * refactor(admin-form.controller): adds new step to check if admin has exceeded the free sms limit the service method returns an error on limit being exceeded so that field creation short-circuits and we hit the mapErr step immediately * test(admin-form.service): added unit tests for isAdminOverFreeSmsLimit * refactor(types): added more refined form and field types together with typeguards added an onboardedForm type so that we can check if a form is onboarded. this is restricted to subtypes of IForm because the context of msgSrvcName is unique to forms and not just any generic type. Added a verifiable mobile field type that checks if the field is toggled to have isVerifiableOn * refactor(admin-form): adds checks to prevent admin updates when the fe state is inconsistent with be * refactor(admin-form.service): optmised to avoid unnecessary query * test(admin-form.serivce): adds unit tests for shouldUpdateFormField * docs(admin-form.controller): updated documentation for 409s when sms limit is exceeded * test(admin-form.controller.spec): updated with unit tests for 409s * test(admin-forms.form.routes.spec): fixed failing test * test(admin-form.controller): updated faulty tests * refactor(mail.service): changes to use env var instead of const * chore(form.utils): addressed PR comments * test(admin-form.service.spec): updated test structure and description for greater clarity * refactor(admin-form.service): splits field specific logic from checking field type * feat(sms-limiting): check admin sms count on public submission (#2326) * feat(form.utils): adds util method to check if a form is onboarded * feat(verification.util): adds util method for checking if an admin has exceed limit this is duplicated from another PR because they are only tangentially dependent. * feat(admin-form.service): adds method to send email/disable verification when sms limits are reached * refactor(verification.controller): adds step to check sms counts for otp generation * refactor(admin-form.service): simplify check by removing redundant neverthrow usage * test(admin-form.service.spec): adds unit tests for new methods * fix(verification.controller): shifted order so that retrieveFullForm is awaited on * test(verification.controller.spec): adds check for disabling mail * refactor(admin-form.service): shifted initialization of admin id below * refactor(verification): updated to use env var rather than const * refactor(admin-form.service): removed export of helper method; tests now shifted to wrapper method * refactor(form.utils): removed duplicate method due to PR separation * refactor(verification): shifted over processing admin sms count to verification module * refactor(configure-mobile.client.directive): updated to account for new BE api * chore(types): clean up unused types * test(verification): fixed import path in tests fix(configure-mobile.client.directive): fixed import path * fix(mail.service): updated to cc rather than send individual mail * chore(create-isonboardedacc): updated db script to be more specific * fix(sms_count.server.model): updated read pref to secondary * fix(form.server.model): updated disable to only affect forms w/o msg srvc name * test(form.server.model): updated tests to check that only not onboarded forms are disabled * feat(sms-limiting): ui changes for modal (#2541) * refactor(pop-up-modal): removed isImportant prop as it is now unused * chore(configure-mobile.client): updated modal wording * refactor(configure-mobile.client): added sms counts figure * refactor(configure-mobile.client): updated stats to not show if loading or error * chore(configure-mobile.client): removed extra html property * feat(sms-limiting): disabled email (#2532) * feat(form.server.model): added new method to retrieve public ofrms with sms verifications * feat(form.service): adds new method to retrieve public forms w/ sms verif enabled * refactor(mail.service): changed warning mails to only be sent to public forms w/ active sms verif * refactor(mail.service): updated disabled mail to have all forms for admin/single form for collab * fix(views/templates): updated wording for warning/disabled mails * fix(verification): fixed lowercase k * chore(templates): disabled email templates updated to match issue copy * fix(templates): updated email template for warning emails chore(template): removed fullstop so it looks more natural * fix(mail.service): updated mail service + tests so that numbers have commas * fix(form.server.model): updated read pref to secondary * fix(form.server.model): updated retrieve method to only affect forms that are not onboarded * docs(mail.service): updated documentation for using toLocaleString * test(form.server.model): updated test to match only verifiable public forms that are not onboarded
- Loading branch information