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

Issue/venray branch 3 #1457

Closed
wants to merge 6 commits into from
Closed
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
7 changes: 5 additions & 2 deletions src/open_inwoner/cms/cases/views/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,14 @@ def get_context_data(self, **kwargs):
self.case.zaaktype.url
)

# NOTE we cannot sort on the Status.datum_status_gezet (datetime) because eSuite
# NOTE we cannot always sort on the Status.datum_status_gezet (datetime) because eSuite
# returns zeros as the time component of the datetime, so we're going with the
# observation that on both OpenZaak and eSuite the returned list is ordered 'oldest-last'
# here we want it 'oldest-first' so we reverse() it instead of sort()-ing
statuses.reverse()
if config.order_statusses_by_date_set:
statuses.sort(key=lambda s: s.datum_status_gezet)
else:
statuses.reverse()

# get preview of second status
if len(statuses) == 1:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 4.2.16 on 2024-10-15 10:12

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("openzaak", "0055_openzaakconfig_zaken_filter_enabled"),
]

operations = [
migrations.AddField(
model_name="openzaakconfig",
name="order_statusses_by_date_set",
field=models.BooleanField(
default=False,
help_text="If enabled, order the statusses of a case based on 'datum_status_gezet'. If not enabled, we show the statusses in the reverse order they are returned via the API, this because the eSuite does not return the timestamps of the statusses (eSuite, but also works for Open Zaak).",
verbose_name="On the detail page of the case, order the statusses on the date they have been set",
),
),
]
13 changes: 13 additions & 0 deletions src/open_inwoner/openzaak/migrations/0057_merge_20241021_2155.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Generated by Django 4.2.16 on 2024-10-21 19:55

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
("openzaak", "0056_openzaakconfig_order_statusses_by_date_set"),
("openzaak", "0056_openzaakconfig_use_zaak_omschrijving_as_title"),
]

operations = []
10 changes: 10 additions & 0 deletions src/open_inwoner/openzaak/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,16 @@ def form_service(self, service):
default=False,
)

order_statusses_by_date_set = models.BooleanField(
verbose_name=_(
"On the detail page of the case, order the statusses on the date they have been set"
),
help_text=_(
"If enabled, order the statusses of a case based on 'datum_status_gezet'. "
"If not enabled, we show the statusses in the reverse order they are returned via the API, this because the eSuite does not return the timestamps of the statusses (eSuite, but also works for Open Zaak)."
),
)

use_zaak_omschrijving_as_title = models.BooleanField(
verbose_name=_(
"Make use of zaak.omschrijving for the title of the cases instead of "
Expand Down
Loading