mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 14:09:49 -04:00
Merge branch 'master' into use_new_template_stats_endpoint
This commit is contained in:
15
README.md
15
README.md
@@ -19,7 +19,7 @@ GOV.UK Notify admin application.
|
|||||||
## First-time setup
|
## First-time setup
|
||||||
|
|
||||||
Languages needed
|
Languages needed
|
||||||
- Python 3
|
- Python 3.4
|
||||||
- [Node](http://nodejs.org/) 5.0.0 or greater
|
- [Node](http://nodejs.org/) 5.0.0 or greater
|
||||||
```shell
|
```shell
|
||||||
brew install node
|
brew install node
|
||||||
@@ -34,18 +34,15 @@ version of Node.
|
|||||||
npm rebuild node-sass
|
npm rebuild node-sass
|
||||||
```
|
```
|
||||||
|
|
||||||
The app runs within a virtual environment. To [install virtualenv](https://virtualenv.readthedocs.org/en/latest/installation.html), run
|
The app runs within a virtual environment. We use mkvirtualenv for easier working with venvs
|
||||||
```shell
|
|
||||||
[sudo] pip install virtualenv
|
|
||||||
```
|
|
||||||
|
|
||||||
Make a virtual environment for this app:
|
|
||||||
```shell
|
```shell
|
||||||
|
pip install virtualenvwrapper
|
||||||
mkvirtualenv -p /usr/local/bin/python3 notifications-admin
|
mkvirtualenv -p /usr/local/bin/python3 notifications-admin
|
||||||
```
|
```
|
||||||
|
|
||||||
Install dependencies and build the frontend assets:
|
Install dependencies and build the frontend assets:
|
||||||
```shell
|
```shell
|
||||||
|
workon notifications-admin
|
||||||
./scripts/bootstrap.sh
|
./scripts/bootstrap.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -74,6 +71,10 @@ export DESKPRO_ASSIGNED_AGENT_TEAM_ID=""
|
|||||||
"> environment.sh
|
"> environment.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## AWS credentials
|
||||||
|
|
||||||
|
Your aws credentials should be stored in a folder located at `~/.aws`. Follow [Amazon's instructions](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-config-files) for storing them correctly
|
||||||
|
|
||||||
|
|
||||||
## Running the application
|
## Running the application
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Create an account – GOV.UK Notify
|
|||||||
<p>Your account will be created with this email: {{email_address}}</p>
|
<p>Your account will be created with this email: {{email_address}}</p>
|
||||||
<form method="post" autocomplete="nope">
|
<form method="post" autocomplete="nope">
|
||||||
{{ textbox(form.name, width='3-4') }}
|
{{ textbox(form.name, width='3-4') }}
|
||||||
{{ textbox(form.mobile_number, width='3-4', hint='We’ll send you a verification code by text message') }}
|
{{ textbox(form.mobile_number, width='3-4', hint='We’ll send you a security code by text message') }}
|
||||||
{{ textbox(form.password, hint="Your password must have at least 10 characters", width='3-4') }}
|
{{ textbox(form.password, hint="Your password must have at least 10 characters", width='3-4') }}
|
||||||
{{ page_footer("Continue") }}
|
{{ page_footer("Continue") }}
|
||||||
{{form.service}}
|
{{form.service}}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Create an account – GOV.UK Notify
|
|||||||
<form method="post" autocomplete="nope">
|
<form method="post" autocomplete="nope">
|
||||||
{{ textbox(form.name, width='3-4') }}
|
{{ textbox(form.name, width='3-4') }}
|
||||||
{{ textbox(form.email_address, hint="Must be from a central government organisation", width='3-4', safe_error_message=True) }}
|
{{ textbox(form.email_address, hint="Must be from a central government organisation", width='3-4', safe_error_message=True) }}
|
||||||
{{ textbox(form.mobile_number, width='3-4', hint='We’ll send you a verification code by text message') }}
|
{{ textbox(form.mobile_number, width='3-4', hint='We’ll send you a security code by text message') }}
|
||||||
{{ textbox(form.password, hint="At least 10 characters", width='3-4') }}
|
{{ textbox(form.password, hint="At least 10 characters", width='3-4') }}
|
||||||
{{ page_footer("Continue") }}
|
{{ page_footer("Continue") }}
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
{% block maincolumn_content %}
|
{% block maincolumn_content %}
|
||||||
|
|
||||||
<h1 class="heading-large">Now check your email</h1>
|
<h1 class="heading-large">Check your email</h1>
|
||||||
<p>We’ve sent an email to {{ session['user_details']['email'] }}.</p>
|
<p>We’ve sent an email to {{ session['user_details']['email'] }}.</p>
|
||||||
<p>Click the link in the email to continue your registration.</p>
|
<p>Click the link in the email to continue your registration.</p>
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
{{ textbox(
|
{{ textbox(
|
||||||
form.usage,
|
form.usage,
|
||||||
label='Estimate how many emails and/or text messages you’ll send each month',
|
label='Estimate how many emails and text messages you’ll send each month',
|
||||||
hint='If your estimate is likely to change, tell us how ',
|
hint='If your estimate is likely to change, tell us how ',
|
||||||
width='1-1',
|
width='1-1',
|
||||||
rows=5
|
rows=5
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<div class="column-two-thirds">
|
<div class="column-two-thirds">
|
||||||
<h1 class="heading-large">Check your phone</h1>
|
<h1 class="heading-large">Check your phone</h1>
|
||||||
|
|
||||||
<p>We’ve sent you a text message with a verification code.</p>
|
<p>We’ve sent you a text message with a security code.</p>
|
||||||
|
|
||||||
<form autocomplete="off" method="post">
|
<form autocomplete="off" method="post">
|
||||||
{{ textbox(
|
{{ textbox(
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<div class="grid-row">
|
<div class="grid-row">
|
||||||
<div class="column-two-thirds">
|
<div class="column-two-thirds">
|
||||||
<h1 class="heading-large">Resend verification code</h1>
|
<h1 class="heading-large">Resend security code</h1>
|
||||||
|
|
||||||
<p>Text messages sometimes take a few minutes to arrive. If you do not receive the text message, you can resend it.</p>
|
<p>Text messages sometimes take a few minutes to arrive. If you do not receive the text message, you can resend it.</p>
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a class="button" href="{{url_for('main.check_and_resend_verification_code')}}" role="button">Resend verification code</a>
|
<a class="button" href="{{url_for('main.check_and_resend_verification_code')}}" role="button">Resend security code</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ Confirm your mobile number – GOV.UK Notify
|
|||||||
<div class="column-two-thirds">
|
<div class="column-two-thirds">
|
||||||
<h1 class="heading-large">Confirm your mobile number</h1>
|
<h1 class="heading-large">Confirm your mobile number</h1>
|
||||||
|
|
||||||
<p>We've sent you a confirmation code by text message.</p>
|
<p>We’ve sent you a security code by text message.</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<label class="form-label" for="email">Enter confirmation code<br>
|
<label class="form-label" for="email">Enter security code<br>
|
||||||
<input class="form-control-1-4" id="email" type="text"><br>
|
<input class="form-control-1-4" id="email" type="text"><br>
|
||||||
<span class="font-xsmall"><a href="{{ url_for('.text-not-received-2') }}">I haven't received a text</a></span>
|
<span class="font-xsmall"><a href="{{ url_for('.text-not-received-2') }}">I haven't received a text</a></span>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ def test_should_render_correct_resend_template_for_active_user(app_,
|
|||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
|
||||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||||
assert page.h1.string == 'Resend verification code'
|
assert page.h1.string == 'Resend security code'
|
||||||
# there shouldn't be a form for updating mobile number
|
# there shouldn't be a form for updating mobile number
|
||||||
assert page.find('form') is None
|
assert page.find('form') is None
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ def test_should_render_two_factor_page(app_,
|
|||||||
'email': api_user_active.email_address}
|
'email': api_user_active.email_address}
|
||||||
response = client.get(url_for('main.two_factor'))
|
response = client.get(url_for('main.two_factor'))
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
assert '''We’ve sent you a text message with a verification code.''' in response.get_data(as_text=True)
|
assert '''We’ve sent you a text message with a security code.''' in response.get_data(as_text=True)
|
||||||
|
|
||||||
|
|
||||||
def test_should_login_user_and_redirect_to_service_dashboard(app_,
|
def test_should_login_user_and_redirect_to_service_dashboard(app_,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ def test_should_return_verify_template(app_,
|
|||||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||||
assert page.h1.text == 'Check your phone'
|
assert page.h1.text == 'Check your phone'
|
||||||
message = page.find_all('p')[1].text
|
message = page.find_all('p')[1].text
|
||||||
assert message == "We’ve sent you a text message with a verification code."
|
assert message == "We’ve sent you a text message with a security code."
|
||||||
|
|
||||||
|
|
||||||
def test_should_redirect_to_add_service_when_sms_code_is_correct(app_,
|
def test_should_redirect_to_add_service_when_sms_code_is_correct(app_,
|
||||||
|
|||||||
Reference in New Issue
Block a user