Commit Graph

542 Commits

Author SHA1 Message Date
Chris Hill-Scott
268929a093 Allow platform admins to change daily message limit
One less thing we have to go into the database to do, and remember to
manually clear the cache for after.
2020-10-19 17:44:32 +01:00
Chris Hill-Scott
c8e85efd54 Don’t allow personalisation in broadcast templates
Since we don’t have a way of filling in the personalisation at the
moment we shouldn’t allow people to make templates that require it.
2020-10-05 17:17:21 +01:00
Chris Hill-Scott
f824b3a5eb Give specific error if international letters off
If a service doesn’t have permission to send international letters but
someone tries to upload a letter with a valid international address we
just tell them that the last line must be a UK postcode.

This is a bit opaque and:
- suggests that we’re not recognising at all that it’s not a UK letter
- doesn’t explain why it must be a UK postcode

This commit adds a new, error message which tells users why their letter
can’t be sent. And hopefully will give them a better idea of how to
resolve the problem, if they really do need to be able to send
international letters.
2020-09-10 11:25:17 +01:00
Rebecca Law
52954191fa Merge branch 'master' into international-letters-form 2020-09-07 09:45:17 +01:00
Pea Tyczynska
e0faad6cea Only approved email domain users can be invited
to broadcast services. This is done to improve security.
2020-08-28 14:41:03 +01:00
Chris Hill-Scott
1acc3b55eb Merge pull request #3581 from alphagov/remove-end-time
Remove choice of ‘End time’ from broadcast journey
2020-08-19 14:30:22 +01:00
Chris Hill-Scott
da8321863d Remove choice of ‘End time’ from broadcast journey
Since we added the end time picker:
- we have discovered that broadcasts can’t be longer than 24h
- we have observed that most users confuse picking the end time for
  scheduling the message, or don’t understand exactly what it means for
  the broadcast to ‘end’
- we’ve developed the concept of ‘training mode’, which you should be
  going through before sending a real broadcast

We also think that, for most scenarios, you won’t necessarily know when
a broadcast should end at the time of starting it because the cause of
the danger is not within your control. So giving you control of the
end time before the broadcast has even been approved is a confusing
distraction.

Having to pick a time at all also makes the whole process feel more
planned and less immediate. Whereas in reality all the phones in the
area will be getting the message in seconds. It’s only people coming
into the area later to whom the ‘ongoing’ aspect of the broadcast
applies.

The best place to explain what’s happening with the phones is at the
approval stage and once you’ve sent your first (training mode)
broadcast. It’s easier to explain what’s happened if it’s in direct
response to something you’ve just done.

Later on we should add some kind of email reminder after 12 hours to
make sure you still want the broadcast live, again after 18 hours, etc.

We could let you schedule an end time once the broadcast is live, but
don’t think there’s a strong need. Knowing enough that you want to
cancel is one thing, but knowing enough to want to cancel but wanting to
wait a bit… nah.
2020-08-19 11:05:13 +01:00
Pea M. Tyczynska
9b69d16963 Merge pull request #3554 from alphagov/convert-single-line-textboxes-to-govuk-frontend
Convert single line textboxes to govuk frontend
2020-08-18 11:29:44 +01:00
Pea M. Tyczynska
3bbce24b06 Merge pull request #3558 from alphagov/only-allow-new-template-if-permission-is-there
Services can only create templates of types they have turned on
2020-08-17 14:39:16 +01:00
Pea Tyczynska
bf5ccd044b Services can only create templates of types they have turned on 2020-08-14 17:13:56 +01:00
Pea Tyczynska
67da2c28bf Deep merge jsonlike objects
Also remove duplicate checkboxes code
2020-08-14 14:58:05 +01:00
Tom Byers
d8355be6fc Add comment explaining use of textbox for tel 2020-08-13 11:40:09 +01:00
Pea Tyczynska
2252e68d37 Remove duplicate spellcheck false for email fields 2020-08-13 10:53:28 +01:00
Tom Byers
bff07c10b1 Convert IntegerFields to GovukIntegerFields
Changes those fields in the following forms:
- FreeSMSAllowance
- ProviderForm
- ProviderRatioForm
- ServiceDataRetentionEditForm

Includes changes to templates that use this form
and associated tests.
2020-08-12 10:34:51 +01:00
Tom Byers
97ddc7923a Add GovukIntegerField - extends IntegerField 2020-08-12 10:34:51 +01:00
Tom Byers
c715681f5c Convert DateFields to GovukDateFields
Changes those fields in the following forms:
- DateFilterForm
- RequiredDateFilterForm

Includes changes to templates that use this form
and associated tests.
2020-08-12 10:34:51 +01:00
Tom Byers
8faca47152 Add GovukDateField - extends DateField 2020-08-12 10:34:51 +01:00
Pea Tyczynska
1d2a73a1a4 Update TemplateAndFoldersSelectionForm fields
Changes its StringFields to GovukTextInputFields.

