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

Display alert in "No seats" scenario #11768

Merged
merged 4 commits into from
Aug 2, 2022
Merged

Display alert in "No seats" scenario #11768

merged 4 commits into from
Aug 2, 2022

Conversation

geropl
Copy link
Member

@geropl geropl commented Aug 1, 2022

Description

Related Issue(s)

Fixes #9972

How to test

  • try to signup with GitHub here
  • notice how you're brought back to the login-screen, which should shows this message:

image

Note: the "feedback" panel is only shown on gitpod.io.

Release Notes

display an alert on signup if a user cannot login because they license does not cover for that additional seat

Documentation

Werft options:

  • /werft with-preview

@geropl
Copy link
Member Author

geropl commented Aug 1, 2022

/werft run

👍 started the job as gitpod-build-gpl-9972-no-seats.2
(with .werft/ from main)

With preview this time

@geropl geropl force-pushed the gpl/9972-no-seats branch from a5a28a7 to b773e5d Compare August 1, 2022 14:28
@roboquat roboquat added size/S and removed size/XS labels Aug 1, 2022
@geropl geropl marked this pull request as ready for review August 1, 2022 15:13
@geropl geropl requested a review from a team August 1, 2022 15:13
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Aug 1, 2022
@geropl
Copy link
Member Author

geropl commented Aug 1, 2022

/hold Until the TEST COMMIT is removed

@geropl
Copy link
Member Author

geropl commented Aug 1, 2022

@AlexTugarev Could you verify if the approach I took here is legit?

@gtsiolis Was the switch to <Alert ... >...<Alert/> what you had in mind here? 🤔

Copy link
Contributor

@lucasvaltl lucasvaltl left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for looking into this! :)

@@ -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`;
Copy link
Contributor

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:

Suggested change
const msg = `Maximum number of users permitted by the license exceeded`;
const msg = `Unable to log in. The license used for this installation does not have enough seats. Please contact your administrator to increase the number of seats for your license.`;

Copy link
Contributor

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:

Unable to log in.

Quite clear to read. But maybe we could surface the error instead?

The license used for this installation does not have enough seats.

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.

Please contact your administrator to increase the number of seats for your license.

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.

Copy link
Contributor

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.

Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

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

Nice one, @geropl! ✨

Left one comment about the style of the alert and another one about the copy used there.

Regarding the question in #11768 (comment): Yes, the alert component is exactly what I had in mind for this case. 🏀

Approving from UX perspective. ✔️

Approving as this also needs a review from @gitpod-io/engineering-webapp. 🏓

@@ -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`;
Copy link
Contributor

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:

Unable to log in.

Quite clear to read. But maybe we could surface the error instead?

The license used for this installation does not have enough seats.

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.

Please contact your administrator to increase the number of seats for your license.

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.

@@ -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`;
Copy link
Contributor

Choose a reason for hiding this comment

The 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

BEFORE AFTER
Screenshot 2022-08-01 at 9 46 00 PM Screenshot 2022-08-01 at 9 45 39 PM

Copy link
Contributor

@lucasvaltl lucasvaltl Aug 2, 2022

Choose a reason for hiding this comment

The 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."

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point, @lucasvaltl ! Agree, let's go with your updated suggestion:

Maximum number of users reached. We could not sign you in because this instance has reached the maximum number of allowed users."

Cc @geropl

Co-authored-by: George Tsiolis <tsiolis.g@gmail.com>
@@ -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 });
Copy link
Member

Choose a reason for hiding this comment

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

LGTM!
I wonder why that's not done always in L.441. 🤔

Copy link
Member

@AlexTugarev AlexTugarev left a comment

Choose a reason for hiding this comment

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

Screen Shot 2022-08-02 at 09 19 39

LGTM!

@geropl
Copy link
Member Author

geropl commented Aug 2, 2022

/unhold

@roboquat roboquat merged commit 74bf2aa into main Aug 2, 2022
@roboquat roboquat deleted the gpl/9972-no-seats branch August 2, 2022 07:29
@geropl
Copy link
Member Author

geropl commented Aug 2, 2022

@lucasvaltl @gtsiolis I'd like to defer the wording discussion, also because I think @jldec would want to review that is will (he's ooo this week). 👍

@lucasvaltl
Copy link
Contributor

That's fine with me - feel free to pick something and then we can iterate on it later on :)

@gtsiolis
Copy link
Contributor

gtsiolis commented Aug 2, 2022

Sounds good! Opened a follow-up issue for the wording in #11791. Cc @lucasvaltl @geropl

@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note size/S team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Self-Hosted] Handle No More Seats on License Error
5 participants