Commit Graph

1512 Commits

Author SHA1 Message Date
Rebecca Law
3c87af44ee Merge pull request #454 from alphagov/simplify-jwt
Simplify JWT
2016-04-15 12:08:41 +01:00
Rebecca Law
848db38573 Added missing import 2016-04-15 11:53:39 +01:00
NIcholas Staples
b85c6c3b1a Merge pull request #455 from alphagov/add_created_by_to_api_calls
Add created_by to all appropriate requests.
2016-04-15 11:14:05 +01:00
Nicholas Staples
2085792742 Add created_by to all appropriate requests. 2016-04-15 11:08:19 +01:00
Rebecca Law
1fe5ae0371 This pull request removes the need for the req and pay in the claims JWT.
Use the new version of the notifications-python-client. This version no longer adds the req and pay to the claims of the jwt.

The change is backward compatible so an older client that sends a JWT with the extra claims will pass authentication.
Once all the clients have been updated to not include the extra claims some updates to exclude them from the method signatures will happen as well.

The documentation has been updated to reflect this change.

https://www.pivotaltracker.com/story/show/116971293
2016-04-15 11:04:35 +01:00
catherineheywood
99d5a3afc7 Doc changes
Add links to PHP and Java libraries
Define sent_at
Indicate how to access template IDs
2016-04-14 16:40:30 +01:00
NIcholas Staples
51673e26f4 Merge pull request #450 from alphagov/make_service_live
Make service live and revert working, all tests passing.
2016-04-14 15:43:09 +01:00
Nicholas Staples
6d9de1a500 Make service live and revert working, all tests passing. 2016-04-14 15:38:34 +01:00
Chris Hill-Scott
12053a4532 Merge pull request #449 from alphagov/detect-placeholders-in-email-subject
Detect placeholders in email subject
2016-04-14 15:25:54 +01:00
Chris Hill-Scott
a6279f4114 Move placeholder hint to align with subject
If the hint aligns with the message body then it looks like you can only
add placeholders to the body. This commit aligns it with the  subject
instead, and since it overlaps both it looks like you can add
placeholders to both (hopefully).
2016-04-14 14:56:59 +01:00
Chris Hill-Scott
54e42a2021 Make the hint work for both subject and body
This commit makes the placeholder hint not be dependent on their only
being one textbox with placeholders on a page.

To do this it needs to be its own module, because the two textboxes are
each self-contained instances of the same module.

The way I’ve gone about this is to make the placeholder hint accept a
list of textboxes it should look in when deciding what message to
display to the user.

Most of the code is extracted from the existing placeholder highlighting
module.
2016-04-14 14:54:53 +01:00
Chris Hill-Scott
435537aac8 Make textboxes auto expand later
At two lines the subject textbox was expanding even when it was empty.
This commit makes the distance at which textboxes start expanding less
sensitive.
2016-04-14 14:54:00 +01:00
Chris Hill-Scott
9cba3ea70f Add placeholder highlighting to subject
Email subjects can now have placeholders in, we should visually indicate
this in the same way as we do for the email body.
2016-04-14 14:53:19 +01:00
Chris Hill-Scott
1bf4d00e19 Make subject a textarea
In order for subject lines to have their fields highlighted they have to
be textboxes. This is because the highlighting script only works with
textboxes that don’t scroll, either horizontally, vertically, or be
keying through them.
2016-04-14 14:51:58 +01:00
Chris Hill-Scott
83c6baf977 Don’t override textbox heights with CSS
We should let textboxes set their own height using the rows attribute.
2016-04-14 14:51:14 +01:00
Chris Hill-Scott
39a6fd115a Remove option for ‘disabled’ textbox
I think this was used for the invite page at one point, but isn’t now.