Includes changes to templates that use this form
and associated tests.
2020-08-12 10:34:51 +01:00
Tom Byers
3f7142b3e2 Update fields on ServiceLetterBrandingDetails
Changes its StringField to GovukTextInputField.

Includes changes to templates that use this form
and associated tests.
2020-08-12 10:34:51 +01:00
Pea Tyczynska
852ef61aad Update ServiceSmsSenderForm with new fields
Changes its StringField to GovukTextInputField.

Includes changes to templates that use this form
and associated tests.
2020-08-12 10:34:51 +01:00
Pea Tyczynska
f38e268db6 Update AddGPOrganisationForm with new fields
Changes its StingFields to GovukTextInputFields.

Includes changes to templates that use this form
and associated tests.
2020-08-12 10:34:51 +01:00
Pea Tyczynska
9437a23f09 Update RenameOrganisationForm with new fields
Changes its StringFields to GovukTextInputFields.

This change also affects NewOrganisationForm,
which inherits from RenameOrganisationForm.

Also includes changes to templates that use this
form and associated tests.
2020-08-12 10:34:51 +01:00
Tom Byers
a22b8cf684 Update ForgivingIntegerField
Makes it inherit from GovukTextInputField.

Changes to govuk_field_widget to allow the value
attribute to be set by passing a value keyword
argument to the __call__ method.

Includes changes to templates that use this form
and associated tests.
2020-08-12 10:34:51 +01:00
Pea Tyczynska
ebd8588c03 Convert TwoFactorForm to gov uk frontend 2020-08-12 10:34:51 +01:00
Pea Tyczynska
be7d4891ae Consolidate callback forms and convert them to gov uk frontend
We had two identical callback form classes. One for delivery callbacks
and one for inbound sms callbacks. Since they did not differ I consolidated
them into one CallbackForm class that they both inherited from previously.

I also substituted field classes for this form with new fields
that cooperate with gov uk frontend.
2020-08-12 10:34:51 +01:00
Pea Tyczynska
6f1fc3d16d Convert TemplateFolderForm to govuk frontend 2020-08-12 10:34:51 +01:00
Pea Tyczynska
ad3b391e46 Convert ListEntry component to use new fields
ListEntry component uses FieldList field to group
textboxes. Textboxes can be text inputs, email fields
or international phone number fields. This converts
all field-lists to use:

- GovukTextInputField
- GovukEmailField
- InternationalPhoneNumber

Affects these forms:
- OrganisationDomainsForm
- GuestList

Also changes to related Javascript:

Update list-entry JS tests to match new HTML

Updates the HTML the JS operates on in the test
(a fixture representing the HTML in the page on
load) to match the new GOVUK Frontend we are
generating.

Make list-entry JS work with GOVUK Frontend HTML

The existing list-entry JS did a few things that
clashed with how the new HTML works:
- added a 'input-' prefix to the id attributes
  of all text-inputs
- did not make its name and id attributes values
  match

The new HTML has id and name attributes that
match so these changes remove the prefix for id
attributes and makes them match the name
attribute.

To understand these changes, it is useful to
know how the values for id and name attributes are
generated:
1. the id attribute for the component element is
   stored
2. the 'list-entry-' prefix is removed and the
   remainder is used to generate ids

For example, if the component's id is
'list-entry-domains', the id will be 'domains-1',
where the text-input is the first one.

This also adds some logic to the HoganJS template
to make the value attribute optional, so it is
only added if it has a non-null value. This
matches the behaviour of the text-input component
used in the new list-entry component.

Also change whitelist references to guestlist in tests
- we forgot to do it earlier, when we moved from calling this
feature whitelist to calling it guestlist.
2020-08-12 10:34:51 +01:00
Tom Byers
11dcd87115 Update ServiceContactDetailsForm with new fields
Changes its:
- StringFields to GovukTextInputFields
- EmailFields to GovukEmailFields

Includes changes to templates that use this form
and associated tests.
2020-08-12 10:34:51 +01:00
Tom Byers
880a0a3318 Update CreateKeyForm to new fields
Changes its StringFields to GovukTextInputFields.

Includes changes to templates that use this form
and associated tests.
2020-08-12 10:34:51 +01:00
Tom Byers
949aa3a9bd Update CreateServiceForm with new fields
Changes its StringField to GovukTextInputField.

Includes changes to templates that use this form
and associated tests.
2020-08-12 10:34:51 +01:00
Tom Byers
9457ba206a Convert BaseTemplateForm to use new fields
Updates StringField to GovukTextInputField.

