Skip to content

Commit

Permalink
Merge pull request #2026 from bcgov/feature/egc-24
Browse files Browse the repository at this point in the history
Small fixes
  • Loading branch information
alexmcdermid authored Nov 22, 2024
2 parents ea991ea + 251752a commit aa33881
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
6 changes: 3 additions & 3 deletions backend/src/components/grad.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function uploadFile(req, res) {
async function downloadErrorReport(req, res) {
try {
const token = getAccessToken(req);
const url = `${config.get('grad:rootURL')}/reportGeneration/errorReport/${req.params.schoolID}`;
const url = `${config.get('grad:rootURL')}/reportGeneration/errorReport/${req.params.activeIncomingFilesetID}`;

const resData = await getData(token, url);

Expand Down Expand Up @@ -76,10 +76,10 @@ async function getFilesetsPaginated(req, res) {
async function getErrorFilesetStudentPaginated(req, res) {
try {
const search = [];
if(req.params.schoolID) {
if(req.params.activeIncomingFilesetID) {
search.push({
condition: null,
searchCriteriaList: [{ key: 'incomingFileset.schoolID', value: req.params.schoolID, operation: FILTER_OPERATION.EQUAL, valueType: VALUE_TYPE.UUID }]
searchCriteriaList: [{ key: 'incomingFileset.incomingFilesetID', value: req.params.activeIncomingFilesetID, operation: FILTER_OPERATION.EQUAL, valueType: VALUE_TYPE.UUID }]
});
}

Expand Down
4 changes: 2 additions & 2 deletions backend/src/routes/grad.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ router.get('/validation-issue-type-codes', passport.authenticate('jwt', {session
router.post('/school/:schoolID/upload-file', passport.authenticate('jwt', {session: false}, undefined), isValidBackendToken, validateAccessToken,
checkEdxUserPermission(PERMISSION.GRAD_SCH_EDIT), validate(gradFileUploadSchema), scanFilePayload, uploadFile);

router.get('/filesetErrors/:schoolID/paginated', passport.authenticate('jwt', {session: false}, undefined), isValidBackendToken, validateAccessToken,
router.get('/filesetErrors/:activeIncomingFilesetID/paginated', passport.authenticate('jwt', {session: false}, undefined), isValidBackendToken, validateAccessToken,
checkEdxUserPermission(PERMISSION.GRAD_SCH_EDIT), validate(gradErrorFilesetStudentPaginatedSchema),
getErrorFilesetStudentPaginated);

router.get('/fileset/:schoolID/paginated', passport.authenticate('jwt', {session: false}, undefined), isValidBackendToken, validateAccessToken,
checkEdxUserPermission(PERMISSION.GRAD_SCH_EDIT), validate(gradErrorFilesetStudentPaginatedSchema),
getFilesetsPaginated);

router.get('/filesetErrors/:schoolID/errorReportDownload', auth.refreshJWT, isValidBackendToken, validateAccessToken,
router.get('/filesetErrors/:activeIncomingFilesetID/errorReportDownload', auth.refreshJWT, isValidBackendToken, validateAccessToken,
checkEdxUserPermission(PERMISSION.GRAD_SCH_EDIT), validate(gradErrorFilesetStudentPaginatedSchema),
downloadErrorReport);

Expand Down
2 changes: 1 addition & 1 deletion backend/src/validations/grad.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const gradFileBySchoolIDSchema = object({
const gradErrorFilesetStudentPaginatedSchema = object({
body: object().noUnknown(),
params: object({
schoolID: string()
activeIncomingFilesetID: string()
}),
query: object({
pageNumber: number().moreThan(-1).integer().optional(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ export default {
required: false,
default: null
},
activeIncomingFilesetID: {
type: String,
required: false,
default: null
},
},
emits: [],
data() {
Expand Down Expand Up @@ -167,7 +172,7 @@ export default {
},
methods: {
downloadReportURL() {
return `${ApiRoutes.gdc.BASE_URL}/filesetErrors/${this.$route.params.schoolID}/errorReportDownload`;
return `${ApiRoutes.gdc.BASE_URL}/filesetErrors/${this.$route.params.activeIncomingFilesetID}/errorReportDownload`;
},
toggleFilters() {
this.showFilters= !this.showFilters;
Expand All @@ -177,7 +182,7 @@ export default {
},
getErrorFilesetStudentPaginated() {
this.isLoading= true;
ApiService.apiAxios.get(`${ApiRoutes.gdc.BASE_URL}/filesetErrors/${this.$route.params.schoolID}/paginated`, {
ApiService.apiAxios.get(`${ApiRoutes.gdc.BASE_URL}/filesetErrors/${this.$route.params.activeIncomingFilesetID}/paginated`, {
params: {
pageNumber: this.pageNumber - 1,
pageSize: this.pageSize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<span v-if="column.key === 'errorLink'">
<a
class="ml-1"
@click="navigateToErrors"
@click="navigateToErrors(props.item)"
>View Errors/Warnings</a>
</span>
<span v-else-if="column.key === 'demFileUploadDate' || column.key === 'xamFileUploadDate' || column.key === 'crsFileUploadDate'">
Expand Down Expand Up @@ -439,8 +439,8 @@ export default {
backButtonClick() {
this.$router.push({name: 'graduation', params: {schoolID: this.schoolID}});
},
navigateToErrors() {
this.$router.push({name: 'error', params: {schoolID: this.schoolID}});
navigateToErrors(row) {
this.$router.push({name: 'error', params: {schoolID: this.schoolID, activeIncomingFilesetID: row.incomingFilesetID}});
}

}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ const router = createRouter({
},
},
{
path: 'graduation/:schoolID/errorReport',
path: 'graduation/:schoolID/errorReport/:activeIncomingFilesetID',
name: 'error',
component: GradErrorsView,
props: true,
Expand Down

0 comments on commit aa33881

Please sign in to comment.