[MDS-6460] Minespace NoW application stage status info#3527
[MDS-6460] Minespace NoW application stage status info#3527
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements the Minespace NoW application stage status information, adding support for tracking and returning application progress details via new endpoints and updated UI state management.
- Added a new field (application_progress) in the API response model for NoW applications.
- Introduced new resources and updated action types/reducers for proponent-specific application details.
- Updated mocks, interfaces, constants, and API endpoints to reflect the new application progress functionality.
Reviewed Changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| services/core-api/app/api/now_applications/response_models.py | Adds the application_progress field to the response model. |
| services/core-api/app/api/now_applications/resources/now_application_proponent_resource.py | Introduces a new resource for proponent application details including progress data. |
| services/core-api/app/api/now_applications/resources/now_application_list_proponent_resource.py | Updates list resource to include application progress for each application. |
| services/core-api/app/api/now_applications/namespace.py | Registers the new proponent resource under the proper route. |
| services/core-api/app/api/now_applications/models/now_application_progress.py | Adds a helper method to retrieve progress data by application id. |
| services/common/src/utils/featureFlag.ts | Introduces a new feature flag for application details view. |
| services/common/src/tests/mocks/dataMocks.tsx | Updates mocks to include application_progress data. |
| services/common/src/redux/* | Updates selectors, reducers, actions, and action creators to align with the new progress functionality. |
| services/common/src/interfaces/* | Adds interfaces for application stages and progress. |
| services/common/src/constants/* | Updates string constants, badge types, action types, and API endpoints to support the new feature. |
|
|
||
| @classmethod | ||
| def find_by_id(cls, now_application_id): | ||
| return cls.query.filter_by(now_application_id=now_application_id).all() |
There was a problem hiding this comment.
The find_by_id method returns a list even when no records are found, so the 'if now_application_progress is None' check in the resource code will never be true. Consider returning a single record or updating the check to verify an empty list instead.
| return cls.query.filter_by(now_application_id=now_application_id).all() | |
| return cls.query.filter_by(now_application_id=now_application_id).first() |
There was a problem hiding this comment.
I kept the .all() and removed the if now_application_progress is None
| return response; | ||
| }) | ||
| .catch(() => dispatch(error(NetworkReducerTypes.GET_PROPONENT_NOTICE_OF_WORK_APPLICATION))) | ||
| .finally(() => dispatch(hideLoading)); |
There was a problem hiding this comment.
The hideLoading action is dispatched without being invoked. Change it to dispatch(hideLoading()) to correctly invoke the action creator.
| .finally(() => dispatch(hideLoading)); | |
| .finally(() => dispatch(hideLoading())); |
| noticeOfWorkStage: { | ||
| "In Progress": "warning", | ||
| Complete: "success", | ||
| "Not started": "default", |
There was a problem hiding this comment.
There is a case inconsistency with the status string; the constant is defined as 'Not Started' elsewhere. Use consistent casing to avoid mismatches in status mapping.
| "Not started": "default", | |
| "Not Started": "default", |
There was a problem hiding this comment.
This is fixed too now
| initialValues={stateParams} | ||
| mineReportType={mine_reports_type} | ||
| /> | ||
| {mine_reports_type} |
There was a problem hiding this comment.
Extra text that Sam saw in CRR and PRR page
| import * as API from "@/constants/API"; | ||
| import * as MOCK from "@mds/common/tests/mocks/dataMocks"; | ||
| import * as NOW_MOCK from "@/tests/mocks/noticeOfWorkMocks"; | ||
| import * as NOW_MOCK from "@mds/common/tests/mocks/noticeOfWorkMock"; |
There was a problem hiding this comment.
There are around 50ish files in this PR that just changes the import path of the noticeOfWorkMock
| @@ -0,0 +1,733 @@ | |||
| import MockAdapter from "axios-mock-adapter"; | |||
There was a problem hiding this comment.
is this a brand new file? How many TS errors come up if it's renamed to .ts? If it's manageable I'd be in favour of making it TS.
There was a problem hiding this comment.
This is now changed to .ts, it ended up being just a few small changes.
| class TestApplicationProponentListResource: | ||
| """GET /mines/<string:mine_guid>/now-applications""" | ||
|
|
||
| def test_get_proponent_now_application_list_success(self, test_client, db_session, auth_headers): |
There was a problem hiding this comment.
I'm thinking an error scenario would be good to add for both resources tests.
There was a problem hiding this comment.
Check for non existent guids and error scenario test have been added now
| hashRoute: (nowApplicationGuid, activeTab = "overview", link) => | ||
| `/notice-of-work/${nowApplicationGuid}/${activeTab}/${link}`, | ||
| component: NoticeOfWorkPage, | ||
| helpKey: "View-Proponent-Notice-Of-Work", |
There was a problem hiding this comment.
I'd take out "Proponent" from here, just because it shows up in the help title and is kind of redundant on MS.
There was a problem hiding this comment.
This has been removed from the help key now.
| })); | ||
| const columns: ColumnsType<any> = [ | ||
| { | ||
| title: <b>Stage</b>, |
There was a problem hiding this comment.
I was wondering why these are styled individually but then I looked at the mockups!
Hmm, just looking at some of Denise's other mockups, they also have bold table headers, and I think it's actually a nice change.
In the goal of keeping styling somewhat consistent, I'd recommend taking the <b>s out and adding font-weight to the .ant-table-thead>tr>th selector. I'm seeing that the line-height, colour, and border also changed, and so did the little divider between each column... Might even be out of scope.
There was a problem hiding this comment.
That makes a lot of sense, thanks! I removed the <b> and added the font-weight style to that particular class. I left the other styling alone for now.
|
|
| ]).then(() => setIsLoaded(true)); | ||
| }; | ||
|
|
||
| const handleTabChange = (newActiveTab) => { |
There was a problem hiding this comment.
Removed the switch in the handleTabChange function here
|
|
| dataIndex: "project", | ||
| render: (text, record) => { | ||
| return ( | ||
| <div title=""> |
There was a problem hiding this comment.
Is there a reason for the empty title here?





Objective
MDS-6460