Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1306-7] Update case and case type texts in case list and status views #569

Merged
merged 2 commits into from
Apr 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/open_inwoner/accounts/views/cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,11 @@ def process_cases(self, cases: List[Zaak]) -> List[dict]:
"uuid": str(case.uuid),
"start_date": case.startdatum,
"end_date": getattr(case, "einddatum", None),
"description": case.omschrijving,
"zaaktype_description": case.zaaktype.omschrijving,
"description": (
case.omschrijving
if case.omschrijving
else case.zaaktype.omschrijving
),
"current_status": glom(
case, "status.statustype.omschrijving", default=""
),
Expand Down Expand Up @@ -347,8 +350,11 @@ def get_context_data(self, **kwargs):
"end_date_legal": getattr(
self.case, "uiterlijke_einddatum_afdoening", None
),
"description": self.case.omschrijving,
"type_description": self.case.zaaktype.omschrijving,
"description": (
self.case.omschrijving
if self.case.omschrijving
else self.case.zaaktype.omschrijving
),
"current_status": glom(
self.case,
"status.statustype.omschrijving",
Expand Down
1 change: 0 additions & 1 deletion src/open_inwoner/components/templatetags/table_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def add_row_if_not_empty(key, label):
rows.append(row)

add_row_if_not_empty("initiator", _("Aanvrager"))
add_row_if_not_empty("type_description", _("Type"))
add_row_if_not_empty("result", _("Resultaat"))
add_row_if_not_empty("end_date", _("Einddatum"))
add_row_if_not_empty("end_date_planned", _("Verwachte einddatum"))
Expand Down
24 changes: 8 additions & 16 deletions src/open_inwoner/components/tests/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ class TestCaseTable(InclusionTagWebTest):
args = {
"case": {
"initiator": "Case initiator",
"type_description": "Case description",
"result": "Case result",
"end_date": "Case end date",
"end_date_planned": "Case end date planned",
Expand All @@ -118,36 +117,29 @@ def test_case_content(self):
)

self.assertTextContent(
".table__row:nth-child(2) .table__header", "Type", self.args
".table__row:nth-child(2) .table__header", "Resultaat", self.args
)
self.assertTextContent(
".table__row:nth-child(2) .table__item", "Case description", self.args
".table__row:nth-child(2) .table__item", "Case result", self.args
)

self.assertTextContent(
".table__row:nth-child(3) .table__header", "Resultaat", self.args
".table__row:nth-child(3) .table__header", "Einddatum", self.args
)
self.assertTextContent(
".table__row:nth-child(3) .table__item", "Case result", self.args
".table__row:nth-child(3) .table__item", "Case end date", self.args
)

self.assertTextContent(
".table__row:nth-child(4) .table__header", "Einddatum", self.args
".table__row:nth-child(4) .table__header", "Verwachte einddatum", self.args
)
self.assertTextContent(
".table__row:nth-child(4) .table__item", "Case end date", self.args
".table__row:nth-child(4) .table__item", "Case end date planned", self.args
)

self.assertTextContent(
".table__row:nth-child(5) .table__header", "Verwachte einddatum", self.args
".table__row:nth-child(5) .table__header", "Wettelijke termijn", self.args
)
self.assertTextContent(
".table__row:nth-child(5) .table__item", "Case end date planned", self.args
)

self.assertTextContent(
".table__row:nth-child(6) .table__header", "Wettelijke termijn", self.args
)
self.assertTextContent(
".table__row:nth-child(6) .table__item", "Case end date legal", self.args
".table__row:nth-child(5) .table__item", "Case end date legal", self.args
)
2 changes: 0 additions & 2 deletions src/open_inwoner/openzaak/tests/test_case_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ def test_status_is_retrieved_when_user_logged_in_via_digid(self, m):
"end_date_planned": datetime.date(2022, 1, 4),
"end_date_legal": datetime.date(2022, 1, 5),
"description": "Zaak naar aanleiding van ingezonden formulier",
"type_description": "Coffee zaaktype",
"current_status": "Finish",
"statuses": [status_new_obj, status_finish_obj],
# only one visible information object
Expand All @@ -382,7 +381,6 @@ def test_page_displays_expected_data(self, m):

self.assertContains(response, "ZAAK-2022-0000000024")
self.assertContains(response, "Zaak naar aanleiding van ingezonden formulier")
self.assertContains(response, "Coffee zaaktype")
self.assertContains(response, "Finish")
self.assertContains(response, "document")
self.assertContains(response, "Foo Bar van der Bazz")
Expand Down
5 changes: 0 additions & 5 deletions src/open_inwoner/openzaak/tests/test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ def test_list_open_cases(self, m):
"end_date": None,
"identificatie": self.zaak2["identificatie"],
"description": self.zaak2["omschrijving"],
"zaaktype_description": self.zaaktype["omschrijving"],
"current_status": self.status_type1["omschrijving"],
},
{
Expand All @@ -324,7 +323,6 @@ def test_list_open_cases(self, m):
"end_date": None,
"identificatie": self.zaak1["identificatie"],
"description": self.zaak1["omschrijving"],
"zaaktype_description": self.zaaktype["omschrijving"],
"current_status": self.status_type1["omschrijving"],
},
],
Expand Down Expand Up @@ -406,7 +404,6 @@ def test_list_closed_cases(self, m):
"end_date": datetime.date.fromisoformat(self.zaak3["einddatum"]),
"identificatie": self.zaak3["identificatie"],
"description": self.zaak3["omschrijving"],
"zaaktype_description": self.zaaktype["omschrijving"],
"current_status": self.status_type2["omschrijving"],
},
],
Expand Down Expand Up @@ -486,7 +483,6 @@ def test_list_cases_paginated(self, m):
"end_date": None,
"identificatie": self.zaak2["identificatie"],
"description": self.zaak2["omschrijving"],
"zaaktype_description": self.zaaktype["omschrijving"],
"current_status": self.status_type1["omschrijving"],
},
],
Expand All @@ -508,7 +504,6 @@ def test_list_cases_paginated(self, m):
"end_date": None,
"identificatie": self.zaak1["identificatie"],
"description": self.zaak1["omschrijving"],
"zaaktype_description": self.zaaktype["omschrijving"],
"current_status": self.status_type1["omschrijving"],
},
],
Expand Down
4 changes: 2 additions & 2 deletions src/open_inwoner/templates/pages/cases/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ <h2 class="h2" id="cases">{{ page_title }} ({{ paginator.count }})</h2>
<div class="card__body">
<a href="{% url 'accounts:case_status' object_id=case.uuid %}" class="cases__link">
<p class="h4">
<span class="link link__text">{{ case.identificatie }}</span>
<span class="link link__text">{{ case.description }}</span>
</p>
{% render_list %}
<span class="case-list">
{% list_item case.current_status caption=_("Status") compact=True strong=False %}
{% list_item case.start_date caption=_("Ontvangstdatum") compact=True strong=False %}
{% list_item case.description caption=_("Omschrijving") compact=True strong=False %}
{% list_item case.identificatie caption=_("Zaaknummer") compact=True strong=False %}
</span>
{% endrender_list %}

Expand Down