-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MDS-5975] - ams regions #3113
[MDS-5975] - ams regions #3113
Conversation
…yPage Added a new region selector field in the FacilityOperator component for facility's regional location. Refactored ProjectSummaryPage, changing to use react-redux useDispatch and useSelector hooks instead of connect method and got rid of unused imports. Made the code more readable and manageable.
This update introduces a new 'regionsSlice' along with 'regions' Reducer to manage the state of region related data in the Redux store. Regions state includes an array of regions, each with properties of name and regional_district_id. Additionally, the regions reducer is added to the rootReducerShared file.
A new 'regions' table is created with a primary key 'regional_district_id' and other requisite fields such as 'name', 'create_user' etc. The 'project_summary' table is updated with a new field 'regional_district_id' and a foreign key constraint is established to link it with the 'regions' table.
Three new files were created in the regions directory within the API to implement region listing functionality. This includes model, resource, and namespace files to support API retrieval of all region data from the database. Access controls were added for view_all and minespace_proponent roles.
The project summary model, input handling, and responses have been updated to include a regional_district_id value. This new attribute can be assigned to a project summary using its respective foreign key from the regions dataset. This newly introduced attribute will aid in the routing and categorizing of projects based on regional districts.
The AMS API service has been updated to include the regional district name in the authorization application. Both the model and the payload for the HTTP request have been updated to accommodate this new attribute.
c387784
to
92d92ae
Compare
services/common/src/components/projectSummary/FacilityOperator.tsx
Outdated
Show resolved
Hide resolved
services/core-api/app/api/projects/project_summary/models/project_summary.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Quality Gate failed for 'bcgov-sonarcloud_mds_minespace-web'Failed conditions |
Quality Gate passed for 'bcgov-sonarcloud_mds_core-web'Issues Measures |
Quality Gate failed for 'bcgov-sonarcloud_mds_core-api'Failed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Quality Gate failed for 'bcgov-sonarcloud_mds_common'Failed conditions |
* Add regional selection to FacilityOperator and refactor ProjectSummaryPage Added a new region selector field in the FacilityOperator component for facility's regional location. Refactored ProjectSummaryPage, changing to use react-redux useDispatch and useSelector hooks instead of connect method and got rid of unused imports. Made the code more readable and manageable. * Add regions reducer and regionsSlice This update introduces a new 'regionsSlice' along with 'regions' Reducer to manage the state of region related data in the Redux store. Regions state includes an array of regions, each with properties of name and regional_district_id. Additionally, the regions reducer is added to the rootReducerShared file. * Add region to project summary and create regions table A new 'regions' table is created with a primary key 'regional_district_id' and other requisite fields such as 'name', 'create_user' etc. The 'project_summary' table is updated with a new field 'regional_district_id' and a foreign key constraint is established to link it with the 'regions' table. * Add region list functionality to API Three new files were created in the regions directory within the API to implement region listing functionality. This includes model, resource, and namespace files to support API retrieval of all region data from the database. Access controls were added for view_all and minespace_proponent roles. * Add regional district ID to project summary The project summary model, input handling, and responses have been updated to include a regional_district_id value. This new attribute can be assigned to a project summary using its respective foreign key from the regions dataset. This newly introduced attribute will aid in the routing and categorizing of projects based on regional districts. * Add regional district name to AMS API service The AMS API service has been updated to include the regional district name in the authorization application. Both the model and the payload for the HTTP request have been updated to accommodate this new attribute. * fix mock data * renamed migration for correct ordering
Objective
regions
table and added a column in theproject_summary
table for a region idFacilityOperator.tsx
with new select component utilizing the region options from the new sliceProjectSummaryPage.tsx
file to properly dispatch the actions and increase readability/maintainabilityMDS-5975