Skip to content

chore: replace inline year patterns with CommonYear shared components - #90

Merged
buzz-code merged 4 commits into
mainfrom
chore/nra-client-common-year-components
May 31, 2026
Merged

buzz-code merged 4 commits into
mainfrom
chore/nra-client-common-year-components

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings May 30, 2026 19:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 />, preserving validate={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';
@buzz-code
buzz-code force-pushed the chore/nra-client-common-year-components branch from 74a4bdb to cbdf402 Compare May 31, 2026 09:09
@buzz-code
buzz-code merged commit 0890a7d into main May 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants