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

CS UAT Changes #533

Merged
merged 83 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
95b6924
Dev ops task 7149: UX CS Move Assessment & Referral Comments to botto…
oakdbca Nov 6, 2024
7924e0d
Remove unused constants.
oakdbca Nov 6, 2024
bebc778
Remove unused computed.
oakdbca Nov 6, 2024
33879fa
Dev ops task 7135: Change display value of 'With Approver' to 'Propos…
oakdbca Nov 6, 2024
94ec462
Dev ops task 7164: CS workflow changes - Disable final outcome + Defe…
oakdbca Nov 6, 2024
fc9b857
Replace red text message 'Do not upload Management or Recovery Plans …
oakdbca Nov 6, 2024
4bbea14
Dev ops task 7173: Bug: CS Regression - Add Document button missing f…
oakdbca Nov 6, 2024
91b4042
Add icon.
oakdbca Nov 6, 2024
1641977
Dev ops task 7150: CS additional Administrative fields: CAM MOU + Dat…
oakdbca Nov 6, 2024
49ae707
Dev ops task 7147: UX CS - Add Scientific Name/Community ID to Header.
oakdbca Nov 6, 2024
37358f6
Dev ops task 7128: OCR and CS - Decide what to do with unused approve…
oakdbca Nov 7, 2024
113435c
Add public_consultation, public_consultation_start_date and public_co…
oakdbca Nov 7, 2024
fb7ebfa
Dev ops task 7151: CS additional Administrative fields: Public Consul…
oakdbca Nov 7, 2024
3830938
Only show the public consultation section when the approval level is …
oakdbca Nov 7, 2024
3002d53
Remove unused processing statuses.
oakdbca Nov 8, 2024
115cbe9
Remove unused processing statuses. Add in new required processing sta…
oakdbca Nov 8, 2024
36b576a
Migrations for processing status changes to Occurrence Report and Con…
oakdbca Nov 8, 2024
38c1747
Change labels for 'International Conservation' to 'Other Conservation…
oakdbca Nov 8, 2024
a0d1dd4
Change WAITING TO AWAITING in processing status filter groups.
oakdbca Nov 8, 2024
664f631
Update processing status drop down to include new processing status f…
oakdbca Nov 8, 2024
61c387e
Add variables to hold the values for the new processing status filter…
oakdbca Nov 8, 2024
d78f921
Add backend filtering for new filter group options.
oakdbca Nov 8, 2024
a3fde35
Update label for International Conservation to Other Conservation Ass…
oakdbca Nov 8, 2024
5ac458b
Update CS processing statuses.
oakdbca Nov 8, 2024
eb4575e
Removed unused processing status.
oakdbca Nov 8, 2024
b5dc501
Update proposal status keys.
oakdbca Nov 8, 2024
293a83a
Correct case.
oakdbca Nov 8, 2024
39ed361
Update condition for when to display the back to assessor action button.
oakdbca Nov 8, 2024
2cd3ba4
New defer email templates.
oakdbca Nov 8, 2024
d7070f6
Add defer_cs_proposal endpoint.
oakdbca Nov 8, 2024
758b69a
Add send_approver_defer_email_notification function.
oakdbca Nov 8, 2024
a5f5844
Add defer cs endpoint.
oakdbca Nov 8, 2024
e07bc61
Add defer method to CS model.
oakdbca Nov 8, 2024
2e2c332
Add new defer CS modal component.
oakdbca Nov 8, 2024
7abf8b1
Incorporate new defer action.
oakdbca Nov 8, 2024
b576770
Allow user to enter a review due date in the defer modal.
oakdbca Nov 11, 2024
05460ee
New proposed for agenda email templates.
oakdbca Nov 11, 2024
5074d59
Rename proposed_ready_for_agenda call to proposed_for_agenda.
oakdbca Nov 11, 2024
6fe57fe
Change wording from Proposed Ready for Agenda to Proposed for Agenda.
oakdbca Nov 11, 2024
03ddfb3
Add new send_approver_proposed_for_agenda_email_notification function.
oakdbca Nov 11, 2024
1a43d0e
Split proposed for agenda and ready for agenda functionality into sep…
oakdbca Nov 11, 2024
8471308
Change generic myModal id to component appropriate name.
oakdbca Nov 11, 2024
2170bfe
Update propose for agenda template path.:
oakdbca Nov 11, 2024
1aec869
Correct case for Proposed For Agenda.
oakdbca Nov 11, 2024
2ee5ca3
Add ready for agenda endpoint and make proposed for agenda and ready …
oakdbca Nov 11, 2024
7a4c8c2
Add ready for agenda modal.
oakdbca Nov 11, 2024
9aca5ff
Rename propose ready for agenda component to propose for agenda.
oakdbca Nov 11, 2024
af817c0
When adding a CS to agenda update it's processing status to On Agenda…
oakdbca Nov 11, 2024
69c9fa8
Update methods to include On Agenda processing status in permission c…
oakdbca Nov 11, 2024
23071ab
Change abstract list models to be able to be specified as applicable …
oakdbca Nov 12, 2024
4627729
Change international_conservation field name to other_conservation_as…
oakdbca Nov 12, 2024
b16d4a7
Allow most form fields to be edited when the status is deferred. User…
oakdbca Nov 12, 2024
cc5e325
Changes to support new Deferred processing status and adding new step…
oakdbca Nov 12, 2024
ce53bb7
Allow user to see assessment comments when processing status is defer…
oakdbca Nov 12, 2024
6f36d6c
Remove Deferred from the awaiting approver action list of statuses.
oakdbca Nov 12, 2024
bed4f53
Add IUCNVersion model.
oakdbca Nov 12, 2024
2032059
Fix iucn version verbose name.
oakdbca Nov 12, 2024
b29048d
Add basic admin for IUCNVersion model.
oakdbca Nov 12, 2024
5817dc1
Add iucn_version field to CS model.
oakdbca Nov 12, 2024
42e40b2
Add iucn_version and iucn_version_id fields to serializers as required.
oakdbca Nov 12, 2024
0767c86
Add iucn_versions to dicts in appropriate end points.
oakdbca Nov 12, 2024
3b11424
Add iucn version to proposed and current CS sections. Fix bug with ch…
oakdbca Nov 12, 2024
3f4125e
Remove top-buffer-s class from codebase and replace with standard boo…
oakdbca Nov 12, 2024
a55e83e
Add margin under action heading.
oakdbca Nov 12, 2024
9e0d6dd
Change label from Commonwealth Conservation List to Commonwealth Cons…
oakdbca Nov 13, 2024
32fbd5a
Bug fix with missing data variable iucn_versions.
oakdbca Nov 13, 2024
760deae
Layout bug fix with missing padding under Approve action button.
oakdbca Nov 13, 2024
603138d
Modify Meeting model so that lodgement date is set when meeting it sc…
oakdbca Nov 13, 2024
17fb976
Bug fix: Allow users to defer a CS that is On Agenda status.
oakdbca Nov 13, 2024
ecbd34c
Add most_recent_meeting_completed property to CS model.
oakdbca Nov 13, 2024
4f700bd
Make workflow panel sticky.
oakdbca Nov 13, 2024
78f5aef
Fix CS excel and csv export (species and communities).
oakdbca Nov 13, 2024
568cefa
Dev ops task 7270: CS Bug: Just after approving a CS the Search for R…
oakdbca Nov 13, 2024
d0f837b
npm update
oakdbca Nov 13, 2024
da7e343
Replace lodgement_date with datetime_scheduled. Add fields for dateti…
oakdbca Nov 14, 2024
dac1f9d
Add new meeting side panel component to show the person that created …
oakdbca Nov 14, 2024
c03330a
Add new meeting side panel.
oakdbca Nov 14, 2024
62b83bc
Add most_recent_meeting property. Modify how most recent meeting is c…
oakdbca Nov 14, 2024
d949b12
Add most_recent_meeting and most_recent_meeting_completed fields to I…
oakdbca Nov 14, 2024
86e9579
Minor wording change.
oakdbca Nov 14, 2024
ed3d937
Wording change.
oakdbca Nov 14, 2024
50e3801
Add validation for mandatory attendees field when meeting is not comm…
oakdbca Nov 14, 2024
1ff0630
Add extra status info about linked meeting if CS is On Agenda. Only s…
oakdbca Nov 14, 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
13 changes: 12 additions & 1 deletion boranga/components/conservation_status/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ class ProposalAmendmentReasonAdmin(


class AbstractListAdmin(DeleteProtectedModelAdmin):
list_display = ["code", "label", "applies_to_species", "applies_to_communities"]
list_display = [
"code",
"label",
"applies_to_flora",
"applies_to_fauna",
"applies_to_communities",
]


class AbstractCategoryAdmin(DeleteProtectedModelAdmin):
Expand All @@ -27,6 +33,10 @@ class WAPriorityCategoryAdmin(ArchivableModelAdminMixin, AbstractCategoryAdmin):
filter_horizontal = ("wa_priority_lists",)


class IUCNVersionAdmin(ArchivableModelAdminMixin, AbstractListAdmin):
pass


class WALegislativeListAdmin(ArchivableModelAdminMixin, AbstractListAdmin):
pass

Expand All @@ -47,6 +57,7 @@ class ConservationChangeCodeAdmin(ArchivableModelAdminMixin, DeleteProtectedMode
admin.site.register(models.WAPriorityCategory, WAPriorityCategoryAdmin)
admin.site.register(models.WALegislativeList, WALegislativeListAdmin)
admin.site.register(models.WALegislativeCategory, WALegislativeCategoryAdmin)
admin.site.register(models.IUCNVersion, IUCNVersionAdmin)
admin.site.register(
models.CommonwealthConservationList, CommonwealthConservationListAdmin
)
Expand Down
108 changes: 89 additions & 19 deletions boranga/components/conservation_status/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
ConservationStatusReferral,
ConservationStatusUserAction,
CSExternalRefereeInvite,
IUCNVersion,
ProposalAmendmentReason,
WALegislativeCategory,
WALegislativeList,
Expand Down Expand Up @@ -171,6 +172,7 @@ def get(self, request, format=None):
"wa_legislative_categories": WALegislativeCategory.get_categories_dict(
group_type, active_only=True
),
"iucn_versions": IUCNVersion.get_lists_dict(group_type, active_only=True),
"commonwealth_conservation_lists": CommonwealthConservationList.get_lists_dict(
group_type, active_only=True
),
Expand Down Expand Up @@ -326,10 +328,10 @@ def filter_queryset(self, request, queryset, view):
)
if filter_international_relevance == "true":
if queryset.model is ConservationStatus:
queryset = queryset.exclude(international_conservation__isnull=True)
queryset = queryset.exclude(other_conservation_assessment__isnull=True)
elif queryset.model is ConservationStatusReferral:
queryset = queryset.exclude(
conservation_status__international_conservation__isnull=True
conservation_status__other_conservation_assessment__isnull=True
)

filter_from_effective_from_date = request.POST.get(
Expand Down Expand Up @@ -414,6 +416,27 @@ def filter_queryset(self, request, queryset, view):
submitter=request.user.id,
processing_status=ConservationStatus.PROCESSING_STATUS_DISCARDED,
)
elif (
filter_application_status
== ConservationStatus.PROCESSING_STATUS_AWAITING_ASSESSOR_ACTION
):
queryset = queryset.filter(
processing_status__in=ConservationStatus.PROCESSING_STATUSES_AWAITING_ASSESSOR_ACTION
)
elif (
filter_application_status
== ConservationStatus.PROCESSING_STATUS_AWAITING_APPROVER_ACTION
):
queryset = queryset.filter(
processing_status__in=ConservationStatus.PROCESSING_STATUSES_AWAITING_APPROVER_ACTION
)
elif (
filter_application_status
== ConservationStatus.PROCESSING_STATUS_INACTIVE
):
queryset = queryset.filter(
processing_status__in=ConservationStatus.PROCESSING_STATUSES_INACTIVE
)
else:
queryset = queryset.filter(
processing_status=filter_application_status
Expand Down Expand Up @@ -567,21 +590,23 @@ def species_cs_internal_export(self, request, *args, **kwargs):
"genus",
"phylogenetic_group",
"processing_status",
"effective_from_date",
"effective_to_date",
"effective_from",
"effective_to",
"conservation_status_number",
]

serializer = ListSpeciesConservationStatusSerializer(
qs, context={"request": request}, many=True
)
serialized_data = serializer.data

filtered_data = []
for obj in serialized_data:
filtered_obj = {
key: value for key, value in obj.items() if key in allowed_fields
}
for key, value in obj.items():
if key == "phylogenetic_group":
filtered_obj[key] = ", ".join(value)
filtered_data.append(filtered_obj)

def flatten_dict(d, parent_key="", sep="_"):
Expand All @@ -603,7 +628,7 @@ def flatten_dict(d, parent_key="", sep="_"):
"Common Name",
"Family",
"Genera",
"Phylo Group",
"Phylo Group(s)",
"Processing Status",
"Effective From Date",
"Effective To Date",
Expand All @@ -618,6 +643,7 @@ def flatten_dict(d, parent_key="", sep="_"):
"Effective To Date",
"Family",
"Genera",
"Phylo Group(s)",
"Processing Status",
]
df = df[column_order]
Expand Down Expand Up @@ -913,10 +939,10 @@ def filter_queryset(self, request, queryset, view):
)
if filter_international_relevance == "true":
if queryset.model is ConservationStatus:
queryset = queryset.exclude(international_conservation__isnull=True)
queryset = queryset.exclude(other_conservation_assessment__isnull=True)
elif queryset.model is ConservationStatusReferral:
queryset = queryset.exclude(
conservation_status__international_conservation__isnull=True
conservation_status__other_conservation_assessment__isnull=True
)