Generally at GDS we don’t do disabled form controls, they don’t tell you
_why_ they’re disabled.
2016-04-14 14:50:17 +01:00
Chris Hill-Scott
150aef2868 Allow rows to be passed to textbox
HTML textboxes have a rows attribute, which controls their height,
unless their height is overridden by CSS.
2016-04-14 14:49:28 +01:00
NIcholas Staples
c465c0404b Merge pull request #448 from alphagov/fix_template_subject_update_bug
Fixed bug for subject not updating when changed on the edit template …
2016-04-14 14:14:47 +01:00
Chris Hill-Scott
b1d0547bb2 Merge pull request #447 from alphagov/remove-human-timestamps
Remove human-friendly timestamps from activity page
2016-04-14 14:10:52 +01:00
Nicholas Staples
a6a42d6f26 Fixed bug for subject not updating when changed on the edit template page. 2016-04-14 14:08:35 +01:00
Chris Hill-Scott
cadc700712 Remove human-friendly timestamps from activity page
This fix introduced by e6490e1 did not fix anything.

So lets remove the ‘3 days ago’ thing completely and just say the date
and time instead.
2016-04-14 13:47:53 +01:00
Chris Hill-Scott
b157da24cb Merge pull request #445 from alphagov/different-human-timestamp-module
Use a different module for doing nice timestamps
2016-04-14 13:00:20 +01:00
Chris Hill-Scott
e71ee62577 Merge pull request #444 from alphagov/apropostrophe
Use proper apostrophe on 500 page
2016-04-14 13:00:14 +01:00
NIcholas Staples
8c830c82ed Merge pull request #446 from alphagov/fix_link_bug
Updated notifications_utils version and associated code. Added email …
2016-04-14 12:06:55 +01:00
Nicholas Staples
3865c722fc Updated notifications_utils version and associated code. Added email subject formatting for placeholders. 2016-04-14 12:00:55 +01:00
Chris Hill-Scott
e6490e18d1 Use a different module for doing nice timestamps
There is a bug in Babel[1] which means that it throws an exception if
it can’t find the locale it wants to use.

This is not a problem when developing locally, because OS X comes with
lots of locales. The AWS machines, however, only have one locale, which
is not the one that Babel is looking for. Hence the ‘Activity’ page
doesn’t work.

This commit changes to using Humanize[2] instead, which is much less
vast and hopefully less hungry in its requirements.

That’s a morning we won’t get back…

1. https://github.com/python-babel/babel/issues/137
2. https://pypi.python.org/pypi/humanize
2016-04-14 11:39:43 +01:00
catherineheywood
9197ed0b1a Doc changes
Make it clearer what placeholders are. 
Make it clearer you need to add a template even if using API.
Remove 'empty' sections.
Other minor changes.
2016-04-14 10:57:37 +01:00
catherineheywood
cfe27d1f75 Doc changes 2016-04-14 09:51:46 +01:00
Chris Hill-Scott
b1e56d8ba1 Use proper apostrophe on 500 page 2016-04-13 17:19:11 +01:00
Chris Hill-Scott
85f2bf92ac Merge pull request #443 from alphagov/fix-activity-for-new-api
Make activity page use new nomenclature for status
2016-04-13 17:16:25 +01:00
Chris Hill-Scott
9b4933f16b Make activity page use new nomenclature for status
Statuses used to be:
- failed
- complaint
- bounce
- sent
- delivered

Now they are:
- sent
- sending
- delivered

This change broke the notifications page on the admin app.

It also made me realise that we should be ignoring ‘sending’ messages in
the history page—it should only show messages we’ve tried to deliver.

The code for this is a bit of a bodge, but it will get things working
again for now.
2016-04-13 17:10:05 +01:00
NIcholas Staples
7272791c54 Merge pull request #442 from alphagov/fix_link_bug
Fix template delete links.
2016-04-13 17:01:11 +01:00
Nicholas Staples
33cc90488c Fix template delete links.
Fix bug with 'current_service' not available for non service urls.

Code review adjustment.

