-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Display alert in "No seats" scenario #11768
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,7 +5,14 @@ | |||||
*/ | ||||||
|
||||||
import { UserService, CheckSignUpParams, CheckTermsParams } from "../../../src/user/user-service"; | ||||||
import { User, WorkspaceTimeoutDuration, WORKSPACE_TIMEOUT_EXTENDED, WORKSPACE_TIMEOUT_EXTENDED_ALT, WORKSPACE_TIMEOUT_DEFAULT_LONG, WORKSPACE_TIMEOUT_DEFAULT_SHORT } from "@gitpod/gitpod-protocol"; | ||||||
import { | ||||||
User, | ||||||
WorkspaceTimeoutDuration, | ||||||
WORKSPACE_TIMEOUT_EXTENDED, | ||||||
WORKSPACE_TIMEOUT_EXTENDED_ALT, | ||||||
WORKSPACE_TIMEOUT_DEFAULT_LONG, | ||||||
WORKSPACE_TIMEOUT_DEFAULT_SHORT, | ||||||
} from "@gitpod/gitpod-protocol"; | ||||||
import { inject } from "inversify"; | ||||||
import { LicenseEvaluator } from "@gitpod/licensor/lib"; | ||||||
import { Feature } from "@gitpod/licensor/lib/api"; | ||||||
|
@@ -78,7 +85,8 @@ export class UserServiceEE extends UserService { | |||||
|
||||||
// 1. check the license | ||||||
const userCount = await this.userDb.getUserCount(true); | ||||||
if (!this.licenseEvaluator.hasEnoughSeats(userCount)) { | ||||||
if (userCount > -1) { | ||||||
//!this.licenseEvaluator.hasEnoughSeats(userCount)) { | ||||||
const msg = `Maximum number of users permitted by the license exceeded`; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Adding one more alternative copy with a different copy structure, but we can work on improving the error messages in a later iteration. Cc @lucasvaltl
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm ok with this in general, but the terminology "instance user cap" seems off to me. We don't use it anywhere else, we usually talk about seats or just users. I'd suggest we go with "Maximum number of users reached. We could not sign you in because this instance has reached the maximum number of allowed users." There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, @lucasvaltl ! Agree, let's go with your updated suggestion:
Cc @geropl |
||||||
throw AuthException.create("Cannot sign up", msg, { userCount, params }); | ||||||
} | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -423,7 +423,7 @@ export class GenericAuthProvider implements AuthProvider { | |
|
||
let message = "Authorization failed. Please try again."; | ||
if (AuthException.is(err)) { | ||
message = `Login was interrupted: ${err.message}`; | ||
return this.sendCompletionRedirectWithError(response, { error: err.message }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM! |
||
} | ||
if (this.isOAuthError(err)) { | ||
message = "OAuth Error. Please try again."; // this is a 5xx response from authorization service | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd word this slightly more specifically:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the copy suggestion, @lucasvaltl!
Some thoughts on the suggested copy:
Quite clear to read. But maybe we could surface the error instead?
Do we need to surface the license limits to the users? I'd expect us in the future to be a bit cautious about the error messages here to avoid exposing any relevant information.
While surfacing a call-to-action (CTA) to users sounds good, I'd avoid vague actions like this which are usually not helpful, and sometimes it's not possible to perform in some large organizations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Also, it'd be great if we could surface this CTA to request a new license for the admins when browsing the dashboard.