#4043 - Update Institution Programs List View#5790
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Institution programs list view to enhance filtering, searching, and sorting capabilities. The changes include a new status filter with toggle buttons (All, Approved, Pending, Declined, Inactive), expanded search to cover program name/SABC code/CIP, a new SABC program code column in the table, and support for multi-column sorting. The create program button has also been relocated from the header to a more prominent position.
Changes:
- Enhanced the programs list view with status filter toggles and multi-field search (program name, SABC code, CIP)
- Added SABC program code as a new sortable column in the programs table
- Changed default sorting from status-based priority to alphabetical by program name, with all columns now sortable
- Refactored search and filter implementation in both frontend (Vue) and backend (NestJS) to support the new filtering options
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
sources/packages/web/src/views/institution/locations/programs/LocationPrograms.vue |
Updated UI with new status filter buttons, moved search box, added search button, implemented filter watcher logic, and added default sort configuration |
sources/packages/web/src/types/contracts/DataTableContract.ts |
Added SabcCode to ProgramSummaryFields enum, reordered and updated headers with new SABC column, made all columns sortable |
sources/packages/web/src/services/http/dto/EducationProgram.dto.ts |
Added optional sabcCode field to EducationProgramsSummaryAPIOutDTO |
sources/packages/backend/apps/api/src/services/education-program/education-program.service.ts |
Enhanced search to query name/CIP/SABC with OR logic, added status and inactive filtering, changed default sort from status priority to name ascending, added sabcCode to query selection |
sources/packages/backend/apps/api/src/services/education-program/education-program.service.models.ts |
Added optional sabcCode field to EducationProgramsSummary interface |
sources/packages/backend/apps/api/src/route-controllers/models/pagination.dto.ts |
Added cipCode, sabcCode, and totalOfferings to allowed sort fields |
sources/packages/backend/apps/api/src/route-controllers/education-program/models/education-program.dto.ts |
Added optional sabcCode field to EducationProgramsSummaryAPIOutDTO |
sources/packages/backend/apps/api/src/route-controllers/education-program/education-program.controller.service.ts |
Added sabcCode mapping in getProgramsSummary result transformation |
sources/packages/backend/apps/api/src/utilities/datatable-database-mapping-utils.ts |
Added column mappings for cipCode, sabcCode, and totalOfferings to support sorting |
sources/packages/backend/apps/api/src/utilities/datatable-config.ts |
Changed ProgramPaginationOptions to extend PaginationOptions instead of BasePaginationOptions |
|
Please add some screenshots to PR description as it is a considerable UI update. |
| "cipCode", | ||
| "sabcCode", | ||
| "totalOfferings", | ||
| ]) |
There was a problem hiding this comment.
From the moment that DTOs are start to deviate, We can have DTO specific to the API and also stop using the same controller service method.
We split the existing methods in education-program.controller.service.ts this way just by centralizing the transformation and allowing to use the new InDTO(LocationProgramsPaginationOptionsAPIInDTO is just a suggested name).
async getProgramsSummary(
institutionId: number,
paginationOptions: ProgramsPaginationOptionsAPIInDTO,
): Promise<PaginatedResultsAPIOutDTO<EducationProgramsSummaryAPIOutDTO>> {
const programs = await this.programService.getProgramsSummary(
institutionId,
[OfferingTypes.Public, OfferingTypes.Private],
paginationOptions,
);
return this.mapEductionProgramPaginatedResults(programs);
}
async getProgramsSummaryForLocation(
institutionId: number,
paginationOptions: LocationProgramsPaginationOptionsAPIInDTO,
locationId: number,
): Promise<PaginatedResultsAPIOutDTO<EducationProgramsSummaryAPIOutDTO>> {
const programs = await this.programService.getProgramsSummaryForLocation(
institutionId,
[OfferingTypes.Public, OfferingTypes.Private],
paginationOptions,
locationId,
);
return this.mapEductionProgramPaginatedResults(programs);
}
private mapEductionProgramPaginatedResults(
programs: PaginatedResults<EducationProgramsSummary>,
): PaginatedResultsAPIOutDTO<EducationProgramsSummaryAPIOutDTO> {
return {
results: programs.results.map((program) => ({
programId: program.programId,
programName: program.programName,
cipCode: program.cipCode,
sabcCode: program.sabcCode,
credentialType: program.credentialType,
totalOfferings: program.totalOfferings,
submittedDate: program.submittedDate,
locationId: program.locationId,
locationName: program.locationName,
programStatus: program.programStatus,
isActive: program.isActive,
isExpired: program.isExpired,
credentialTypeToDisplay: credentialTypeToDisplay(
program.credentialType,
),
})),
count: programs.count,
};
}| .orWhere("programs.cipCode Ilike :cipSearch", { | ||
| cipSearch: `%${paginationOptions.searchCriteria}%`, | ||
| }) | ||
| .orWhere("programs.sabcCode Ilike :sabcSearch", { | ||
| sabcSearch: `%${paginationOptions.searchCriteria}%`, | ||
| }), |
There was a problem hiding this comment.
CIP is all numbers and just like should be good enough.
For the SABC code we had a discussion during the grooming that DB is expected to have the SABC code only upper case. Hence like can be used after paginationOptions.searchCriteria.toUpperCase()
@andrewsignori-aot that was the grooming discussion right?
There was a problem hiding this comment.
@dheepak-aot, yes, the uppercase was discussed, and we can have it as uppercase to avoid creating a DB index for case-insensitive search.
|
dheepak-aot
left a comment
There was a problem hiding this comment.
Thanks for making the changes. Looks good 👍



Summary
Updated Institution programs list view to include new status filter, SABC and CIP search.
Moved create program button location.
Added new SABC column.
Allow multiple columns sort