Skip to content

Commit

Permalink
Add filter is_parent for assessment-registry issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rup-Narayan-Rajbanshi committed Sep 22, 2023
1 parent a6ed0f5 commit 60d8e80
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions apps/assessment_registry/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class AssessmentRegistryIssueGQFilterSet(django_filters.FilterSet):
sub_pillar = SimpleInputFilter(AssessmentRegistrySummarySubPillarTypeEnum)
sub_dimension = SimpleInputFilter(AssessmentRegistrySummarySubDimensionTypeEnum)
search = django_filters.CharFilter(method='filter_assessment_registry_issues')
is_parent = django_filters.BooleanFilter(method='filter_is_parent')

class Meta:
model = SummaryIssue
Expand All @@ -74,3 +75,10 @@ def filter_assessment_registry_issues(self, qs, name, value):
return qs.filter(
label__icontains=value
)

def filter_is_parent(self, qs, name, value):
if not value:
return qs
return qs.filter(
parent__isnull=True
)
2 changes: 1 addition & 1 deletion schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3487,7 +3487,7 @@ type PublicProjectWithMembershipData {

type Query {
assessmentRegSummaryIssue(id: ID!): AssessmentRegistrySummaryIssueType
assessmentRegSummaryIssues(label: String, parent: ID, subPillar: AssessmentRegistrySummarySubPillarTypeEnum, subDimension: AssessmentRegistrySummarySubDimensionTypeEnum, search: String, page: Int = 1, ordering: String, pageSize: Int): AssessmentRegistrySummaryIssueListType
assessmentRegSummaryIssues(label: String, parent: ID, subPillar: AssessmentRegistrySummarySubPillarTypeEnum, subDimension: AssessmentRegistrySummarySubDimensionTypeEnum, search: String, isParent: Boolean, page: Int = 1, ordering: String, pageSize: Int): AssessmentRegistrySummaryIssueListType
deepExploreStats(filter: ExploreDeepFilterInputType!): ExploreDashboardStatType
publicDeepExploreYearlySnapshots: [PublicExploreSnapshotType!]
publicDeepExploreGlobalSnapshots: [PublicExploreSnapshotType!]
Expand Down

0 comments on commit 60d8e80

Please sign in to comment.