-
Notifications
You must be signed in to change notification settings - Fork 6
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
POLIO-1540 Create new tab sub activities for all campaigns polio and non polio #1313
POLIO-1540 Create new tab sub activities for all campaigns polio and non polio #1313
Conversation
…tivities-for-all-campaigns-polio-and-non-polio' into POLIO-1556_sub_activities_front_end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried the POST and PUT in the front-end, it works fine, but shouldn't we check the values against those of the round? eg:
- start and end date should be within the round dates
- scope should be a subset of round scopes
- vaccines should be a subset of round vaccines
class SubActivityCreateUpdateSerializer(serializers.ModelSerializer): | ||
round_number = serializers.IntegerField(write_only=True, required=False) | ||
campaign = serializers.CharField(write_only=True, required=False) | ||
scopes = SubActivityScopeSerializer(many=True, required=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't the scopes be mandatory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think not, you could have first just the encoding of dates and reason of activity and the scope coming later
- make baseUrl optional in useTabs - Add useTableState hook - export polio viruses - fix query key in useSaveCampaigns
- Pass campaign as prop i.o getting it via formik context - Add useFilteredDistricts hook to allow filtering on different scopes - Pass availableVaccines to scopes map to enable more flexible vaccine selection
- Add new components - update polio dialog tabs
…-all-campaigns-polio-and-non-polio
- prevent modal from closing when clicking Confirm - Show spinner while mutation is performed - close modal onSuccess. This allows the mutation hook to invalidate the query key and make sure the data is refetched
- fix spacing between input fields
Polio-1556 sub activities front end
Introduce SubActivity Model in Polio Plugin and the related APIs
Related JIRA tickets : POLIO-1540
Self proofreading checklist
Doc
In the
docs/pages/dev/campaigns/subactivities.md
file included in this PR.Changes
SubActivity
which represents a sub-activity within a round of a campaign. It has fields for name, age unit, minimum age, maximum age, start date, and end date.SubActivityScope
model to represent the scope of a SubActivity with respect to vaccines.SubActivity
model is linked to theRound
model via a foreign key, allowing each round to have multiple sub-activities.SubActivityScope
model is linked to theSubActivity
model via a foreign key, allowing each sub-activity to have multiple scopes.How to test
As this only includes the APIs and no frontend code, you can use /swagger to test and/or use django admin.