These changes also affect the following forms that
inherit from BaseTemplateForm:
- SMSTemplateForm
- EmailTemplateForm

Includes changes to templates that use these forms
and associated tests.
2020-08-12 10:34:51 +01:00
Tom Byers
d21b9475ba Convert SearchFields to GovukSearchFields
Changes those fields in the following forms:
- SearchByNameForm
- SearchUsersByEmailForm
- SearchUsersForm
- SearchNotificationsForm

Includes changes to templates that use this form
and associated tests.
2020-08-12 10:34:50 +01:00
Tom Byers
f95d57cfde Add GovukSearchField - extends SearchField 2020-08-12 10:34:50 +01:00
Tom Byers
427b01999c Update UKMobileNumber & InternationalPhoneNumber
Changes those classes so they have the same
interface as a GOVUK field when instantiated and
render GovukTextInputField HTML.

Includes changes to templates that use this form
and associated tests.
2020-08-12 10:34:50 +01:00
Pea Tyczynska
39bc7cf721 Convert EmailFields to GovukEmailFields
Changes those fields (and sometimes also regular text input fields)
 in the following forms:
- LoginForm
- RegisterUserForm
- ChangeEmailForm
- FeedbackOrProblem
- AcceptAgreementForm
- ChangeNameForm (only name field here, but used in the same template
field as ChangeEmailForm here: app/templates/views/user-profile/change.html)

Also includes changes to templates that use this form
and associated tests.
2020-08-12 10:34:42 +01:00
Tom Byers
7e771a5fa1 Add GovukEmailField - extends EmailField 2020-08-12 10:23:43 +01:00
Tom Byers
139616a0a9 Add data attributes to send errors to analytics 2020-08-12 10:23:43 +01:00
Pea Tyczynska
8219ae7861 Allow html in error messages for text input fields 2020-08-12 10:23:43 +01:00
Pea Tyczynska
1d21b5b96e Refactor gov uk textbox field classes to avoid repetition 2020-08-12 10:23:43 +01:00
Tom Byers
e316e33180 Convert PasswordFields to GovukPasswordFields
Converts them directly in the following forms:
- LoginForm
- ConfirmPasswordForm

Changes the password function to return
GovukPasswordField instead of PasswordField which
effects the following forms:
- RegisterUserForm
- RegisterUserFromInviteForm
- RegisterUserFromOrgInviteForm
- NewPasswordForm
- ChangePasswordForm

It also updates StringField on RegisterUserFromOrgInviteForm
to GovukTextInputField

Also includes changes to templates that use this
form and associated tests.
2020-08-12 10:23:43 +01:00
Tom Byers
5cbf57e1fb Add GovukPasswordField - extends PasswordField
Also adds it to the list of fields
StripWhitespaceForm skips when processing field
data.
2020-08-12 10:22:20 +01:00
Tom Byers
a3e661830d Convert text inputs on ServiceUpdateEmailBranding
Includes changes to templates that use this form
and associated tests.
2020-08-12 10:22:20 +01:00
Tom Byers
87beaf49ae Use GovukTextInputField in RenameServiceForm
Includes changes to templates that use this form
and associated tests.
2020-08-12 10:22:20 +01:00
Tom Byers
57d5f31be4 Add GovukTextInputField - extends StringField 2020-08-12 10:22:20 +01:00
Chris Hill-Scott
8570901731 Let users select electoral wards of local authorities
If a library has groups, we should show a link instead of selecting the
group directly.

Then we can give the user the choice of selecting the whole of that
group, or specific areas within the group.

For now the only libraries we have with groups are local authorities,
which group electoral wards.
2020-08-11 17:38:15 +01:00
Chris Hill-Scott
24f0b172f4 Refactor use ServiceOnOffForm
We no longer need a custom form object here – ServiceOnOffForm does the
same job of turning strings to booleans and back again.
2020-08-06 09:14:32 +01:00
Tom Byers
cd398ab55c Merge pull request #3543 from alphagov/remove-code-supporting-old-permissions-form_fields
Revert support for old user permissions params
2020-08-05 15:51:28 +01:00
Chris Hill-Scott
cc9fecfaa0 Fix typo on invite page
There’s an _i_ missing from _Permssions_
2020-08-04 18:17:38 +01:00
Tom Byers
a74501f1d8 Merge pull request #3535 from alphagov/try-introducing-govuk-checkboxes-again
Try introducing govuk checkboxes again
2020-08-04 14:39:54 +01:00
Tom Byers
468a43bd68 Revert support for old user permissions params
The fields used for user permissions on
permissions forms were changed as part of the work
converting the checkboxes to GOVUK Frontend.

This removes code added to protect against a
situation where the server-side app was running
this updated code but clients were POSTing from
pages that were not, and so sending the old HTTP
params.
2020-07-31 15:40:12 +01:00