filter_from_effective_from_date = request.POST.get(
Expand Down Expand Up @@ -1000,6 +1026,27 @@ def filter_queryset(self, request, queryset, view):
submitter=request.user.id,
processing_status=ConservationStatus.PROCESSING_STATUS_DISCARDED,
)
elif (
filter_application_status
== ConservationStatus.PROCESSING_STATUS_AWAITING_ASSESSOR_ACTION
):
queryset = queryset.filter(
processing_status__in=ConservationStatus.PROCESSING_STATUSES_AWAITING_ASSESSOR_ACTION
)
elif (
filter_application_status
== ConservationStatus.PROCESSING_STATUS_AWAITING_APPROVER_ACTION
):
queryset = queryset.filter(
processing_status__in=ConservationStatus.PROCESSING_STATUSES_AWAITING_APPROVER_ACTION
)
elif (
filter_application_status
== ConservationStatus.PROCESSING_STATUS_INACTIVE
):
queryset = queryset.filter(
processing_status__in=ConservationStatus.PROCESSING_STATUSES_INACTIVE
)
else:
queryset = queryset.filter(
processing_status=filter_application_status
Expand Down Expand Up @@ -1149,11 +1196,9 @@ def community_cs_internal_export(self, request, *args, **kwargs):
"community_number",
"community_migrated_id",
"community_name",
"region",
"district",
"processing_status",
"effective_from_date",
"effective_to_date",
"effective_from",
"effective_to",
]

serializer = ListCommunityConservationStatusSerializer(
Expand All @@ -1167,6 +1212,7 @@ def community_cs_internal_export(self, request, *args, **kwargs):
key: value for key, value in obj.items() if key in allowed_fields
}
filtered_data.append(filtered_obj)
logger.debug(filtered_data)

def flatten_dict(d, parent_key="", sep="_"):
flattened_dict = {}
Expand All @@ -1185,8 +1231,6 @@ def flatten_dict(d, parent_key="", sep="_"):
"Community",
"Community Id",
"Community Name",
"Region",
"District",
"Processing Status",
"Effective From Date",
"Effective To Date",
Expand All @@ -1197,8 +1241,6 @@ def flatten_dict(d, parent_key="", sep="_"):
"Community",
"Community Id",
"Community Name",
"Region",
"District",
"Effective From Date",
"Effective To Date",
"Processing Status",
Expand Down Expand Up @@ -1935,14 +1977,28 @@ def switch_status(self, request, *args, **kwargs):

@detail_route(
methods=[
"POST",
"PATCH",
],
detail=True,
permission_classes=[ConservationStatusPermission],
)
def proposed_ready_for_agenda(self, request, *args, **kwargs):
def proposed_for_agenda(self, request, *args, **kwargs):
instance = self.get_object()
instance.proposed_ready_for_agenda(request)
instance.proposed_for_agenda(request)
serializer_class = self.internal_serializer_class()
serializer = serializer_class(instance, context={"request": request})
return Response(serializer.data)