Static code check.
2016-04-13 16:57:16 +01:00
Chris Hill-Scott
f76375875a Merge pull request #438 from alphagov/activity-page-refinements
Allow filtering of notifications by type, status or both
2016-04-13 16:24:56 +01:00
Chris Hill-Scott
a25bbaea06 Move download CSV link to top
You might miss it at the bottom if you’ve got lots of rows.
Better to have it in a consistent place.
2016-04-13 16:17:09 +01:00
Chris Hill-Scott
e282ca2109 Allow filter links to be used in combination
Means you can see, for example emails that have failed.

Means adding:
- logic to generate links which can have a type parameter, a status
  parameter, or both
- a ‘pill’ UI component for seeing which filters you currently have
  applied
- some logic to change the page title based on which filters you have
  applied
2016-04-13 16:17:09 +01:00
Chris Hill-Scott
4da92f170a Properly parse comma-separated query string params 2016-04-13 16:17:09 +01:00
Chris Hill-Scott
1a6bb37171 Tidy up the ‘Activity’ table
This table had a lot of columns, which meant that some of them became
very narrow, wrapping the text awkwardly.

This commit groups some of the data into a chunk, which occupies the
first column.
2016-04-13 16:17:09 +01:00
Chris Hill-Scott
906a22a67b Merge pull request #436 from alphagov/only-collapse-long-emails
Only collapse email templates if they’re long
2016-04-13 16:16:56 +01:00
Chris Hill-Scott
2a03cd3952 Merge pull request #431 from alphagov/sort-template-stats
Sort template stats by usage
2016-04-13 16:15:33 +01:00
Chris Hill-Scott
6e83bec7b0 Merge pull request #439 from alphagov/wrap-long-words-in-emails
Wrap long words in email template previews
2016-04-13 16:13:54 +01:00
Chris Hill-Scott
0a31949c73 Merge pull request #437 from alphagov/tidy-scss
Don’t lint SCSS files that have come from outside
2016-04-13 16:13:33 +01:00
Chris Hill-Scott
1beca5e84b Merge pull request #434 from alphagov/single-template-view
Add view for a single template
2016-04-13 16:07:24 +01:00
Chris Hill-Scott
6909146fee Wrap long words in email template previews
If you put, for example, a URL in an email template it can be very long.
This can cause it to overflow its container. This commit forces it to
wrap instead.
2016-04-13 14:59:19 +01:00
Chris Hill-Scott
b549b98108 Don’t lint SCSS files that have come from outside
We should (and do) keep exact copies of SCSS files that have come from
elsewhere so that we can easily upgrade them. But sometimes they don’t
always pass our linting rules, or throw a lot of warnings, which is
noisy.

This commit:
- moves such files into their own subdirectory
- tells SCSS Lint to ignore files in this directory
2016-04-13 14:30:49 +01:00
Chris Hill-Scott
c81b8c39f6 Add view for a single template
> At the moment, we have an all email templates page, and an edit an
> individual page.
>
> This gets messy when we refer to templates like the dashboard and the
> activity views. We solve this currently by using anchor links to the
> list page, but this is clunky.
>
> So lets add it, then update the links on the dash and activity to the
> new view page.
>
> Should be a link from the view a single template page, to the template
> hub page.

https://www.pivotaltracker.com/story/show/117349227
2016-04-13 13:41:53 +01:00
Rebecca Law
9acd344475 Merge pull request #427 from alphagov/update_for_db_rebase
Update for db rebase
2016-04-13 12:05:11 +01:00
catherineheywood
0d569d7ba5 typo correction 2016-04-13 10:12:50 +01:00
catherineheywood
3a85907c93 adjust JWT tokens title 2016-04-13 10:00:41 +01:00
Chris Hill-Scott
bdf746131f Only collapse email templates if they’re long
It’s a bit silly to have email templates expandable if you’re only going
to reveal a couple more lines.

This commit adds a data attribute which specifies how high (in pixels)
the email template can be before it gets truncated. It then changes the
script to only truncate emails which are naturally taller than this
height.

Currently the cut off is at 200px, which is approximately 8 lines of
text: `200px / (font-size: 19px * line-height: 1.31) = 8.03`
2016-04-13 09:50:18 +01:00