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

Add support to update can_access_all_users_group setting in dev environment. #27873

Merged
merged 2 commits into from
Nov 23, 2023

Conversation

sahil839
Copy link
Collaborator

@sahil839 sahil839 commented Nov 23, 2023

  • First commit is to rearrange settings in "Organization permissions" section.
  • Second commit is to add support to update the can_access_all_users_group setting.

Screenshots and screen captures:
Screenshot from 2023-11-23 22-54-08

Self-review checklist
  • Self-reviewed the changes for clarity and maintainability
    (variable names, code reuse, readability, etc.).

Communicate decisions, questions, and potential concerns.

  • Explains differences from previous plans (e.g., issue description).
  • Highlights technical choices and bugs encountered.
  • Calls out remaining decisions and concerns.
  • Automated tests verify logic where appropriate.

Individual commits are ready for review (see commit discipline).

  • Each commit is a coherent idea.
  • Commit message(s) explain reasoning and motivation for changes.

Completed manual review and testing of the following:

  • Visual appearance of the changes.
  • Responsiveness and internationalization.
  • Strings and tooltips.
  • End-to-end functionality of buttons, interactions and flows.
  • Corner cases, error conditions, and easily imagined bugs.

This commit re-arranges the settings in "Organization permissions"
section -
- A new section "Guests" is added which now contains the guest
indicator setting checkbox.
- Moved "User identity" and "Guests" sections above "Other permissions"
section.
This commit updates the backend code to allow changing
can_access_all_users_group setting in development environment
and also adds a dropdown in webapp UI which is only shown in
development environment.
@@ -232,6 +233,10 @@ def update_realm(
if enable_spectator_access:
realm.ensure_not_on_limited_plan()

if can_access_all_users_group_id is not None:
# Remove this when the feature is ready for production.
assert settings.DEVELOPMENT
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have used assert here instead of raising JsonableErrror since we do the same for demo orgs feature.

},
});
settings_components.set_can_access_all_users_group_widget(can_access_all_users_group_widget);
can_access_all_users_group_widget.setup();
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

This isn't a task for this PR, but as a follow-up, we should work to make this a component where one can just pass in the setting name and it'll initialize everything; or maybe even a fancier version where one can declare it just via including the right block in an HTML template.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I was also thinking of doing something similar, would be needed especially when we would add more group-based settings.

@timabbott timabbott merged commit 189718d into zulip:main Nov 23, 2023
8 checks passed
@timabbott
Copy link
Sponsor Member

Merged, thanks @sahil839!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants