Browse Source

Merge branch 'master' into DIV-1264

pull/172/head
ariannedee 5 years ago
parent
commit
c24f5a87bf
19 changed files with 251 additions and 87 deletions
  1. +1
    -3
      edivorce/apps/core/middleware/keycloak.py
  2. +6
    -0
      edivorce/apps/core/static/js/ajax.js
  3. +9
    -34
      edivorce/apps/core/static/js/main.js
  4. +1
    -1
      edivorce/apps/core/templates/base.html
  5. +1
    -1
      edivorce/apps/core/templates/dashboard/final_filing.html
  6. +4
    -0
      edivorce/apps/core/templates/dashboard/help_saving_pdf.html
  7. +12
    -3
      edivorce/apps/core/templates/dashboard/help_scanning.html
  8. +1
    -1
      edivorce/apps/core/templates/dashboard/initial_filing.html
  9. +4
    -4
      edivorce/apps/core/templates/partials/alias_field.html
  10. +4
    -1
      edivorce/apps/core/templates/question/02_claimant.html
  11. +4
    -3
      edivorce/apps/core/templates/question/03_respondent.html
  12. +5
    -4
      edivorce/apps/core/templates/success.html
  13. +5
    -1
      edivorce/apps/core/templatetags/input_field.py
  14. +1
    -0
      edivorce/apps/core/urls.py
  15. +2
    -1
      edivorce/apps/core/utils/efiling_packaging.py
  16. +3
    -0
      edivorce/apps/core/utils/efiling_submission.py
  17. +180
    -29
      edivorce/apps/core/utils/question_step_mapping.py
  18. +1
    -1
      edivorce/apps/core/views/api.py
  19. +7
    -0
      edivorce/apps/core/views/main.py

+ 1
- 3
edivorce/apps/core/middleware/keycloak.py View File

@ -46,7 +46,5 @@ class EDivorceKeycloakBackend(OIDCAuthenticationBackend):
def keycloak_logout(request):
request.session.flush()
redirect_uri = absolutify(request, settings.FORCE_SCRIPT_NAME)
redirect_uri = absolutify(request, settings.FORCE_SCRIPT_NAME[:-1] + '/logout')
return f'{settings.KEYCLOAK_LOGOUT}?redirect_uri={redirect_uri}'

+ 6
- 0
edivorce/apps/core/static/js/ajax.js View File

