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

fix(greenhouse): add support_group only if supportGroups exists and is an array #608

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

ArtieReus
Copy link
Collaborator

@ArtieReus ArtieReus commented Nov 14, 2024

Summary

This PR improves the handling of the support_group key within initialFilters in appProps. Now, support_group is added only when authData.parsed.supportGroups exists and is a valid array. If supportGroups is undefined, null, or not an array, support_group will be omitted from initialFilters, ensuring cleaner and more reliable data handling. Fixes the issue that prevented colleagues without a supportGroups value from accessing Supernova and Doop.

Related task #611

Changes Made

  • Added a conditional spread operator to include support_group only if supportGroups is an array.
  • If supportGroups does not exist or is not an array, support_group is excluded from initialFilters.

Screenshots (if applicable)

Error when no support group is set to the logged user:

Screenshot 2024-11-14 at 12 06 54

Testing Instructions

  1. npm i
  2. Remove from the Auth Object the supportGroup delete authData.parsed.supportGroups
  3. npx turbo dev --filter @cloudoperators/juno-app-greenhouse

Checklist

  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have made corresponding changes to the documentation (if applicable).
  • My changes generate no new warnings or errors.

@ArtieReus ArtieReus requested a review from a team as a code owner November 14, 2024 11:09
Copy link

changeset-bot bot commented Nov 14, 2024

🦋 Changeset detected

Latest commit: 5d7de49

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudoperators/juno-app-greenhouse Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ArtieReus ArtieReus self-assigned this Nov 14, 2024
@ArtieReus ArtieReus added greenhouse Greenhouse core related task refactor labels Nov 14, 2024
Copy link
Contributor

github-actions bot commented Nov 14, 2024

PR Preview Action v1.4.8
Preview removed because the pull request was closed.
2024-11-14 13:13 UTC

Copy link
Collaborator

@andypf andypf left a comment

Choose a reason for hiding this comment

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

Added a comment

TilmanHaupt
TilmanHaupt previously approved these changes Nov 14, 2024
Copy link
Collaborator

@andypf andypf left a comment

Choose a reason for hiding this comment

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

LGTM

@ArtieReus ArtieReus merged commit 3810a93 into main Nov 14, 2024
15 checks passed
@ArtieReus ArtieReus deleted the artie-fix-empty-support-group branch November 14, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
greenhouse Greenhouse core related task refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants