diff --git a/edivorce/apps/core/middleware/keycloak.py b/edivorce/apps/core/middleware/keycloak.py index a4260536..5cc68814 100644 --- a/edivorce/apps/core/middleware/keycloak.py +++ b/edivorce/apps/core/middleware/keycloak.py @@ -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}' diff --git a/edivorce/apps/core/static/js/ajax.js b/edivorce/apps/core/static/js/ajax.js index 0ba06d65..4924ff9f 100644 --- a/edivorce/apps/core/static/js/ajax.js +++ b/edivorce/apps/core/static/js/ajax.js @@ -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); diff --git a/edivorce/apps/core/static/js/main.js b/edivorce/apps/core/static/js/main.js index 419f0730..27c13c43 100755 --- a/edivorce/apps/core/static/js/main.js +++ b/edivorce/apps/core/static/js/main.js @@ -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(); diff --git a/edivorce/apps/core/templates/base.html b/edivorce/apps/core/templates/base.html index 4b3be845..a5db322b 100644 --- a/edivorce/apps/core/templates/base.html +++ b/edivorce/apps/core/templates/base.html @@ -54,7 +54,7 @@
{% if request.user.is_authenticated %} -
+ {{ request.user.display_name}}   |   {% csrf_token %} diff --git a/edivorce/apps/core/templates/dashboard/final_filing.html b/edivorce/apps/core/templates/dashboard/final_filing.html index de277bf7..51e7647f 100644 --- a/edivorce/apps/core/templates/dashboard/final_filing.html +++ b/edivorce/apps/core/templates/dashboard/final_filing.html @@ -73,7 +73,7 @@ Missing a form required on this page? Check the Review Forms step.

-

Need help with Scanning your documents?

+

Need help with Scanning your documents?

