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 enforcement of seats to EE #15734

Merged
merged 56 commits into from Feb 27, 2023
Merged

Add enforcement of seats to EE #15734

merged 56 commits into from Feb 27, 2023

Conversation

ivanThePleasant
Copy link
Contributor

What does it do?

PR adds enforcement of seats workflow to the Admin package and adds several changes to the core strapi package in order to accommodate enforcement of seats workflow.

Why is it needed?

These changes will enforce the number of users in EE mode in accordance with the project license.

How to test it?

Run the branch in development with the license: run examples/getstarted for server and packages/core/admin for admin panel. You will have to set permittedSeats to a chosen number manually, just search for the variable name. Then, try to add more users than the permitteSeats number.

@ivanThePleasant ivanThePleasant added source: core:admin Source is core/admin package pr: chore This PR contains chore tasks (cleanups, configs, tooling...) labels Feb 7, 2023
@codecov
Copy link

codecov bot commented Feb 7, 2023

Codecov Report

Base: 58.41% // Head: 58.46% // Increases project coverage by +0.04% 🎉

Coverage data is based on head (52c7eba) compared to base (cf179e3).
Patch coverage: 78.57% of modified lines in pull request are covered.

Additional details and impacted files
@@                Coverage Diff                 @@
##           releases/4.7.0   #15734      +/-   ##
==================================================
+ Coverage           58.41%   58.46%   +0.04%     
==================================================
  Files                1545     1552       +7     
  Lines               38203    38305     +102     
  Branches             7514     7536      +22     
==================================================
+ Hits                22317    22395      +78     
- Misses              13593    13617      +24     
  Partials             2293     2293              
Flag Coverage Δ
back 47.37% <0.00%> (-0.03%) ⬇️
front 66.11% <80.73%> (+0.06%) ⬆️
unit_back 47.37% <0.00%> (-0.03%) ⬇️
unit_front 66.11% <80.73%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...src/components/Notifications/Notification/index.js 66.00% <0.00%> (-7.34%) ⬇️
...icationInfosPage/components/AdminSeatInfo/index.js 0.00% <0.00%> (ø)
...c/pages/SettingsPage/pages/Users/EditPage/index.js 0.00% <ø> (ø)
...ngsPage/pages/Users/ListPage/CreateAction/index.js 0.00% <0.00%> (ø)
packages/core/strapi/ee/index.js 20.23% <0.00%> (-1.45%) ⬇️
packages/core/strapi/lib/Strapi.js 16.72% <ø> (-0.30%) ⬇️
...min/src/hooks/useLicenseLimitNotification/index.js 66.66% <66.66%> (ø)
...e/admin/hooks/useLicenseLimitNotification/index.js 90.00% <90.00%> (ø)
...ore/admin/ee/admin/hooks/useLicenseLimits/index.js 93.33% <93.33%> (ø)
packages/core/admin/admin/src/hooks/index.js 100.00% <100.00%> (ø)
... and 9 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Co-authored-by: Josh Ellis <josh.ellis@strapi.io>
@ivanThePleasant ivanThePleasant added the flag: don't merge This PR should not be merged at the moment label Feb 8, 2023
Copy link
Member

@joshuaellis joshuaellis left a comment

Choose a reason for hiding this comment

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

I think for me the main thing that is missing is some tests for the hooks:

  • useLicenseLimitNotification
  • useLicenseLimits
    and AdminSeatInfo/CreateAction – I don't think this would take too long to be honest

I've left some suggestions about imports, may seem superfluous but eventually we will stop supporting the direct import paths as they're not necessary for bundle size anymore :)

ivanThePleasant and others added 4 commits February 8, 2023 13:38
…stPage/CreateAction/index.js

Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
…stPage/CreateAction/index.js

Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
…ionInfosPage/components/AdminSeatInfo/index.js

Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
…ionInfosPage/components/AdminSeatInfo/index.js

Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
@alexandrebodin alexandrebodin self-assigned this Feb 22, 2023
Copy link
Member

@joshuaellis joshuaellis left a comment

Choose a reason for hiding this comment

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

Apart from the URLs mention, from an FE perspective I'm happy with this :)

@ivanThePleasant
Copy link
Contributor Author

Hey @joshuaellis the plans for urls was to create a small app that would redirect users to the correct payment portal depending on cloud/self hosted and if they wanted to pay by card/wire transfer. The app would have eventually grown into strapi portal that would be a wrapper for strapi services payments, but in the beginning it would be just redirecting.

We started working on it on Monday, so I pushed the code to strap/portal repo. Feel free to check it out if you want, it's a simple next app

@Convly Convly added this to the 4.7.0 milestone Feb 24, 2023
@Convly Convly changed the base branch from main to releases/4.7.0 February 24, 2023 11:37
@alexandrebodin alexandrebodin requested review from Marc-Roig and removed request for alexandrebodin February 26, 2023 17:05
@alexandrebodin
Copy link
Member

@joshuaellis & @gu-stav I added rbac checks to avoid making an API call that wouldn't work.

As the code was only using hooks I went with the useQuery enable option to make this happen for now. Let me know what you think.

@Marc-Roig & @Convly I updated the backend code and fixed a few things. You can look at the commits to see the differences.

Copy link
Member

@joshuaellis joshuaellis left a comment

Choose a reason for hiding this comment

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

FE looks good to me

Copy link
Contributor

@Marc-Roig Marc-Roig left a comment

Choose a reason for hiding this comment

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

LGTM, what I miss are some tests, that we could add in another PR.

@Convly Convly self-requested a review February 27, 2023 09:03
@alexandrebodin
Copy link
Member

LGTM, what I miss are some tests, that we could add in another PR.

💯

@ivanThePleasant
Copy link
Contributor Author

😌

@alexandrebodin alexandrebodin merged commit c822928 into releases/4.7.0 Feb 27, 2023
@alexandrebodin alexandrebodin deleted the chore/ee-seats branch February 27, 2023 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: chore This PR contains chore tasks (cleanups, configs, tooling...) source: core:admin Source is core/admin package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants