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-6006] Allow ability to edit and remove the orgbook associations #3140

Merged
merged 7 commits into from
Jun 6, 2024

Conversation

isuru-aot
Copy link
Contributor

@isuru-aot isuru-aot commented Jun 5, 2024

Objective

MDS-6006

  • Users can change an orgbook party connection to a party through the party edit modal
  • User with core_admin can delete an existing orgbook party connection through the party edit modal
    • This is a hard delete from party_orgbook_entity table.

Why are you making this change? Provide a short explanation and/or screenshots
Screenshot 2024-06-05 at 5 21 43 PM
Screenshot 2024-06-05 at 5 22 03 PM

@isuru-aot isuru-aot marked this pull request as ready for review June 6, 2024 01:30

useEffect(() => {
if (selectedParty !== current_party) {
setSelectedParty(placeHolder);
Copy link
Contributor

@henryoforeh-dev henryoforeh-dev Jun 6, 2024

Choose a reason for hiding this comment

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

Any particular reason for setting the selected party state to be the constant placeholder value "Start typing to search OrgBook..." ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the flow,

  1. User sees the place holder (initial step, when no party is associated)
  2. Then user types and select one party and click on Associate button. This is will disabled the search box
  3. Then (if) user want to change the selected party, user clicks on Disassociate button (screen shots in the PR)
  4. In step (3), if assigned selected party as
    • setSelectedParty(NONE) -> it will show None in the search box
    • setSelectedParty("") -> it will show the empty in the search box.

So I thought assigning the place holder to the party, makes things easier for the user.

If there's better options to handle this, please let me know.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@henryoforeh-dev actually, setSelectedParty(undefined) resolve the issue. I'll commit this

raise NotFound('OrgBook entity not found.')

party_orgbook_entity.delete()
return None, 204
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. The @api.marshal_with decorator specifies a status code of 201, which is used for "Created" responses. However, for a successful deletion, the status code should be 204 (No Content).

  2. The @api.expect(parser) decorator suggests that some input validation or parsing is expected, but it is not being utilized within the function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is addressed.

Copy link

sonarqubecloud bot commented Jun 6, 2024

Quality Gate Passed Quality Gate passed for 'bcgov-sonarcloud_mds_minespace-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

sonarqubecloud bot commented Jun 6, 2024

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

@isuru-aot isuru-aot requested a review from henryoforeh-dev June 6, 2024 16:51
Copy link

sonarqubecloud bot commented Jun 6, 2024

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

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

See analysis details on SonarCloud

@isuru-aot isuru-aot requested a review from Jsyro June 6, 2024 16:51
Copy link

sonarqubecloud bot commented Jun 6, 2024

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

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Collaborator

@Jsyro Jsyro left a comment

Choose a reason for hiding this comment

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

Delete and remake makes sense to me in this case.
Only admins can see button and disassociate, good call! assuming Rebecca agrees.

I wonder if we should start showing the Party NAME and Orgbook names together (the original feature overrode the party name with the orgbook name). But that is future work.

@isuru-aot isuru-aot merged commit 92f8831 into develop Jun 6, 2024
22 of 24 checks passed
@isuru-aot isuru-aot deleted the mds-6006-edit-existing-orgbook-association branch June 6, 2024 17:27
simensma-fresh pushed a commit that referenced this pull request Jun 12, 2024
…3140)

* Allow ability to edit and remove the orgbook associations

* Fixing the issue of missing the party after the update

* Fixing the issue of changing the selected party before associating

* Fixing the label when nothing is selected.

* Updating roles for delete resource

* Addressing PR comments

* Addressing PR comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants