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

refactor: access policy enum #4601

Merged
merged 5 commits into from
Nov 8, 2024
Merged

Conversation

Schwehn42
Copy link
Collaborator

Description

Problem: Since the very beginning, AccessPolicy was an enum. This might look nice to use but actually causes some trouble, especially when trying to cast json data from an endpoint. Sure you can use typeof keyof AccessPolicy but that has other disadvantages.

So, this PR simply replaces the enum in favour of an union type.

Further reading: https://dev.to/ivanzm123/dont-use-enums-in-typescript-they-are-very-dangerous-57bh

Changelog

  • change AccessPolicy from enum to union type
  • adjust code that's impacted by the change

Checklist

  • I have performed a self-review of my own code

@Schwehn42 Schwehn42 added the Review Needed This pull request is ready for review label Oct 30, 2024
@Schwehn42 Schwehn42 self-assigned this Oct 30, 2024
Copy link
Collaborator

@mateo-ivc mateo-ivc left a comment

Choose a reason for hiding this comment

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

lgtm :shipit:

@Schwehn42 Schwehn42 removed the Review Needed This pull request is ready for review label Nov 8, 2024
@Schwehn42 Schwehn42 added this pull request to the merge queue Nov 8, 2024
@Schwehn42 Schwehn42 mentioned this pull request Nov 8, 2024
5 tasks
Copy link

github-actions bot commented Nov 8, 2024

The deployment to the dev cluster was successful. You can find the deployment here: https://4601.development.scrumlr.fra.ics.inovex.io
This deployment is only for testing purposes and will be deleted after 1 week.
To redeploy rerun the workflow.
DO NOT STORE IMPORTANT DATA ON THIS DEPLOYMENT

Deployed Images
  • ghcr.io/inovex/scrumlr.io/scrumlr-frontend:sha-4d85aaf

  • ghcr.io/inovex/scrumlr.io/scrumlr-server:sha-4d85aaf

Copy link

octomind-dev bot commented Nov 8, 2024

🐙 Octomind

Test Report: 14/14 successful.

description status details
About Section Visibility Test Passed ✅ click
change avatar Passed ✅ click
check Privacy Policy Passed ✅ click
check terms & conditions Passed ✅ click
close cookie banner - front page Passed ✅ click
close cookie banner - sign-in Passed ✅ click
create and delete board columns Passed ✅ click
create_and_delete_notes_and_actions_v2 Passed ✅ click
create lean coffee board Passed ✅ click
edit_notes_and_actions_v5 Passed ✅ click
get started Passed ✅ click
share_session Passed ✅ click
sign-in Passed ✅ click
test all ways to open the setup flow Passed ✅ click

commit sha: 4d85aaf

Merged via the queue into main with commit 72124f9 Nov 8, 2024
12 checks passed
@Schwehn42 Schwehn42 deleted the js/refactor-access-policy-enum branch November 8, 2024 13:04
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.

2 participants