@ -2,6 +2,12 @@
var ajaxOnChange = function () {
var el = $(this);
// strip money fields down to 2 decimal places
if (el.hasClass('money')) {
var moneyValue = parseFloat(el.val());
el.val(moneyValue.toFixed(2));
}
// show/hide additional information if needed
reveal(el);


+ 9
- 34
edivorce/apps/core/static/js/main.js View File

@ -678,14 +678,14 @@ $(function () {
$('#check_order_selected').on('click', function (e) {
var showAlert = $(this).data('show_alert');
var childSupport = $('#order_child_support').prop('checked');
var eligible = false;
var childSupportEligible = false;
if (!childSupport) {
var children = $('#unselected_child_support_alert').data('children-of-marriage');
var under19 = $('#unselected_child_support_alert').data('has-children-under-19');
var over19 = $('#unselected_child_support_alert').data('has-children-over-19');
var reasons = $('#unselected_child_support_alert').data('children-financial-support');
reasons = (reasons || []).filter(function(el){ return el !== 'NO'; }).length > 0;
eligible = children === 'YES' && (under19 || (over19 && reasons));
var hasChildren = $('#unselected_child_support_alert').data('children-of-marriage') === "YES";
var under19 = $('#unselected_child_support_alert').data('has-children-under-19') === "YES";
var over19 = $('#unselected_child_support_alert').data('has-children-over-19') === "YES";
var over19Reasons = $('#unselected_child_support_alert').data('children-financial-support');
var hasOver19Reasons = (over19Reasons || []).filter(function(el){ return el !== "NO"; }).length > 0;
childSupportEligible = hasChildren && (under19 || (over19 && hasOver19Reasons));
}
var proceedNext = $(this).data('proceed');
var showPropertyAlert = false;
@ -702,7 +702,7 @@ $(function () {
}
});
}
if ((showAlert || (!childSupport && eligible)) && !proceedNext) {
if ((showAlert || (!childSupport && childSupportEligible)) && !proceedNext) {
$('#unselected_orders_alert').show();
if (showPropertyAlert) {
$('#unselected_property_alert').show();
@ -710,7 +710,7 @@ $(function () {
if (showSpousalAlert) {
$('#unselected_spouse_alert').show();
}
if (!childSupport && eligible) {
if (!childSupport && childSupportEligible) {
$('#unselected_child_support_alert').show();
}
e.preventDefault();
@ -759,12 +759,6 @@ $(function () {
showHideChildrenLiveWithOthers();
$('input[name="has_children_under_19"], input[name="has_children_over_19"], input[name="children_financial_support"]').change(showHideChildrenLiveWithOthers);
$('.money').on('change', function() {
var value = parseFloat($(this).val());
$(this).val(value.toFixed(2));
});
$('.positive-integer').on('keypress', function(e) {
// keyCode [95-105] - number page
// keyCode [48-57] - 0-9
@ -885,27 +879,8 @@ var initializeChildRowControls = function(element) {
element.find('#cancel_delete_child').on('click', function() {
$('#delete_child_modal').modal('hide');
});
$('form#logoutForm').submit(function(e) {
deleteCookie("SMSESSION", "/", ".gov.bc.ca");
});
};
var deleteCookie = function(name, path, domain) {
if( getCookie(name) ) {
document.cookie = name + "=" +
((path) ? ";path="+path:"")+
((domain)?";domain="+domain:"") +
";expires=Thu, 01 Jan 1970 00:00:01 GMT";
}
}
var getCookie = function(name){
return document.cookie.split(';').some(c => {
return c.trim().startsWith(name + '=');
});
}
var populateChildInputFields = function(element) {
$('.children-questions').show();
$('.children-list').hide();


+ 1
- 1
edivorce/apps/core/templates/base.html View File

@ -54,7 +54,7 @@
<div class="top_banner-user">
{% if request.user.is_authenticated %}
<span>
<form id="logoutForm" action="{% url 'oidc_logout' %}" method="post">
<form action="{% url 'oidc_logout' %}" method="post">
{{ request.user.display_name}}
&nbsp;&nbsp;|&nbsp;&nbsp;
{% csrf_token %}


+ 1
- 1
edivorce/apps/core/templates/dashboard/final_filing.html View File

@ -73,7 +73,7 @@
<b>Missing a form required on this page?</b> Check the
<a href="{% url 'dashboard_nav' 'print_form' %}">Review Forms</a> step.
</p>
<p><a href="{% url 'dashboard_nav' 'help_scanning' %}">Need help with Scanning your documents?</a></p>
<p><a href="{% url 'dashboard_nav' 'help_scanning' %}?filing=final">Need help with Scanning your documents?</a></p>
</div>
{% if how_to_file == 'Online' %}
<div class="add-bottom-margin">


+ 4
- 0
edivorce/apps/core/templates/dashboard/help_saving_pdf.html View File

@ -96,6 +96,10 @@
</ol>
</div>
<div class="form-buttons clearfix">
<a class="btn btn-primary" href="{% url 'dashboard_nav' 'print_form' %}"><i class="fa fa-arrow-circle-o-left"></i>&nbsp;&nbsp;&nbsp;Back</a>
</div>
{% endblock %}
{% block backToDashboard %}


+ 12
- 3
edivorce/apps/core/templates/dashboard/help_scanning.html View File

@ -27,12 +27,13 @@
<li>
<b>Microsoft Windows</b> - If you are using a Microsoft operating system such as Windows 10 there is
built-in software to allow you to scan documents.
For more information see <a href="https://support.microsoft.com/en-ca/help/14088/windows-10-install-and-use-a-scanner" target="_blank">
Microsoft’s help on Installing and Using a Scanner in Windows 10</a>.
For more information see Microsoft’s help on
<a href="https://support.microsoft.com/en-ca/help/14088/windows-10-install-and-use-a-scanner" target="_blank">
Installing and Using a Scanner in Windows 10</a>.
</li>
<li>
<b>Apple OS X</b> - If you are using a Macintosh computer there is built-in software to allow you to scan documents.
For more information see Apple’s help.
For more information see Apple’s help
<a href="https://support.apple.com/en-gb/guide/mac-help/mh28032/mac" target="_blank">
Scanning images or documents using your Mac</a>.
</li>
@ -97,6 +98,14 @@
</p>
</div>
</div>
<div class="form-buttons clearfix">
<a class="btn btn-primary"
href="{% url 'dashboard_nav' '' %}{% if request.GET.filing == 'final' %}final_filing{% else %}initial_filing{% endif %}">
<i class="fa fa-arrow-circle-o-left"></i>&nbsp;&nbsp;&nbsp;Back
</a>
</div>
{% endblock %}
{% block backToDashboard %}


+ 1
- 1
edivorce/apps/core/templates/dashboard/initial_filing.html View File

@ -54,7 +54,7 @@
remaining documents required to complete your divorce.
</p>
<p><b>Missing a form required on this page?</b> Check the <a href="{% url 'dashboard_nav' 'print_form' %}">Review Forms</a> step.</p>
<p><a href="{% url 'dashboard_nav' 'help_scanning' %}">Need help with Scanning your documents?</a></p>
<p><a href="{% url 'dashboard_nav' 'help_scanning' %}?filing=initial">Need help with Scanning your documents?</a></p>
<div class="upload-area">
{% if how_to_sign == 'Together' and signing_location == 'In-person' %}


+ 4
- 4
edivorce/apps/core/templates/partials/alias_field.html View File

@ -15,19 +15,19 @@
<div class="form-group name-group alias-body">
<div>
<p>First Name</p>
{% input_field type="text" name=name value=given_1 multiple="true" class="form-block response-textbox alias-given-1" %}
{% input_field type="text" name=name value=given_1 multiple="true" class="form-block response-textbox alias-other-name alias-given-1" %}
</div>
<div>
<p>Middle Name 1</p>
{% input_field type="text" name=name value=given_2 multiple="true" ignore_error=True class="form-block response-textbox alias-given-2" %}
{% input_field type="text" name=name value=given_2 multiple="true" ignore_error=True class="form-block response-textbox alias-other-name alias-given-2" %}
</div>
<div>
<p>Middle Name 2</p>
{% input_field type="text" name=name value=given_3 multiple="true" ignore_error=True class="form-block response-textbox alias-given-3" %}
{% input_field type="text" name=name value=given_3 multiple="true" ignore_error=True class="form-block response-textbox alias-other-name alias-given-3" %}
</div>
<div>
<p>Last Name</p>
{% input_field type="text" name=name value=last_name multiple="true" class="form-block response-textbox alias-last-name" %}
{% input_field type="text" name=name value=last_name multiple="true" class="form-block response-textbox alias-other-name alias-last-name" %}
</div>
</div>

+ 4
- 1
edivorce/apps/core/templates/question/02_claimant.html View File

@ -39,7 +39,10 @@
</div>
<div class="collapse" id="collapse_changed_name">
<div>
<p>If either of you has had a legal name change since you were married, put that new name on your form, and bring along a copy of the change of name certificate when you file your documents.</p>
<p>
The name written here must match the name that is on your marriage certificate. If you have changed your
legal name since you were married, add it to the section below titled &ldquo;Do you go by any other names&rdquo;.
</p>
</div>
</div>


+ 4
- 3
edivorce/apps/core/templates/question/03_respondent.html View File

@ -43,9 +43,10 @@
</div>
<div class="collapse" id="collapse_legal_name">
<div>
<p>If either of you has had a legal name change since you were married, put that new name on
your form,
and bring along a copy of the change of name certificate when you file your documents.</p>
<p>
The name written here must match your spouses's name that is on your marriage certificate. If they have changed
their legal name since you were married, add it to the section below titled &ldquo;Does your spouse go by any other names&rdquo;.
</p>
</div>
</div>


+ 5
- 4
edivorce/apps/core/templates/success.html View File

@ -19,26 +19,27 @@
<div class="question-well">
<h3>2. Register or Login</h3>
<p>
You will need a <strong>Basic BCeID</strong> or <strong>BC Services Card</strong> account to access the Online Divorce Assistant.
You will need a <strong>Basic BCeID</strong><!-- or <strong>BC Services Card</strong>--> account to access the Online Divorce Assistant.
This will also enable you to securely access multiple other online government services.
</p>
<div class="success-buttons">
<div class="flex-row" id="bcId">
<div class="flex-row" id="bcId" style="width:45%">
<h3>Register for a Basic BCeID</h3>
<p>Once you register, you’ll be taken back to this website.</p>
<a class="btn btn-primary btn-lg btn-block" href="{% url 'register' %}">
Register
</a>
</div>
<!--
<div class="flex-row" id="scard">
<h3>Set up your BC Services Card</h3>
<p>Once you're set up, you’ll be taken back to this website.</p>
<a class="btn btn-primary btn-lg btn-block" href="{% url 'register_sc' %}">
Set Up
</a>
</div>
<div class="flex-row" id="login">
</div> -->
<div class="flex-row" id="login" style="width:45%">
<h3>Login with a BCeID or BC Services Card</h3>
<p>Once you login, you’ll be taken back to this website.</p>
<a class="btn btn-primary btn-lg btn-block" href="{% url 'oidc_authentication_init' %}">


+ 5
- 1
edivorce/apps/core/templatetags/input_field.py View File

@ -56,7 +56,11 @@ def input_field(context, type, name='', value='', multiple='', ignore_error=Fals
error = context.get(name + '_error', False)
if error and not ignore_error:
if 'class' in kwargs:
kwargs['class'] += ' error'
if 'alias-other-name' in kwargs.get('class', ''): # DIV-1200
if not value:
kwargs['class'] += ' error'
else:
kwargs['class'] += ' error'
else:
kwargs['class'] = 'error'


+ 1
- 0
edivorce/apps/core/urls.py View File

@ -13,6 +13,7 @@ urlpatterns = [
path('api/documents/<doc_type>/<int:party_code>/<filename>x/<int:size>/', api.DocumentView.as_view(), name='document'),
url(r'^signin$', main.after_login, name="signin"),
url(r'^logout$', main.after_logout, name="logout"),
url(r'^register$', main.register, name="register"),
url(r'^register_sc$', main.register_sc, name="register_sc"),
url(r'^overview$', main.overview, name="overview"),


+ 2
- 1
edivorce/apps/core/utils/efiling_packaging.py View File

@ -312,7 +312,8 @@ class EFilingPackaging:
def _get_location(self, responses):
location_name = responses.get('court_registry_for_filing', '')
return list_of_registries.get(location_name, '0000')
return list_of_registries.get(location_name,
{'location_id': '0000'}).get('location_id')
def _get_file_number(self, responses):
if not self.initial_filing:


+ 3
- 0
edivorce/apps/core/utils/efiling_submission.py View File

@ -175,4 +175,7 @@ class EFilingSubmission:
return None, f"{response['error']} - {response['message']}"
if response.status_code == 401:
return None, '401 - ' + str(response.headers.get('WWW-Authenticate', ''))
return None, f'{response.status_code} - {response.text}'

+ 180
- 29
edivorce/apps/core/utils/question_step_mapping.py View File

@ -313,33 +313,184 @@ page_step_mapping = {
""" List of court registries """
list_of_registries = {
'Campbell River': '1031',
'Chilliwack': '3521',
'Courtenay': '1041',
'Cranbrook': '4711',
'Dawson Creek': '5731',
'Duncan': '1051',
'Fort Nelson': '5751',
'Fort St. John': '5771',
'Golden': '4741',
'Kamloops': '4781',
'Kelowna': '4801',
'Nanaimo': '1091',
'Nelson': '4871',
'New Westminster': '3581',
'Penticton': '4891',
'Port Alberni': '1121',
'Powell River': '1145',
'Prince George': '5891',
'Prince Rupert': '5901',
'Quesnel': '5921',
'Revelstoke': '4911',
'Rossland': '4921',
'Salmon Arm': '4941',
'Smithers': '5931',
'Terrace': '5951',
'Vancouver': '6011',
'Vernon': '4971',
'Victoria': '1201',
'Williams Lake': '5971'
'Abbotsford': {
'address_1': '32203 South Fraser Way',
'address_2': '',
'postal': 'V2T 1W6',
'location_id': '3561'
},
'Campbell River': {
'address_1': '500 - 13th Avenue',
'address_2': '',
'postal': 'V9W 6P1',
'location_id': '1031'
},
'Chilliwack': {
'address_1': '46085 Yale Road',
'address_2': '',
'postal': 'V2P 2L8',
'location_id': '3521'
},
'Courtenay': {
'address_1': 'Room 100',
'address_2': '420 Cumberland Road',
'postal': 'V9N 2C4',
'location_id': '1041'
},
'Cranbrook': {
'address_1': 'Room 147',
'address_2': '102 - 11th Avenue South',
'postal': 'V1C 2P3',
'location_id': '4711'
},
'Dawson Creek': {
'address_1': '1201 - 103rd Avenue',
'address_2': '',
'postal': 'V1G 4J2',
'location_id': '5731'
},
'Duncan': {
'address_1': '238 Government Street',
'address_2': '',
'postal': 'V9L 1A5',
'location_id': '1051'
},
'Fort Nelson': {
'address_1': 'Bag 1000',
'address_2': '4604 Sunset Drive',
'postal': 'V0C 1R0',
'location_id': '5751'
},
'Fort St. John': {
'address_1': '10600 - 100 Street',
'address_2': '',
'postal': 'V1J 4L6',
'location_id': '5771'
},
'Golden': {
'address_1': '837 Park Drive',
'address_2': '',
'postal': 'V0A 1H0',
'location_id': '4741'
},
'Kamloops': {
'address_1': '223 - 455 Columbia Street',
'address_2': '',
'postal': 'V2C 6K4',
'location_id': '4781'
},
'Kelowna': {
'address_1': '1355 Water Street',
'address_2': '',
'postal': 'V1Y 9R3',
'location_id': '4801'
},
'Nanaimo': {
'address_1': '35 Front Street',
'address_2': '',
'postal': 'V9R 5J1',
'location_id': '1091'
},
'Nelson': {
'address_1': '320 Ward Street',
'address_2': '',
'postal': 'V1L 1S6',
'location_id': '4871'
},
'New Westminster': {
'address_1': 'Begbie Square',
'address_2': '651 Carnarvon Street',
'postal': 'V3M 1C9',
'location_id': '3581'
},
'Penticton': {
'address_1': '100 Main Street',
'address_2': '',
'postal': 'V2A 5A5',
'location_id': '4891'
},
'Port Alberni': {
'address_1': '2999 - 4th Avenue',
'address_2': '',
'postal': 'V9Y 8A5',
'location_id': '1121'
},
'Powell River': {
'address_1': '103 - 6953 Alberni Street',
'address_2': '',
'postal': 'V8A 2B8',
'location_id': '1145'
},
'Prince George': {
'address_1': 'J.O. Wilson Square',
'address_2': '250 George Street',
'postal': 'V2L 5S2',
'location_id': '5891'
},
'Prince Rupert': {
'address_1': '100 Market Place',
'address_2': '',
'postal': 'V8J 1B8',
'location_id': '5901'
},
'Quesnel': {
'address_1': '305 - 350 Barlow Avenue',
'address_2': '',
'postal': 'V2J 2C1',
'location_id': '5921'
},
'Revelstoke': {
'address_1': '1123 West 2nd Street',
'address_2': '',
'postal': 'V0E 2S0',
'location_id': '4911'
},
'Rossland': {
'address_1': 'P.O. Box 639',
'address_2': '2288 Columbia Avenue',
'postal': 'V0G 1Y0',
'location_id': '4921'
},
'Salmon Arm': {
'address_1': '550 - 2nd Avenue NE',
'address_2': 'PO Box 100, Station Main',
'postal': 'V1E 4S4',
'location_id': '4941'
},
'Smithers': {
'address_1': 'No. 40, Bag 5000',
'address_2': '3793 Alfred Avenue',
'postal': 'V0J 2N0',
'location_id': '5931'
},
'Terrace': {
'address_1': '3408 Kalum Street',
'address_2': '',
'postal': 'V8G 2N6',
'location_id': '5951'
},
'Vancouver': {
'address_1': '800 Smithe Street',
'address_2': '',
'postal': 'V6Z 2E1',
'location_id': '6011'
},
'Vernon': {
'address_1': '3001 - 27th Street',
'address_2': '',
'postal': 'V1T 4W5',
'location_id': '4971'
},
'Victoria': {
'address_1': '850 Burdett Avenue',
'address_2': '',
'postal': 'V8W 1B4',
'location_id': '1201'
},
'Williams Lake': {
'address_1': '540 Borland Street',
'address_2': '',
'postal': 'V2G lR8',
'location_id': '5971'
}
}

+ 1
- 1
edivorce/apps/core/views/api.py View File

@ -49,7 +49,7 @@ class UserResponseHandler(APIView):
if question is None and not user_attribute_updated:
return Response(data="Question: '%s' does not exist" % question_key,
status=status.HTTP_400_BAD_REQUEST)
return Response(status=status.HTTP_500_INTERNAL_ERROR)
return Response(status=status.HTTP_500_INTERNAL_SERVER_ERROR)
return Response(status=status.HTTP_200_OK)


+ 7
- 0
edivorce/apps/core/views/main.py View File

@ -1,5 +1,6 @@
from django.conf import settings
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.shortcuts import render, redirect
from django.urls import reverse
from django.contrib.auth.decorators import login_required
@ -120,6 +121,12 @@ def after_login(request):
return redirect(settings.PROXY_BASE_URL + settings.FORCE_SCRIPT_NAME[:-1] + '/overview')
def after_logout(request):
response = HttpResponseRedirect(settings.PROXY_BASE_URL + settings.FORCE_SCRIPT_NAME)
response.delete_cookie(key="SMSESSION", domain=".gov.bc.ca", path="/")
return response
@login_required
@prequal_completed
@intercept


Loading…
Cancel
Save