Commit Graph

7170 Commits

Author SHA1 Message Date
Chris Hill-Scott
514a98f946 Make hex colour code error more helpful
I just got stuck for like a whole minute on this.
2018-11-07 10:49:04 +00:00
Chris Hill-Scott
f8aaa34cdb Merge pull request #2457 from alphagov/remove-integration-testing
Remove integration testing
2018-11-07 10:26:30 +00:00
Chris Hill-Scott
b1832a4c43 Remove link to integration testing page
This page has ben deprecated.
2018-11-06 17:25:33 +00:00
Chris Hill-Scott
156d38499a Remove integration testing content
This is covered in the new client library documentation. All of the
client libraries now have their documentation published in the new
format.
2018-11-06 17:24:30 +00:00
Chris Hill-Scott
77457c81de Merge pull request #2427 from alphagov/add-notifications-page-test
Add test for the notifications page when there are failed notifications
2018-11-06 16:14:44 +00:00
Chris Hill-Scott
22d3ab9ba2 Hide duplicative form legend 2018-11-06 16:12:12 +00:00
Chris Hill-Scott
216d7d1ec9 Merge pull request #2453 from alphagov/model-service-update
Use the model for updating a service and its permissions
2018-11-06 16:07:26 +00:00
Chris Hill-Scott
9c35b9bdcb Merge pull request #2445 from alphagov/pyup-update-pytest-3.9.3-to-3.10.0
Update pytest to 3.10.0
2018-11-06 14:22:14 +00:00
Alexey Bezhan
75b4533805 Fix template type selector to preserve current folder 2018-11-06 13:45:42 +00:00
Alexey Bezhan
aaca537792 Create new folders inside the current folder
When adding a new folder it is created inside the currently active
one. The user is returned to the previously active folder page,
which shows the added folder.

This adds a new route to the add template/folder views. Thankfully,
`url_for` recognizes when `template_folder_id` is `None` and will use
the URL without `/folders/...`, so users without folder permissions
should be unaffected by this change.
2018-11-06 13:45:42 +00:00
Alexey Bezhan
9e5ca45d38 Add tests for template folder navigation 2018-11-06 13:22:08 +00:00
Alexey Bezhan
731d41f993 Add current template folder path to header and page title
When a folder is selected the full path is displayed in page title
and header (for example `Templates / Folder1 / Folder2`). Elements
of the path link to the corresponding folder. Current folder is not
linked.
2018-11-06 13:13:13 +00:00
Alexey Bezhan
20abe96fc9 Link template folders to their contents
Clicking on template folder navigates to a page that displays that
folder's contents.

This reuses the existing choose template view by adding a filter
based on optional `template_folder_id` argument.

Service model methods are rewritten to match `all_templates` and
`get_template`. New `get_template_folder_path` method returns a
list of folders (from root to the current one) that the selected
folder is nested inside.
2018-11-06 13:13:13 +00:00
Alexey Bezhan
29bed8ba55 Add Service.get_templates method with filters by type and folder
With the addition of template folders we need to filter templates
based on a combination of type and parent folder ID.

This replaces the existing `templates_by_type` method with
`get_templates`, which supports both type and parent folder filters,
avoiding a need to create specific methods for each use case.

We still need the templates property to exist in some way in order
to cache it, but it needs to be clear that it's different from
`.get_templates`. One option was to make it "private" (i.e. `_templates`),
and always use `.get_templates` in the rest of the code, but this requires
adding "include all folders" to `.get_templates`, which doesn't have an
obvious interface since `parent_folder_id=None` already means "top-level
only".

This will probably come up again when we need to look into adding
templates from nested folders into the page for live search, but
for now renaming `Service.templates` to `.all_templates` makes it
clear what the property contains.
2018-11-06 13:13:13 +00:00
Leo Hemsted
078595da9d show list of template folders on the choose templates page
Not linking anywhere yet. Also not sorted, and not filtered by
parent_id.
2018-11-06 13:13:13 +00:00
Leo Hemsted
1ecf360e7f add template folder form 2018-11-06 13:13:12 +00:00
Leo Hemsted
7cbf5de240 add new template folder
The add new templates page now has option to add template folders.
Tweaked wording of other options and h1 to clarify options since it's
not all about templates any more.

Added api client and stuff for it
2018-11-06 13:13:12 +00:00
Chris Hill-Scott
10013a19aa Add live search to letter brandings
Matches what we do for email branding, makes the one you’re lookig for
quicker to find.
2018-11-06 13:08:58 +00:00
Chris Hill-Scott
37295f4b6e Merge pull request #2449 from alphagov/tech-docs-php-node
Link to tech docs format for .NET, PHP and Node
2018-11-06 13:08:37 +00:00
Chris Hill-Scott
43988661d6 Sort selected item to the top
When you land on the page it’s good to be able to quickly see what the
currently-set value is, before you change it.

This is unnecessarily hard if the selected item is buried half way down
the page. This commit moves it to the top.
2018-11-06 13:06:48 +00:00
Chris Hill-Scott
c960fef8f8 Always put HM Government at the top of the list
It’s the default, so we should treat it the same way we treat GOV.UK in
the email branding selection.
2018-11-06 13:04:45 +00:00
Chris Hill-Scott
65cc6adabf Sort letter brandings alphabetically
Currently the brandings have non-deterministic sorting, which means
the order changes from page load to page load. This makes it hard to
find the item you’re looking for.

This commit sorts them by the name of the branding, same as for email
brandings.
2018-11-06 13:02:40 +00:00
Chris Hill-Scott
684d4f7782 Refactor setting value on letter branding form
WTForms lets you pre-populate a form’s value by passing it in as an
argument to the constructor.

