I’d like to see if we can get away without this now that the page updates. In
research the ‘We’ve started’ part of the message confused people, especially
when they’d only sent one message.
This is a first go at having the job page update without refreshing.
The approach I’ve taken is to do all the rendering of HTML on the server side,
rather than use a Javascipt templating engine like mustache. This ensures that
we don’t have to maintain two sets of templates.
So the approach is to split the job page into partials. These partials can then:
- be included in the job page to render the whole page
- be rendered indivudually and then returned as a blob of HTML inside a JSON
response
Then I’ve added a Javascript module which looks for areas of the page that should
be reloaded. For each area of the page it will poll a URL and re-render that
section of the page when it gets new HTML. It implements some throttling so that
API calls will never happen more frequently than 0.67 times/second.
The template was displaying raw, eg ‘Hello ((name))’
This commit changes it to use the `.formatted_as_markup` property so the
template is rendered with:
- the placeholders as blue lozenges
- the service name prefixing the message
register. On succesful register and verfication they
will be added to service and forwarded to dashboard.
Nothing is done yet with the permissions requested in the
invite to the user.
CSV files currently have ‘to’ as the recipient column. This is changing in
https://github.com/alphagov/notifications-api/pull/109
The admin app also has to validate that the CSV files have the right columns,
because the API expects any CSV that it’s given to have been checked (also we
want things to actually work).
This commit is the minimum code change needed. In the future it should reuse
the same code as the API for processing CSV files. This will need more thinking.
This commit only deals with acceptance by
users who are already in system.
Changed invite client to return invited user objects
instead of dictionaries.
Added commented out test. fixed up fixtures to return invited user
object for invites
Without the preview service name we probably have to go back to communicating
a bit more on the add service page. This commit brings back the two bullet
points about where the service name will appear, and tries to tie it into the
nice words that Matt Sheret wrote for us.
This page:
- confused users in research
- didn’t communicate what it was intended to (eg the generated email address,
how your service name would appear in messages)
This commit removes the page so that after typing in the service name the user
is sent straight to the dashboard for their new service.
Use one page template for each of:
- choosing a message template
- adding recipients
- checking an email message
- looking at a job
This commit consolidates the two templates into one, and adds logic to show
the SMS message pattern or the email message pattern depending on the type of
template.
It also gives email templates a bit more width, because the body and the from
address tend to be quite long.
This commit parameterises all methods in the send view so that they can send
either emails or SMS messages.
It works out what kind of message it is sending from the `template_type`
property of the template object.
This means that the `Template` util class needs to know about these properties,
which means that this commit depends on:
https://github.com/alphagov/notifications-utils/pull/2
This commit does _not_ add tests for sending emails. The existing tests for
sending SMS still pass, but actually sending emails is outside the scope of
this story.