Skip to content
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

Merged
merged 13 commits into from
May 28, 2024
Merged

[MDS-5975] - ams regions #3113

merged 13 commits into from
May 28, 2024

Conversation

matbusby-fw
Copy link
Collaborator

@matbusby-fw matbusby-fw commented May 23, 2024

Objective

  • Created a regions table and added a column in the project_summary table for a region id
  • Filled the regions table with the names/ids provided by AMS
  • Created a new slice to fetch/store/retrieve the region options
  • Updated FacilityOperator.tsx with new select component utilizing the region options from the new slice
  • Updated API to use the new regions table/columns
  • Added the region name to the AMS submission
  • Refactored the ProjectSummaryPage.tsx file to properly dispatch the actions and increase readability/maintainability

MDS-5975

image

@matbusby-fw matbusby-fw marked this pull request as ready for review May 27, 2024 19:39
…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.
@matbusby-fw matbusby-fw force-pushed the mds-5975-ams-regions branch from c387784 to 92d92ae Compare May 27, 2024 20:32
@matbusby-fw matbusby-fw added the 👍 Ready for review Pull request has been double checked by the author and is ready for comments and feedback. label May 27, 2024
taraepp
taraepp previously approved these changes May 27, 2024
Copy link
Collaborator

@taraepp taraepp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matbusby-fw matbusby-fw dismissed stale reviews from henryoforeh-dev and taraepp via 3e50065 May 27, 2024 23:30
Copy link

Quality Gate Failed Quality Gate failed for 'bcgov-sonarcloud_mds_minespace-web'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

Copy link

Quality Gate Passed Quality Gate passed for 'bcgov-sonarcloud_mds_core-web'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

Quality Gate Failed Quality Gate failed for 'bcgov-sonarcloud_mds_core-api'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

Copy link

Quality Gate Failed Quality Gate failed for 'bcgov-sonarcloud_mds_common'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@matbusby-fw matbusby-fw requested a review from taraepp May 28, 2024 15:54
@matbusby-fw matbusby-fw merged commit 3fce08c into develop May 28, 2024
20 of 23 checks passed
@matbusby-fw matbusby-fw deleted the mds-5975-ams-regions branch May 28, 2024 16:44
simensma-fresh pushed a commit that referenced this pull request Jun 12, 2024
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👍 Ready for review Pull request has been double checked by the author and is ready for comments and feedback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants