Skip to content

[dashboard] handle unlimited users condition in license page #9771

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
May 6, 2022

Conversation

nandajavarma
Copy link
Contributor

Description

In gitpod.io the unlimited number of users is specified by seats === 0. Currently in the License dashboard, this condition is not handled properly and hence gives the wrong alert message. This PR fixes this issue.

Related Issue(s)

Fixes #9763

How to test

Update the license to have user seats value 0. I tested it by updating the user seats on a replicated license. One can ideally test it also on preview environment by updating the Werft secret for license.

Release Notes

None

Documentation

@nandajavarma nandajavarma requested review from gtsiolis, mrsimonemms and a team May 4, 2022 16:28
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label May 4, 2022
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.

Not exactly sure how to test this but the changes seem to have good intentions! 🙂

@jankeromnes jankeromnes self-assigned this May 6, 2022
@jankeromnes
Copy link
Contributor

jankeromnes commented May 6, 2022

Hi @nandajavarma, many thanks for this fix! 🙏 Happy to take a look today for team WebApp. The first thing will be for me to figure out how licenses work -- thanks also for linking to the relevant docs! 💯

@jankeromnes
Copy link
Contributor

jankeromnes commented May 6, 2022

Werft seems to have failed with:

Copy over CertManager resources from core-dev
Waiting for certificate readiness

Let's try this again:

/werft run with-clean-slate-deployment

👍 started the job as gitpod-build-nvn-fix-9763.1
(with .werft/ from main)

Copy link
Contributor

@jankeromnes jankeromnes 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 good to me, thanks!

And phew, I was finally able to install a license into the preview environment, thanks to:

LIMITED UNLIMITED
Screenshot 2022-05-06 at 10 40 00 Screenshot 2022-05-06 at 11 48 18

Looks good to me! 🚀

@@ -202,7 +203,8 @@ function communityPlan(userCount: number, seats: number, fallbackAllowed: boolea
}
};

const aboveLimit: boolean = userCount > seats;
// seats === 0 means unlimited number of users
const aboveLimit: boolean = seats === 0 ? false : userCount > seats;
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this could be de-duplicated as a single, isAboveLimit(userCount, seats) function. 💭 But not very important.

@roboquat roboquat merged commit 1f4e638 into main May 6, 2022
@roboquat roboquat deleted the nvn/fix-9763 branch May 6, 2022 09:52
@nandajavarma
Copy link
Contributor Author

@jankeromnes Thanks a lot for the thorough review!! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none size/XS team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Admin license screen showing "exceeded usage limit" on unlimited user license
4 participants