{% if how_to_file == 'Online' %}
diff --git a/edivorce/apps/core/templates/dashboard/help_saving_pdf.html b/edivorce/apps/core/templates/dashboard/help_saving_pdf.html index 6c7bc3c4..3ef2d578 100644 --- a/edivorce/apps/core/templates/dashboard/help_saving_pdf.html +++ b/edivorce/apps/core/templates/dashboard/help_saving_pdf.html @@ -96,6 +96,10 @@
+
+    Back +
+ {% endblock %} {% block backToDashboard %} diff --git a/edivorce/apps/core/templates/dashboard/help_scanning.html b/edivorce/apps/core/templates/dashboard/help_scanning.html index 066b290a..001d0225 100644 --- a/edivorce/apps/core/templates/dashboard/help_scanning.html +++ b/edivorce/apps/core/templates/dashboard/help_scanning.html @@ -27,12 +27,13 @@
  • Microsoft Windows - 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 - Microsoft’s help on Installing and Using a Scanner in Windows 10. + For more information see Microsoft’s help on + + Installing and Using a Scanner in Windows 10.
  • Apple OS X - 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 Scanning images or documents using your Mac.
  • @@ -97,6 +98,14 @@

    + +
    + +    Back + +
    + {% endblock %} {% block backToDashboard %} diff --git a/edivorce/apps/core/templates/dashboard/initial_filing.html b/edivorce/apps/core/templates/dashboard/initial_filing.html index 421170f5..99704e22 100644 --- a/edivorce/apps/core/templates/dashboard/initial_filing.html +++ b/edivorce/apps/core/templates/dashboard/initial_filing.html @@ -54,7 +54,7 @@ remaining documents required to complete your divorce.

    Missing a form required on this page? Check the Review Forms step.

    -

    Need help with Scanning your documents?

    +

    Need help with Scanning your documents?

    {% if how_to_sign == 'Together' and signing_location == 'In-person' %} diff --git a/edivorce/apps/core/templates/partials/alias_field.html b/edivorce/apps/core/templates/partials/alias_field.html index 1946418e..7e299db9 100644 --- a/edivorce/apps/core/templates/partials/alias_field.html +++ b/edivorce/apps/core/templates/partials/alias_field.html @@ -15,19 +15,19 @@

    First Name

    - {% 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" %}

    Middle Name 1

    - {% 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" %}

    Middle Name 2

    - {% 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" %}

    Last Name

    - {% 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" %}
    diff --git a/edivorce/apps/core/templates/question/02_claimant.html b/edivorce/apps/core/templates/question/02_claimant.html index 3e34e10c..69e87240 100644 --- a/edivorce/apps/core/templates/question/02_claimant.html +++ b/edivorce/apps/core/templates/question/02_claimant.html @@ -39,7 +39,10 @@
    -

    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.

    +

    + 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 “Do you go by any other names”. +

    diff --git a/edivorce/apps/core/templates/question/03_respondent.html b/edivorce/apps/core/templates/question/03_respondent.html index 41c9db10..3d5d5aa3 100644 --- a/edivorce/apps/core/templates/question/03_respondent.html +++ b/edivorce/apps/core/templates/question/03_respondent.html @@ -43,9 +43,10 @@ diff --git a/edivorce/apps/core/templates/success.html b/edivorce/apps/core/templates/success.html index 19dfe1da..a503e187 100644 --- a/edivorce/apps/core/templates/success.html +++ b/edivorce/apps/core/templates/success.html @@ -19,26 +19,27 @@

    2. Register or Login

    - You will need a Basic BCeID or BC Services Card account to access the Online Divorce Assistant. + You will need a Basic BCeID account to access the Online Divorce Assistant. This will also enable you to securely access multiple other online government services.

    -
    +

    Register for a Basic BCeID

    Once you register, you’ll be taken back to this website.

    Register
    + +

    Login with a BCeID or BC Services Card

    Once you login, you’ll be taken back to this website.

    diff --git a/edivorce/apps/core/templatetags/input_field.py b/edivorce/apps/core/templatetags/input_field.py index 6c87abf9..5fc9daa4 100644 --- a/edivorce/apps/core/templatetags/input_field.py +++ b/edivorce/apps/core/templatetags/input_field.py @@ -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' diff --git a/edivorce/apps/core/urls.py b/edivorce/apps/core/urls.py index 2efc8f7d..e4fe18e9 100644 --- a/edivorce/apps/core/urls.py +++ b/edivorce/apps/core/urls.py @@ -13,6 +13,7 @@ urlpatterns = [ path('api/documents///x//', 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"), diff --git a/edivorce/apps/core/utils/efiling_packaging.py b/edivorce/apps/core/utils/efiling_packaging.py index 39682d03..8819e27d 100644 --- a/edivorce/apps/core/utils/efiling_packaging.py +++ b/edivorce/apps/core/utils/efiling_packaging.py @@ -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: diff --git a/edivorce/apps/core/utils/efiling_submission.py b/edivorce/apps/core/utils/efiling_submission.py index f53aca0d..84b334b3 100644 --- a/edivorce/apps/core/utils/efiling_submission.py +++ b/edivorce/apps/core/utils/efiling_submission.py @@ -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}' diff --git a/edivorce/apps/core/utils/question_step_mapping.py b/edivorce/apps/core/utils/question_step_mapping.py index 1b141885..74a83d5d 100644 --- a/edivorce/apps/core/utils/question_step_mapping.py +++ b/edivorce/apps/core/utils/question_step_mapping.py @@ -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' + } } diff --git a/edivorce/apps/core/views/api.py b/edivorce/apps/core/views/api.py index d246334c..2fed06c2 100644 --- a/edivorce/apps/core/views/api.py +++ b/edivorce/apps/core/views/api.py @@ -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) diff --git a/edivorce/apps/core/views/main.py b/edivorce/apps/core/views/main.py index 04042efa..0adb3c73 100644 --- a/edivorce/apps/core/views/main.py +++ b/edivorce/apps/core/views/main.py @@ -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