Commit Graph

2392 Commits

Author SHA1 Message Date
Chris Hill-Scott
da19c0b4ad Remove bullets from lists in tables
I think this is something we inherited from the Digital Marketplace
code. We only use this for organisation settings are the moment, but
the list markers are redundant because each item will never wrap onto a
new line; it will truncate instead. Still keeps a little sliver of
spacing just so it doesn’t look like a paragraph.
2019-04-24 16:11:32 +01:00
Chris Hill-Scott
d3caaf94b1 Make archive/suspend links not buttons
They don’t immediately perform an action, so semantically they are
links, not buttons.
2019-04-24 16:11:32 +01:00
Tom Byers
2eab320fe3 Merge pull request #2912 from alphagov/add-jest-framework
Add Jest framework for testing JavaScript
2019-04-24 14:02:09 +01:00
Chris Hill-Scott
f726551714 Remove unused method
We use `.get_free_sms_fragment_limit_for_year()` instead, which
functionally is the same thing (has a default argument of `year=None`).
2019-04-24 13:10:41 +01:00
Tom Byers
00c1ebf02a Add test for autofocus.js
One of the simplest of our JavaScript files to
test how difficult this is.

Answer is not too bad and includes the file
needing a DOM to operate on and jQuery in the
global scope.
2019-04-24 10:46:55 +01:00
Chris Hill-Scott
9c846979be Don’t error if service without an organisation requests to go live
It was trying to look at `organisation.domains`, which caused an
`AttributeError` if there wasn’t an organisation.
2019-04-23 16:48:15 +01:00
Chris Hill-Scott
9f1bc285fa Merge branch 'master' into record-user-that-requested-to-go-live 2019-04-23 15:38:44 +01:00
Chris Hill-Scott
7beea0b2ac Merge pull request #2922 from alphagov/features-footer-second-pass
Features and footer updates
2019-04-18 13:17:16 +01:00
Chris Hill-Scott
aa16e1f2ce Add tests to make sure static pages render
This will catch if we accidentally break them by adding a `url_for` that
references a non-existant endpoint or something like that.
2019-04-18 13:06:39 +01:00
Chris Hill-Scott
9d32d40ee4 Merge pull request #2908 from alphagov/allow-invited-users-to-count
Let inviting a user complete the go live checklist
2019-04-18 11:17:56 +01:00
karlchillmaid
f3a2e695fb Merge pull request #2858 from alphagov/features-content-updates
Update features and footer content and answer some common support questions.
2019-04-16 15:42:51 +01:00
Rebecca Law
da8eead475 Update service with the user that requested to go live.
When a service is marked as live update the service with the go live datetime.
2019-04-16 15:01:54 +01:00
karlchillmaid
0ee322f137 Merge branch 'master' into features-content-updates 2019-04-16 13:50:50 +01:00
karlchillmaid
5f1482f223 Correct time formatting 2019-04-16 11:03:09 +01:00
karlchillmaid
a384ae8f9b Make the formatting of postage times consistent 2019-04-16 10:38:54 +01:00
karlchillmaid
f833a9bd67 Make the formatting of postage times consistent 2019-04-16 10:36:32 +01:00
Chris Hill-Scott
116f36192f Let inviting a user complete the go live checklist
At the moment you have to wait for whoever you’ve invited to accept the
invitation before you can go live. Since this check is mainly for the
benefit of the service, not us, we should trust that people’s intentions
are good when they invite someone.

So this commit also checks the invited users when counting how many team
members a service has.
2019-04-12 22:45:48 +01:00
Chris Hill-Scott
8626777fde Don’t let services go live without an organisation
We shouldn’t be making services live without an agreement in place. In
order to have an agreement in place we need to know what organisation
operates the service.