This will be good for us because it will let us access that value in
the constructor later on.
2018-11-06 13:00:30 +00:00
Chris Hill-Scott
72ddd107ef Merge pull request #2450 from alphagov/httpretty-no-more
Remove httpretty dependency
2018-11-06 12:59:32 +00:00
Chris Hill-Scott
1c9e42f85d Remove update_with_properties method
It’s more Pythonic, and better abstracted from the underlying API to
use keyword arguments instead.
2018-11-05 17:56:11 +00:00
Chris Hill-Scott
b3a7210baf Stop passing SMS sender when updating permissions
This is a redundant argument which no longer seems to be used by
anything.
2018-11-05 17:16:31 +00:00
Chris Hill-Scott
48b0d4194e Use model to toggle research mode
Just a nice bit of encapsulation, rather than passing `current_service`
through to a method on `current_service`.
2018-11-05 17:15:52 +00:00
Chris Hill-Scott
318f846630 Move service permission handle inside the model
These helper functions for modifying a service permission were just
floating around loose in the view code.

A much better home for them is on the model. This will also make it
easy to reuse them in other views if we ever need to.
2018-11-05 17:15:52 +00:00
Chris Hill-Scott
a69551b2cb Use model to update service properties
We have a lot of places in settings where we update something by passing
in the `service_id`. `current_service` already knows about `service_id`,
so it’s cleaner to encapsulate these updates inside the model.
2018-11-05 17:15:52 +00:00
Chris Hill-Scott
e6181637be Remove httpretty dependency
We don’t use it for anything.

Even the [commit that introduced it](494e49ee45) didn’t seem to actually use it.

Closes #2446
2018-11-05 15:52:05 +00:00
Chris Hill-Scott
ebea503968 Reduce logging noise in traceback output
When running tests locally Pytest returns a lot of captured logging info.

This is redundant because Pytest also captures stdout.

This commit effectively disables logging output when running tests by
setting the log level to higher than anything a real logging call would
ever emit.

The logging output is still captured by stdout, so nothing is lost here,
we’re just reducing duplication.
2018-11-05 15:45:12 +00:00
Chris Hill-Scott
c1bcfff895 Add link to .NET documentation 2018-11-05 15:17:12 +00:00
Chris Hill-Scott
3993e2cf28 Link to tech docs format for PHP and Node
They’re live 🎉 

One more to go…
2018-11-05 14:49:29 +00:00
Chris Hill-Scott
2286c19aa5 Merge pull request #2447 from alphagov/test
Mark agreement signed by Test Valley council
2018-11-05 11:10:55 +00:00
Chris Hill-Scott
e66be538ac Mark agreement signed by Test Valley council 2018-11-05 10:44:36 +00:00
pyup-bot
1bcaad2c71 Update pytest from 3.9.3 to 3.10.0 2018-11-04 16:58:25 +00:00
Chris Hill-Scott
ebe90d396e Merge pull request #2442 from alphagov/show-all-pages-notification
Show all letter pages on the notification page
2018-11-02 14:35:39 +00:00
Chris Hill-Scott
39c51dd994 Show all letter pages on the notification page
Sometimes a long placeholder can push stuff onto a new page, so we need
to take the personalisation into account when counting pages.
2018-11-02 14:30:18 +00:00
Chris Hill-Scott
549e48de49 Merge pull request #2434 from alphagov/send-one-off-letter
Let people send one-off letters from the admin app
2018-11-02 09:33:04 +00:00
Chris Hill-Scott
cf04d2fe92 Merge pull request #2439 from alphagov/fix-white-corner-cell-spreadsheet
Make the corner of the spreadsheet grey again
2018-11-01 16:13:57 +00:00
Chris Hill-Scott
1319de4b21 Make the corner of the spreadsheet grey again
It was being overriden to white by the scrollable table code.
2018-11-01 16:03:16 +00:00
Chris Hill-Scott
92aa144bf2 Merge pull request #2438 from alphagov/scrollable-spreadsheet
Make the example spreadsheet scroll horizontally
2018-11-01 15:53:00 +00:00
Chris Hill-Scott
6c746787c2 Merge pull request #2437 from alphagov/css-checkerboard
Put pattern behind logo images
2018-11-01 15:52:52 +00:00
Chris Hill-Scott
54bd321504 Make the example spreadsheet scroll horizontally
This replicates how we let large spreadsheets scroll horizontally.

Pro: this looks nicer and is more usable

Con: the code for this feels a bit fragile, especially the calling of
`.maintainWidth` twice, ie as many times as a it takes to get stuff to
render properly.
2018-11-01 15:31:14 +00:00
Chris Hill-Scott
8200514461 Fix double error border 2018-11-01 14:45:12 +00:00
Chris Hill-Scott
b7b5c844a7 Put pattern behind logo images
So that white on transparent images are visible.
2018-11-01 13:51:02 +00:00
Chris Hill-Scott
d6b785d3fa Style ‘Download PDF’ link 2018-10-31 14:29:38 +00:00
Chris Hill-Scott
1675e6c8d2 Show error banner for one off letter in trial mode
In trial mode you can’t send letters. But it’s still useful to be able
to build up a letter to see how it work.

Best place to put this error is before someone tries to send a letter
for real.
2018-10-31 14:25:49 +00:00
Chris Hill-Scott
a79dfd1d6e Always show download link for PDF
This feature is useful for people to try the letter thing out and see
how it feels, maybe print one on their own printer before incurring
cost.
2018-10-31 14:22:27 +00:00
Chris Hill-Scott
3a62946ecd Let people send one off letters
We didn’t used to allow this because it wasn’t really possible with the
old DVLA set up and we didn’t think there’s a need.

We think it’s possible now because, even though it’s cumbersome, it’s
better than the manual process.
2018-10-31 12:19:19 +00:00