Repository navigation
chore: replace inline year patterns with CommonYear shared components - #90
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors year-related UI patterns across the client by replacing inline CommonAutocompleteInput/SelectField usages bound to yearChoices with the shared CommonYearInput, CommonYearInputFilter, and CommonYearField components from @shared/components/fields/CommonYear. defaultYearFilter is still used where defaults are applied outside of inputs (e.g., filterDefaultValues, payload defaults).
Changes:
- Replace inline year filter inputs with
<CommonYearInputFilter />(or<CommonYearInput />for non-always-on filters). - Replace inline year form inputs (including ones with
defaultValue={defaultYearFilter.year}) with<CommonYearInput />, preservingvalidate={required()}where applicable. - Replace
<SelectField source="year" choices={yearChoices} />columns with<CommonYearField />, and drop now-unused imports (SelectField,yearChoices,CommonAutocompleteInput).
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| client/src/reports/studentReportCardReactButton.jsx | Switch form year input to CommonYearInput. |
| client/src/pivots/StudentAttendanceList.jsx | Filter swapped to CommonYearInputFilter; imports CommonYearField but datagrid still uses SelectField. |
| client/src/pivots/StudentAttendanceByKlassList.jsx | Same as above — partial migration, CommonYearField unused. |
| client/src/pivots/PercentReportWithDatesList.jsx | Filter and datagrid year column migrated to shared components. |
| client/src/entities/transportation.jsx | Filter, datagrid column, and form input migrated. |
| client/src/entities/teacher-salary-report.jsx | Filter and datagrid column migrated. |
| client/src/entities/teacher-report-status.jsx | Filter and datagrid column migrated. |
| client/src/entities/teacher-grade-report-status.jsx | Filter and datagrid column migrated. |
| client/src/entities/student.jsx | Embedded student-klass datagrid year column migrated. |
| client/src/entities/student-percent-report.jsx | Filter and datagrid column migrated. |
| client/src/entities/student-klasses-report.jsx | Filter and datagrid column migrated. |
| client/src/entities/student-klass.jsx | Filter, datagrid column, and form input migrated. |
| client/src/entities/report-month.jsx | Filter, datagrid column, and form input migrated. |
| client/src/entities/report-group.jsx | Non-always-on filter uses CommonYearInput; datagrid and form input migrated. |
| client/src/entities/lesson.jsx | Filter, datagrid column, and form input migrated. |
| client/src/entities/known-absence.jsx | Filter, datagrid column (preserving isPreview guard), and form input migrated. |
| client/src/entities/klass.jsx | Filter, datagrid column, and form input migrated. |
| client/src/entities/grade.jsx | Filter, datagrid column, and form input migrated. |
| client/src/entities/att-report.jsx | Filter, datagrid column, and form input migrated. |
| client/src/entities/att-report-with-report-month.jsx | Filter, bulk-action year input, and datagrid column migrated. |
| client/src/entities/absenceType.jsx | Filter, datagrid column, and form input migrated. |
| client/src/components/StudentView/student-event-report.jsx | Disabled year input migrated to CommonYearInput disabled. |
| } from 'react-admin'; | ||
| import { defaultYearFilter, yearChoices } from '@shared/utils/yearFilter'; | ||
| import CommonAutocompleteInput from '@shared/components/fields/CommonAutocompleteInput'; | ||
| import { CommonYearField, CommonYearInputFilter } from '@shared/components/fields/CommonYear'; |
| } from 'react-admin'; | ||
| import { defaultYearFilter, yearChoices } from '@shared/utils/yearFilter'; | ||
| import CommonAutocompleteInput from '@shared/components/fields/CommonAutocompleteInput'; | ||
| import { CommonYearField, CommonYearInputFilter } from '@shared/components/fields/CommonYear'; |
Co-authored-by: buzz-code <72219643+buzz-code@users.noreply.github.com>
buzz-code
force-pushed
the
chore/nra-client-common-year-components
branch
from
May 31, 2026 09:09
74a4bdb to
cbdf402
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.