If a service comes along but belongs to an organisation we don’t know
about then we should create that organisation. This commits removes the
link, which should force this to happen.
2019-04-12 22:42:23 +01:00
Chris Hill-Scott
700e073d0f Stop sending service domain to the API
The API doesn’t look at it, and the rest of the admin code isn’t calling
the method with this argument any more.
2019-04-12 17:15:51 +01:00
Pea (Malgorzata Tyczynska)
5ac6255be7 Merge pull request #2897 from alphagov/overlay-for-failed-letters
Precompiled show preview with overlay when validation fails
2019-04-12 16:37:53 +01:00
Chris Hill-Scott
8084dce705 Merge pull request #2896 from alphagov/remove-domains-yml
Use organisations from database rather than YAML file
2019-04-12 16:37:15 +01:00
Chris Hill-Scott
9d99c78c3a Remove code that reads domains.yml
Since we’ve removed calls to this code from the rest of the app, it can
safely be removed now.
2019-04-12 15:23:08 +01:00
Chris Hill-Scott
470b8a2912 Remove domains from branding forms
We’re deprecating storing the domain as text on a branding in favour of
a database relationship between branding and organisation.

We need to do this now in order to remove the validation on these fields
(which depends on the data in `domains.yml`)
2019-04-12 15:23:07 +01:00
Chris Hill-Scott
9684e962ae Refactor go live tags into service model
Since this function only takes one argument, a service, it might as well
be a method of the service.
2019-04-12 15:19:32 +01:00
Chris Hill-Scott
3565ffc33f Remove dependence on domains.yml from settings
Settings looked at `domains.yml` when users were making go live requests
or email branding requests.

This will allow us to remove the `domains.yml` file, by using
information about organisations that is now stored in the database
instead.
2019-04-12 15:19:31 +01:00
Chris Hill-Scott
b41c3779c4 Merge pull request #2906 from alphagov/auto-service-counts
Automate counting of live services and orgs
2019-04-12 14:15:41 +01:00
Chris Hill-Scott
835d11d8d6 Remove domains.yml dependence from agreement pages
This will allow us to remove the `domains.yml` file, by using
information about organisations that is now stored in the database
instead.
2019-04-12 14:12:10 +01:00
Chris Hill-Scott
98249158cb Stop trying to infer branding when adding services
The API handles this now.
2019-04-12 14:08:33 +01:00
Chris Hill-Scott
72f49a9a1e Remove dependence on domains.yml from static pages
This will allow us to remove the `domains.yml` file, by using
information about organisations that is now stored in the database
instead.
2019-04-12 14:05:00 +01:00
Chris Hill-Scott
9863aa3c48 Automate counting of live services and orgs
Returns the data calculated by the API. Stored in Redis against a
hardcoded key so that no-one hammering the home page is directly hitting
the database.
2019-04-12 13:59:33 +01:00
karlchillmaid
f997b446ff Update app/templates/views/service-settings/request-to-go-live.html
Co-Authored-By: quis <me@quis.cc>
2019-04-11 15:44:28 +01:00
Chris Hill-Scott
436d023722 Block incomplete requests to go live
Dealing with users who request to go live but haven’t completed all the
steps still represents a significant support overhead for our team.
We’ve made some improvements to the percentage of incomplete requests
with a better page design, but ultimately because it still shows the
button people think it’s OK to press the button while some of the items
on the page still say [Not completed].

We can do this now because organisations are in the database, which
means we can mark the agreement signed as soon as we get it back,
without having to deploy code.
2019-04-11 14:35:30 +01:00
Chris Hill-Scott
30504a8026 Fix tests 2019-04-11 12:00:37 +01:00
Katie Smith
88e9a0ff61 Add audit event when a service manager changes someones profile
We should audit when a service manager changes a user profile that is not
their own. This can be recorded in our events table, which is currently
only used to record successful logins.

This adds two new types of event, `update_user_email` and
`update_user_mobile_number` which store the
- browser fingerprint
- IP address
- user id of the user being updated
- user id of the service manager  making the change
- original email address and new email address (for `update_user_email`
events)
- original mobile number and new mobile number (for
`update_user_mobile_number` events)
2019-04-09 14:37:37 +01:00
Leo Hemsted
249b80762a add count of folders visible per user to the team members page
Shows a count of how many folders that user can see - this doesn't do
anything smart with parent folder stuff, it's just "how many checkboxes
are ticked on the edit page".

* doesn't show if service has no folders
* doesn't show if service hasn't got folder permissions enabled
2019-04-04 17:55:37 +01:00
Pea Tyczynska
858e98736f Test that preview with overlay gets called 2019-04-04 13:41:30 +01:00
Leo Hemsted
1984128d1f Merge pull request #2893 from alphagov/copy-service-folder
fix bug with copying template from folder in other service
2019-04-03 14:13:27 +01:00
Leo Hemsted
3e3c11f3a0 fix bug with copying template from folder in other service 2019-04-03 13:59:44 +01:00
Chris Hill-Scott
b1b496ba56 Say what the current email branding is
We keep getting people requesting branding when they already have the
branding they want set. Seems like they don’t realise we’re doing it
automatically. This might help.
2019-04-03 11:54:33 +01:00
Chris Hill-Scott
7436a568dd Merge pull request #2884 from alphagov/team-members-not-users
Say ‘team members’ not ‘users’ for permissions
2019-04-02 15:52:49 +01:00
Pea Tyczynska
bd66cc220b User permissions section for a folder noy visible if service only has one user
If no manage users permission then don't pass user folder permissions to api
2019-04-02 15:03:41 +01:00
Pea Tyczynska
9d44c45e90 Only users who can manage team members see folder permissions 2019-04-02 12:07:11 +01:00
Chris Hill-Scott
f1126c8cbb Say ‘team members’ not ‘users’ for permissions
This is consistent with the language we use elsewhere.

Also removes the colon (it’s considered implicit in a form label).
2019-04-01 17:23:16 +01:00
Alexey Bezhan
364ed7d4c6 Add tests that user folder permission check is being called 2019-04-01 10:50:39 +01:00
Alexey Bezhan
bfe6768796 Add user permission check to template folder actions 2019-04-01 10:50:38 +01:00
Alexey Bezhan
35fb92c02c Replace sevice api client get template calls with Service methods
Instead of using the API client directly views are now calling one
of two Service model methods:

`get_template` is used for view actions, where the user should see
the template page even if they don't have access to the template
folder (since all templates are still inked from the dashboard or
the sent notifications pages).

`get_template_with_user_permission_or_403` will check if the user
has access to the template's folder first and return 403 otherwise.
This method is used for any endpoints that result in an action: editing
template attributes, deleting templates or sending messages.
2019-04-01 10:50:38 +01:00
Alexey Bezhan
e6d7f7ebeb Add a user method to check folder permission
User model is the most natural place for a permission check method,
however this means that we need to pass the full user object to
service model methods and TemplateList instead of user_id.
2019-04-01 10:50:38 +01:00
Chris Hill-Scott
883b07e3f0 Use client_request fixture where possible
It:
- saves repetetive boilerplate code
- does some extra checks (eg checking for a `200` response)
- makes the codebase less confusing to consistently do the same thing in
  the same way
2019-03-26 16:38:00 +00:00
Leo Hemsted
f872294235 remove the remove-user get method
remove `confirm` from `confirm_remove_user_from_service` as there's
only one action now that the initial confirmation prompt takes place
on the edit permissions page
2019-03-26 15:52:37 +00:00
Leo Hemsted
f7f9dd8530 fix user permissions save button sometimes deleting
when you hit the delete button, it flashes the delete button and takes
you to the `/service/../user/../delete` url. If you then click the save
button, it would make a POST to the delete URL... and delete the user.

now the page stays on the edit url, but adds a `?delete=yes` query
string. The dangerous flash banner now has an action field which
defines where the browser will make the POST to (which remains at
/delete).
2019-03-26 15:52:37 +00:00