diff --git a/api/src/application/application.service.ts b/api/src/application/application.service.ts index 53eb38f..368bd72 100644 --- a/api/src/application/application.service.ts +++ b/api/src/application/application.service.ts @@ -90,7 +90,9 @@ export class ApplicationService { } if (query.fundingYear) { - queryBuilder.andWhere('app.fundingYear = :fundingYear', { fundingYear: query.fundingYear }); + queryBuilder.andWhere('app.fundingYear ILIKE :fundingYear', { + fundingYear: `%${query.fundingYear}%`, + }); } if (query.status) { @@ -276,9 +278,10 @@ export class ApplicationService { async getApplicationsRawData(): Promise { // done this way to remove the submission object from response - return this.applicationRepository + return this.applicationViewRepository .createQueryBuilder('a') .select([ + 'a.fundingYear', 'a.applicantName', 'a.asks', 'a.confirmationId', @@ -298,6 +301,7 @@ export class ApplicationService { .where('status.name NOT ILIKE :rejectedStatus', { rejectedStatus: `%${ApplicationStatus.DENIED}%`, }) + .orderBy('a.fundingYear', 'DESC', 'NULLS LAST') .getMany(); } } diff --git a/api/src/score/ro/raw-data.ro.ts b/api/src/score/ro/raw-data.ro.ts index dce8938..0ff0407 100644 --- a/api/src/score/ro/raw-data.ro.ts +++ b/api/src/score/ro/raw-data.ro.ts @@ -120,11 +120,6 @@ export class RawDataRo { return item.workshopScores && item.workshopScores.length > 0; }; - const getFundingYear = (signedDate: any) => { - if (!signedDate) return NO_VALUE; - return `${dayjs(signedDate).format('YY')}/${dayjs(signedDate).add(1, 'year').format('YY')}`; - }; - const checkGovernmentApplicant = (primaryApplicant: string, secondaryApplicant: string) => { const YES = 'Y'; const NO = 'N'; @@ -154,7 +149,7 @@ export class RawDataRo { eligibility: checkIfItemHasWorkshopScore(item) ? item.workshopScores[0].data?.eligibilityScore : NO_VALUE, - fundingYear: getFundingYear(submission?.s10Container?.s10ProjectMangerApproverDate), + fundingYear: submission?.s1Container?.s1FundingYear, applicantName: item.applicantName, indigenousGovernment: checkGovernmentApplicant( submission.s1Container?.s1GovernmentType, @@ -200,11 +195,6 @@ export class RawDataRo { return dayjs(itemDate).isValid() ? dayjs(itemDate).format('YYYY-MM-DD') : NO_VALUE; }; - const getFundingYear = (signedDate: any) => { - if (!signedDate) return NO_VALUE; - return `${dayjs(signedDate).format('YY')}/${dayjs(signedDate).add(1, 'year').format('YY')}`; - }; - for (const item of data) { if (item.applicationType?.name === ApplicationType.NETWORK_FORM) continue; @@ -218,10 +208,7 @@ export class RawDataRo { submission.s4Container?.s4ProjectTitle || submission.s3Container?.s3ProjectTitle || NO_VALUE, - fundingYear: getFundingYear( - submission.s10Container?.s10ProjectMangerApproverDate || - submission.s11Container?.s11ProjectMangerApproverDate - ), + fundingYear: submission.s1Container?.s1FundingYear, usageCountDate: NO_VALUE, usageCountTime: NO_VALUE, usageCountLocation: NO_VALUE, @@ -241,10 +228,7 @@ export class RawDataRo { submission.s4Container?.s4ProjectTitle || submission.s3Container?.s3ProjectTitle || NO_VALUE, - fundingYear: getFundingYear( - submission.s10Container?.s10ProjectMangerApproverDate || - submission.s11Container?.s11ProjectMangerApproverDate - ), + fundingYear: row.fundingYear, usageCountDate: formatDate(row.dateCell), usageCountTime: row.countPeriodCell || NO_VALUE, usageCountLocation: row.stationLocationCell || NO_VALUE, diff --git a/client/components/application/BroaderReview.tsx b/client/components/application/BroaderReview.tsx index e6f37cf..5a34d7f 100644 --- a/client/components/application/BroaderReview.tsx +++ b/client/components/application/BroaderReview.tsx @@ -123,6 +123,7 @@ export const BroaderReview: React.FC = ({ label={item.label} name={item.name} tooltiptext={item.tooltiptext} + maxScore={item.maxScore} /> diff --git a/client/components/bcat-form-sections/application-dashboard.tsx b/client/components/bcat-form-sections/application-dashboard.tsx index b8c5ee7..5b56480 100644 --- a/client/components/bcat-form-sections/application-dashboard.tsx +++ b/client/components/bcat-form-sections/application-dashboard.tsx @@ -153,7 +153,7 @@ export const ApplicationDashboard: React.FC = () => { searchAssignedTo.length === 0 && searchConfirmationID.length == 0 && searchTotalCost.length === 0 && - searchFundingYear == null && + searchFundingYear.length === 0 && searchStatus == null; return noValues; @@ -225,15 +225,10 @@ export const ApplicationDashboard: React.FC = () => {
Filter By:
- setState(p => ({ ...p, searchFundingYear: e.target.value }))} - options={[ - { name: '2024/25', value: '2024/25' }, - { name: '2025/26', value: '2025/26' }, - { name: '2026/27', value: '2026/27' }, - ]} /> = ({ @@ -27,6 +28,7 @@ export const Input: React.FC = ({ name, secondaryList, tooltiptext, + maxScore, }) => { return (
@@ -44,6 +46,12 @@ export const Input: React.FC = ({
)} + {maxScore && !disabled && ( +
+ Max score: {maxScore} +
+ )} + {descriptionList && (
    {descriptionList.map((item: string, index: number) => { diff --git a/client/constants/validation.ts b/client/constants/validation.ts index a2f86bb..d835068 100644 --- a/client/constants/validation.ts +++ b/client/constants/validation.ts @@ -58,7 +58,7 @@ export const INFRASTRUCTURE_REVIEW_VALIDATION_SCHEMA = Yup.object().shape({ communityNeedsAndSafetyGuidelinesScore: Yup.number() .min(0, minValidationText + '0') - .max(15, maxValidationText + '15') + .max(10, maxValidationText + '10') .required('This field is required'), safetyScore: Yup.number()