@detail_route(
methods=[
"PATCH",
],
detail=True,
permission_classes=[ConservationStatusPermission],
)
def ready_for_agenda(self, request, *args, **kwargs):
instance = self.get_object()
instance.ready_for_agenda(request)
serializer_class = self.internal_serializer_class()
serializer = serializer_class(instance, context={"request": request})
return Response(serializer.data)
Expand Down Expand Up @@ -2012,6 +2068,18 @@ def reinstate(self, request, *args, **kwargs):
serializer = self.get_serializer(instance)
return Response(serializer.data)

@detail_route(methods=["patch"], detail=True)
def defer(self, request, *args, **kwargs):
instance = self.get_object()
reason = request.data.get("reason")
review_due_date = request.data.get("review_due_date", None)
if not reason:
raise serializers.ValidationError("Reason is required")
instance.defer(request, reason, review_due_date)
serializer_class = self.internal_serializer_class()
serializer = serializer_class(instance, context={"request": request})
return Response(serializer.data)

@detail_route(
methods=["patch"],
detail=True,
Expand Down Expand Up @@ -2267,6 +2335,7 @@ def filter_list(self, request, *args, **kwargs):
"wa_legislative_categories": WALegislativeCategory.get_categories_dict(
group_type
),
"iucn_versions": IUCNVersion.get_lists_dict(group_type),
"commonwealth_conservation_lists": CommonwealthConservationList.get_lists_dict(
group_type
),
Expand Down Expand Up @@ -2330,6 +2399,7 @@ def community_filter_list(self, request, *args, **kwargs):
"wa_legislative_categories": WALegislativeCategory.get_categories_dict(
group_type
),
"iucn_versions": IUCNVersion.get_lists_dict(group_type),
"commonwealth_conservation_lists": CommonwealthConservationList.get_lists_dict(
group_type
),
Expand Down
Loading
Loading