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

chore: UI SCIM guard for groups #6866

Merged
merged 2 commits into from
Apr 17, 2024
Merged

chore: UI SCIM guard for groups #6866

merged 2 commits into from
Apr 17, 2024

Conversation

nunogois
Copy link
Member

https://linear.app/unleash/issue/2-2113/ui-should-not-allow-manual-management-of-scim-managed-groups-in

Adds a UI SCIM guard when trying to manage groups.

The condition for the guard is:

  • Enterprise
  • SCIM flag enabled
  • SCIM setting enabled
  • SCIM group

Similar to #6859

Copy link

vercel bot commented Apr 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 16, 2024 1:36pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Apr 16, 2024 1:36pm

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 2 findings(s) 🚩

View detailed results in CodeScene

color='primary'
disabled={scimEnabled || !isValid}
data-testid={UG_SAVE_BTN_ID}
title='test'
Copy link
Contributor

@daveleek daveleek Apr 16, 2024

Choose a reason for hiding this comment

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

Intentional? or should the title be something different here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Absolutely not intentional. Great catch!

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@daveleek daveleek left a comment

Choose a reason for hiding this comment

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

nice! question around a potentially unintended title

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 1 findings(s) 🚩

View detailed results in CodeScene

Comment on lines +137 to +141
title={
isScimGroup
? scimGroupTooltip
: 'Remove user from group'
}

Choose a reason for hiding this comment

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

❌ Getting worse: Complex Method
Group:VFC.columns increases in cyclomatic complexity from 16 to 17, threshold = 10

Suppress

@nunogois
Copy link
Member Author

Tried simplifying all the conditions in 30a7594 - They should already be covered in the useScimSettings hook so we can just rely on that. Could you please sanity check me here @daveleek ?

Comment on lines 56 to 60
const scimEnabled =
isEnterprise() &&
scimSettingEnabled &&
scimFlagEnabled &&
Boolean(group?.scimId);
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok so the useScimSettings().enabled already covers this making it redundant

Copy link
Member Author

Choose a reason for hiding this comment

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

Correct, that's what I'm thinking 👍

Copy link
Contributor

@daveleek daveleek left a comment

Choose a reason for hiding this comment

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

Great! I wondered about the flag and things like that, but appears that's already handled by useScimSettings

@nunogois nunogois merged commit bc07045 into main Apr 17, 2024
13 checks passed
@nunogois nunogois deleted the chore-ui-scim-guard-groups branch April 17, 2024 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants