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

Rename partial permissions variables #4731

Merged
merged 10 commits into from Jan 31, 2024

Conversation

magicznyleszek
Copy link
Member

Checklist

  1. If you've added code that should be tested, add tests
  2. If you've changed APIs, update (or create!) the documentation
  3. Ensure the tests pass
  4. Make sure that your code lints and that you've followed our coding style
  5. Write a title and, if necessary, a description of your work suitable for publishing in our release notes
  6. Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
  7. Open an issue in the docs if there are UI/UX changes

Description

Internal cleanup

Notes

Renamed everything related to partial permissions (for a selected list of users) to make room for more partial permissions (for particular responses). So basically we use …PartialByUsers instead of …Partial, because we will be adding …PartialByResponses :)

Needed for feature/extend-partial-perms

@magicznyleszek magicznyleszek mentioned this pull request Nov 21, 2023
7 tasks
@magicznyleszek magicznyleszek requested review from LMNTL and removed request for p2edwards January 25, 2024 23:22
Comment on lines +84 to +97
/** Names of checkboxes for partial permissions (the counterparts). */
export type CheckboxNamePartialByUsers =
| 'submissionsViewPartialByUsers'
| 'submissionsEditPartialByUsers'
| 'submissionsValidatePartialByUsers'
| 'submissionsDeletePartialByUsers';
/** All checkboxes names combined. */
export type CheckboxNameAll = CheckboxNameRegular | CheckboxNamePartialByUsers;
/** Name of lists of usernames for a partial permissions checkboxes. */
export type PartialByUsersListName =
| 'submissionsViewPartialByUsersList'
| 'submissionsEditPartialByUsersList'
| 'submissionsDeletePartialByUsersList'
| 'submissionsValidatePartialByUsersList';
Copy link
Contributor

Choose a reason for hiding this comment

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

If you turned CheckboxNamePartialByUsers and PartialByUsersListName into enums, it looks like you could delete getPartialByUsersListName() and getPartialByUsersCheckboxName(). (A frozen const object would also work, but at that point it's just an enum with more steps.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice idea, I will try doing it on feature-extend-partial-perms--add-partial-by-responses as I think I have more of these functions there already

Copy link

@magicznyleszek magicznyleszek merged commit 6577380 into beta Jan 31, 2024
4 checks passed
@magicznyleszek magicznyleszek deleted the rename-partial-permissions-variables branch January 31, 2024 22:11
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.

None yet

3 participants