[NEW][ENTERPRISE] Add support to license tags#18093
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.
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.
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.
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.
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