-
Notifications
You must be signed in to change notification settings - Fork 1
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
Yearly report module with admin interface #709
Conversation
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.
Copilot reviewed 8 out of 18 changed files in this pull request and generated no comments.
Files not reviewed (10)
- .docker/frontend: Language not supported
- frontend/package.json: Language not supported
- frontend/src/manage.tsx: Evaluated as low risk
- frontend/src/YearlyReportRounds.tsx: Evaluated as low risk
- frontend/src/navigation.tsx: Evaluated as low risk
- frontend/src/YearlyReportViewer.tsx: Evaluated as low risk
- frontend/src/HerdContactUpdateStep.tsx: Evaluated as low risk
- app/utils/database.py: Evaluated as low risk
- app/utils/data_access.py: Evaluated as low risk
- frontend/src/YearlyReportMultiStepForm.tsx: Evaluated as low risk
Comments suppressed due to low confidence (7)
frontend/src/SelectHerdStep.tsx:36
- Include 'genebankName' and 'user' in the dependency array to ensure herd options are updated correctly.
useEffect(() => { ... }, []);
frontend/src/SelectHerdStep.tsx:54
- Include 'herdId' and 'reportYear' in the dependency array to ensure breedings are fetched correctly.
useEffect(() => { ... }, []);
frontend/src/BatchRabbitUpdateStep.tsx:22
- The type 'any' for 'skippedRabbits' is too generic and should be replaced with a more specific type.
const [skippedRabbits, setSkippedRabbits] = useState<any[]>([]);
frontend/src/BatchRabbitUpdateStep.tsx:37
- The type 'any' for 'individual' in the 'filter' function is too generic and should be replaced with a more specific type.
const rabbitsWithStatus = individualsData.filter((individual: any) => {
frontend/src/BatchRabbitUpdateStep.tsx:48
- The type 'any' for 'acc' in the 'reduce' function is too generic and should be replaced with a more specific type.
const { needUpdate, canSkip } = rabbitsWithStatus.reduce((acc: { needUpdate: any[]; canSkip: any[] }, rabbit: any) => {
frontend/src/BatchRabbitUpdateStep.tsx:103
- The type 'any' for 'rabbit' in the 'map' function is too generic and should be replaced with a more specific type.
{skippedRabbits.map((rabbit: any) => {
app/herdbook.py:1336
- Add exception handling for the case where 'report_round' is not found.
report_round = da.YearlyReportRound.get_by_id(round_id)
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.
Copilot reviewed 10 out of 24 changed files in this pull request and generated 1 comment.
Files not reviewed (14)
- .docker/frontend: Language not supported
- frontend/package.json: Language not supported
- frontend/src/style.css: Language not supported
- frontend/tsconfig.json: Language not supported
- app/herdbook.py: Evaluated as low risk
- frontend/src/navigation.tsx: Evaluated as low risk
- frontend/src/manage.tsx: Evaluated as low risk
- frontend/src/breeding_form.tsx: Evaluated as low risk
- .github/workflows/create_packages.yml: Evaluated as low risk
- frontend/src/YearlyReportViewer.tsx: Evaluated as low risk
- frontend/src/YearlyReportStep.tsx: Evaluated as low risk
- app/tests/test_database.py: Evaluated as low risk
- frontend/src/YearlyReportRounds.tsx: Evaluated as low risk
- frontend/src/HerdContactUpdateStep.tsx: Evaluated as low risk
Comments suppressed due to low confidence (2)
app/utils/data_access.py:2450
- [nitpick] Ensure that error messages provide enough context. For example, 'Failed to save report' could be more specific.
logger.error(f"Failed to export yearly reports as CSV: {str(e)}")
app/utils/data_access.py:2265
- The
user
variable is fetched but not used. Remove this redundant code.
user = fetch_user_info(user_uuid)
…onent Updated the visibility condition in the Navigation component to ensure it only evaluates when there are yearly report rounds available. This change improves the logic by preventing unnecessary checks and enhances code clarity, making it easier to understand the conditions under which the navigation items are displayed.
…nd function Enhanced the update_yearly_report_round function in data_access.py to include the ability to update the report year based on user input. This addition improves the functionality of the yearly report management by allowing for more flexible data handling.
…ling Removed the 'public' option from the FieldWithPermission component and enforced 'authenticated' privacy level for all fields in the HerdContactUpdateStep. Enhanced form handling by replacing FieldWithPermission with TextField, improving user experience with clearer validation messages and background color indications for required fields. These changes streamline the privacy management and improve the overall clarity of the contact update process.
…andling Added onUpdateStatus callback to BatchRabbitUpdateForm, BatchRabbitUpdateStep, HerdContactUpdateStep, SelectGenebankStep, SelectHerdStep, YearlyReportForm, YearlyReportMultiStepForm, and YearlyReportStep components to manage update statuses throughout the batch update process. Improved error handling and user feedback during updates, ensuring a smoother user experience. This enhancement allows for better tracking of the update process and improves overall functionality.
…ook into feature/yearly-report
Yearly Report Management System Enhancement
Overview
This pull request introduces a comprehensive set of features for managing and viewing yearly reports within the application, enhancing both the frontend user interface and backend API functionality.
Frontend Changes
New Components
YearlyReportViewer
Report Management Components
YearlyReportRounds
: Manages yearly report rounds (create, update, delete)YearlyReportMultiStepForm
: Multi-step form for report submissionYearlyReportStep
: Handles report data display and updatesYearlyReportForm
: Core form for yearly report data inputSupporting Components
BatchRabbitUpdateStep
&BatchRabbitUpdateForm
: Batch update functionality for rabbit dataHerdContactUpdateStep
: Updated to include bank detailsSelectGenebankStep
: Genebank selection based on user permissionsSelectHerdStep
: Herd selection with breeding information displayTechnical Updates
package.json
formik
andyup
for form handlingtsconfig.json
allowJs
andcheckJs
to falserootDir
andoutDir
Backend Changes
API Endpoints
Added new endpoints for:
/api/manage/yearly_report_rounds
)/api/manage/yearly-reports/<round_id>/<genebank_id>
)Database Updates
YearlyReportRound
Herd
model with bank detailsGenebankReport
modelInfrastructure
node:18-slim
data_access.py
Testing
Documentation
Breaking Changes