Skip to content

[dashboard] Fix user preferences workspace timeouts alert #20619

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

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

filiptronicek
Copy link
Member

@filiptronicek filiptronicek commented Feb 21, 2025

Description

Fixes the alert banner in user prefs and also adds the organization default workspace timeout to the org settings.

image

Related Issue(s)

Fixes CLC-1167

How to test

  1. Visit the preview env: https://ft-warning6fdc093cfa.preview.gitpod-dev.com/
  2. Go to org settings --> Policies
  3. Turn off Allow members to change workspace timeouts (you'll also need to upgrade the org first to a paid plan, which you can do with a 424242424242 credit card
  4. Go to user preferences and observe the warning banner mentioning 30m instead of the previous empty value.

/hold

/**
* Returns the default workspace timeout for an organization based on their billing mode (does not take into account the organization's own settings)
*/
export const useDefaultOrgTimeoutQuery = () => {
Copy link
Member

Choose a reason for hiding this comment

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

A bit sad that we have to replicate this logic here... 😕 Ideally, we'd have an API that emits this.

I'm ok with using this PR as short-term fix, though, given the overhead of introducing such an API. We can get back to it if we have the capacity. 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

We could totally put this in a OrganizationService.GetDefaultWorkspaceTimeout method. This feels ok for now, as the logic is so simple and since we're going to remove the billing stuff in a couple months, we'll be able to hardcode it instead.

Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

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

Code looks fine (with this caveat), ok to merge ✔️

Can't test due to preview being down, but feels low risk. 👍

@roboquat roboquat merged commit 36cdf66 into main Feb 24, 2025
164 of 176 checks passed
@roboquat roboquat deleted the ft/warning-about-default-org-timeout-restriction-fix branch February 24, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants