Commit Graph

10228 Commits

Author SHA1 Message Date
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
1da336827b Make agreement test work with both error message classes 2020-08-13 11:00:28 +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
Pea Tyczynska
3953e67499 Remove unused template 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
Tom Byers
02514df9fa Bring in Jinja and Sass for text-input component 2020-08-12 10:22:20 +01:00
Chris Hill-Scott
3f9e49603d Merge pull request #3544 from alphagov/choose-electoral-ward
Let users select specific electoral wards in a local authority to broadcast to
2020-08-12 08:48:13 +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
David McDonald
38953d1c28 Merge pull request #3560 from alphagov/turn-redis-back-on
Turn redis back on
2020-08-11 15:40:26 +01:00
David McDonald
2aaca11f8b Turn redis back on 2020-08-11 14:26:12 +01:00
David McDonald
32cc168c23 Merge pull request #3556 from alphagov/turn-redis-off
Turn off redis in all environments for rotation
2020-08-11 14:25:30 +01:00
Chris Hill-Scott
0ce64bcfde Merge pull request #3553 from alphagov/move-broadcast-areas-into-admin
Move broadcast areas into admin
2020-08-11 13:25:21 +01:00
Chris Hill-Scott
ac470ff350 Merge pull request #3559 from alphagov/hidden-email-on-register
Put hidden email field on register from invite page
2020-08-11 13:18:22 +01:00
Toby Lorne
b0ff2d41c5 broadcast-areas: examples are deterministic
Signed-off-by: Toby Lorne <toby.lornewelch-richards@digital.cabinet-office.gov.uk>
2020-08-11 12:04:02 +01:00
Chris Hill-Scott
cf999b5d8e Add inline comment explaining presence of field 2020-08-11 11:26:31 +01:00
Chris Hill-Scott
b0fc1cd271 Make test name more explicit 2020-08-11 11:22:59 +01:00
Toby Lorne
73e68c355b broadcast-areas: include electoral wards
Signed-off-by: Toby Lorne <toby.lornewelch-richards@digital.cabinet-office.gov.uk>
2020-08-10 18:09:15 +01:00
Toby Lorne
6649d0ac70 broadcast-areas: use area ids in tests
Signed-off-by: Toby Lorne <toby.lornewelch-richards@digital.cabinet-office.gov.uk>
2020-08-10 18:09:15 +01:00
Chris Hill-Scott
834b0fc3d5 Put hidden email field on register from invite page
Password managers will try to guess what they should save as a username
by looking at the fields on the page where you set up your password.

When registering from an invite the email address (what we use as a
username) is predefined, and only shown on the page as text, not an
input.

This commit also adds a hidden input field for password managers to pick
up.

Adapted from: https://github.com/UKGovernmentBEIS/beis-opss-psd/blob/master/app/views/users/complete_registration.html.erb#L29-L36
2020-08-10 15:59:27 +01:00