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

[#45] Destruction list detail view #54

Merged
merged 19 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
ec116bd
:construction: [#45] Detail view for destruction list
SilviaAmAm May 23, 2024
6212ba7
:construction: [#45] Implement form to update the reviewers
SilviaAmAm May 24, 2024
e8a7db0
:heavy_plus_sign: [#45] Add react-use
SilviaAmAm May 27, 2024
995b50b
:construction: [#45] Continue building detail page
SilviaAmAm May 27, 2024
4757a2a
:construction: [#45] Add a grid with the zaken in the list
SilviaAmAm May 27, 2024
3c459d3
:construction: [#45] Add actions to the table with zaken
SilviaAmAm May 28, 2024
ca4a28b
:construction: [#45] Handle selecting zaken in the editable table
SilviaAmAm May 28, 2024
2348d84
:construction: [#45] Added paginator to component for editing zaken
SilviaAmAm May 29, 2024
60c8b6e
:recycle: Make filter fields reusable
SilviaAmAm May 29, 2024
7a3e4c6
:construction: [#45] Make table with zaken filterable
SilviaAmAm May 29, 2024
f4c5e57
:recycle: [#45] Refactor function for updating zaken selection
SilviaAmAm May 29, 2024
faf3dd2
:construction: [#45] Add functionalty to update the zaken
SilviaAmAm May 29, 2024
06a3503
:bug: [#45] Handle case in which a reviewer is removed
SilviaAmAm May 29, 2024
34053b6
:ok_hand: [#45] PR Feedback 1
SilviaAmAm May 31, 2024
a5a6f40
:sparkles: [#45] Add error component now that it's refactored in admi…
SilviaAmAm May 31, 2024
c853a37
:recycle: Update components after changes in admin UI
SilviaAmAm Jun 4, 2024
17de51d
:recycle: [#45] Use uuids instead of pk
SilviaAmAm Jun 7, 2024
ef39a58
:ok_hand: [#45] PR Feedback
SilviaAmAm Jun 7, 2024
4d44a87
:twisted_rightwards_arrows: Resolve rebase problems
SilviaAmAm Jun 7, 2024
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
17 changes: 11 additions & 6 deletions backend/src/openarchiefbeheer/zaken/api/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
)
from django.utils.translation import gettext_lazy as _

from django_filters import BooleanFilter, CharFilter, FilterSet, NumberFilter
from django_filters import (
BooleanFilter,
CharFilter,
FilterSet,
NumberFilter,
UUIDFilter,
)

from openarchiefbeheer.destruction.constants import ListItemStatus
from openarchiefbeheer.destruction.models import DestructionListItem
Expand All @@ -28,14 +34,13 @@ class ZaakFilter(FilterSet):
"If True, only cases not already included in a destruction list are returned."
),
)
not_in_destruction_list_except = NumberFilter(
not_in_destruction_list_except = UUIDFilter(
field_name="not_in_destruction_list_except",
method="filter_not_in_destruction_list_except",
help_text=_(
"Only cases not already included in a destruction list except the one specified are returned. "
"The cases that are included in the 'exception' list are returned first."
),
decimal_places=0,
)
_expand__resultaat__resultaattype = CharFilter(
help_text=_("Filter on the exact URL of resultaattype."),
Expand Down Expand Up @@ -149,14 +154,14 @@ def filter_not_in_destruction_list(
return queryset.exclude(url__in=Subquery(zaken_to_exclude))

def filter_not_in_destruction_list_except(
self, queryset: QuerySet[Zaak], name: str, value: int
self, queryset: QuerySet[Zaak], name: str, value: str
):
zaken_to_exclude = DestructionListItem.objects.filter(
~Q(status=ListItemStatus.removed) & ~Q(destruction_list=value)
~Q(status=ListItemStatus.removed) & ~Q(destruction_list__uuid=value)
).values_list("zaak", flat=True)

exception_list = DestructionListItem.objects.filter(
destruction_list=value
destruction_list__uuid=value
).values_list("zaak", flat=True)

return (
Expand Down
2 changes: 1 addition & 1 deletion backend/src/openarchiefbeheer/zaken/tests/test_viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def test_filter_out_zaken_already_in_destruction_lists_except_one(self):
user = UserFactory(username="record_manager", role__can_start_destruction=True)

endpoint = furl(reverse("api:zaken-list"))
endpoint.args["not_in_destruction_list_except"] = item.destruction_list.pk
endpoint.args["not_in_destruction_list_except"] = item.destruction_list.uuid

self.client.force_authenticate(user)
response = self.client.get(endpoint.url)
Expand Down
Loading
Loading