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

UIU-3105: hide permissionSets from settings/users navigation pane if roles interface is present #2689

Merged
merged 5 commits into from
Jun 7, 2024

Conversation

aidynoJ
Copy link
Contributor

@aidynoJ aidynoJ commented May 10, 2024

Purpose

UIU-3105 - suppress Settings > Users > Permission sets when roles interface is present

Approach

TODOS and Open Questions

Learning

Pre-Merge Checklist

Before merging this PR, please go through the following list and take appropriate actions.

  • I've added appropriate record to the CHANGELOG.md
  • Does this PR meet or exceed the expected quality standards?
    • Code coverage on new code is 80% or greater
    • Duplications on new code is 3% or less
    • There are no major code smells or security issues
  • Does this introduce breaking changes?
    • If any API-related changes - okapi interfaces and permissions are reviewed/changed correspondingly
    • There are no breaking changes in this PR.

If there are breaking changes, please STOP and consider the following:

  • What other modules will these changes impact?
  • Do JIRAs exist to update the impacted modules?
    • If not, please create them
    • Do they contain the appropriate level of detail? Which endpoints/schemas changed, etc.
    • Do they have all they appropriate links to blocked/related issues?
  • Are the JIRAs under active development?
    • If not, contact the project's PO and make sure they're aware of the urgency.
  • Do PRs exist for these changes?
    • If so, have they been approved?

Ideally all of the PRs involved in breaking changes would be merged in the same day to avoid breaking the folio-testing environment. Communication is paramount if that is to be achieved, especially as the number of intermodule and inter-team dependencies increase.

While it's helpful for reviewers to help identify potential problems, ensuring that it's safe to merge is ultimately the responsibility of the PR assignee.

@aidynoJ aidynoJ requested review from zburke and ryandberger May 10, 2024 11:58
zburke
zburke previously requested changes May 13, 2024
Copy link
Member

@zburke zburke left a comment

Choose a reason for hiding this comment

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

This works, but in Eureka, we don't have mod-permissions, so the permissions interface won't exist at all, right? If that's correct, lets implement like we did for fees and fines on line 133, leveraging the filter on SettingsPage to implement this in a less obtrusive/more generic way.

@aidynoJ
Copy link
Contributor Author

aidynoJ commented May 14, 2024

This works, but in Eureka, we don't have mod-permissions, so the permissions interface won't exist at all, right? If that's correct, lets implement like we did for fees and fines on line 133, leveraging the filter on SettingsPage to implement this in a less obtrusive/more generic way.

Unfortunately, backend relies on permissions interface for migrations, and currently we might see this situation(picture below). As a result we will have interface "permissions" in eureka for now. Probably, later when backend will not use permissions interface we could use fees and fines way to handle it.
Screenshot 2024-05-14 at 15 42 18

@aidynoJ aidynoJ requested a review from zburke May 14, 2024 15:01
@zburke zburke dismissed their stale review May 22, 2024 11:58

the changes I asked for are not practical

Copy link
Member

@zburke zburke left a comment

Choose a reason for hiding this comment

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

I hesitate to approve this because getSettingSections is just so out of place, and so specific to the perms route. True, it gets the job done, but without any context since there are no comments here and the route in question is not defined here.

I think a better approach may be to handle this directly in sections.js where we could use the same conditionals to evaluate whether to unshift this route onto the settingsGeneral list.

I also don't understand how the new tests evaluate the condition we are adding here. All the tests do is check whether the settings page renders, not whether the content it renders changes when the interface list changes.

@aidynoJ
Copy link
Contributor Author

aidynoJ commented May 22, 2024

I hesitate to approve this because getSettingSections is just so out of place, and so specific to the perms route. True, it gets the job done, but without any context since there are no comments here and the route in question is not defined here.

I think a better approach may be to handle this directly in sections.js where we could use the same conditionals to evaluate whether to unshift this route onto the settingsGeneral list.

I also don't understand how the new tests evaluate the condition we are adding here. All the tests do is check whether the settings page renders, not whether the content it renders changes when the interface list changes.

I'll try to handle it differently.

@aidynoJ aidynoJ requested a review from zburke May 24, 2024 09:04
Copy link
Member

@zburke zburke left a comment

Choose a reason for hiding this comment

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

Ooooh, this is very nice! What if we rename dependsOnNoneInterface to unlessInterface?

Copy link

sonarqubecloud bot commented Jun 7, 2024

@aidynoJ aidynoJ merged commit 9e4f9a8 into keycloak-ramsons Jun 7, 2024
5 checks passed
zburke pushed a commit that referenced this pull request Jun 10, 2024
…roles interface is present (#2689)

Refs UIU-3105.

(cherry picked from commit 9e4f9a8)
ryandberger pushed a commit that referenced this pull request Jul 26, 2024
@zburke zburke deleted the UIU-3105 branch October 25, 2024 13:05
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