-
Notifications
You must be signed in to change notification settings - Fork 13.1k
[NEW][ENTERPRISE] Add support to license tags #18093
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
Conversation
ee/app/license/server/bundles.ts
Outdated
| }; | ||
|
|
||
| const getBundleFromModule = (moduleName: string): string|undefined => { | ||
| export const getBundleFromModule = (moduleName: string): string => { |
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.
Isn't this misleading since an empty string isn't a module and may be checked somewhere as != null?
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.
it will still work if you compare with != null, so no issue with this. it would break though if there was a code comparing !== ''. but it was not the case.
but the only reason for this change was actually to be able to use in this .map .. I didn't found other solution for this, suggestions are welcome. this is what TS complains if keep it as string|undefined:

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.
You can change the forEach to
.forEach((m) => m && this.tags.add(m));and prevent from add an empty string as a tag as well
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.
not that beauty but it works.. I'd like it to be clever and work with an additional filter:
license.modules
.filter(isBundle)
.map(getBundleFromModule)
.filter((tag) => !!tag)
.forEach(this.tags.add, this.tags);but I'll revert this 👍
d91136a to
1062848
Compare
From #18276 Co-authored-by: Tasso Evangelista <[email protected]> Co-authored-by: Guilherme Gazzo <[email protected]> Co-authored-by: Martin Schoeler <[email protected]>
Proposed changes
License tags will be used to display which types of license a server has.
Issue(s)
How to test or reproduce
Screenshots
Types of changes
Checklist
Changelog
Enterprise installations will show tags on Admin panel with the type of the license applied. The tag will be visible on the top-left corner of the administration area as a badge helping administrators to identify which license they have.
Further comments