-
Notifications
You must be signed in to change notification settings - Fork 13.1k
feat: workspace info admin page #30434
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
🦋 Changeset detectedLatest commit: 1a630f2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report
@@ Coverage Diff @@
## develop #30434 +/- ##
===========================================
- Coverage 51.32% 51.04% -0.29%
===========================================
Files 816 815 -1
Lines 15120 15298 +178
Branches 2753 2843 +90
===========================================
+ Hits 7761 7809 +48
- Misses 6951 7048 +97
- Partials 408 441 +33
Flags with carried forward coverage won't be shown. Click here to find out more. |
010c403 to
4409dec
Compare
6ca2f66
ggazzo
left a comment
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.
please check the comments
| key: React.Key; | ||
| }; | ||
|
|
||
| const VersionCardActionItem = ({ key, actionItem }: VersionCardActionItemProps): ReactElement => { |
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.
key is a reserved prop this is not going to be passed
| }; | ||
|
|
||
| const VersionCardActionItemList = ({ actionItems }: VersionCardActionItemListProps) => { | ||
| return actionItems ? ( |
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.
there is no need to test it here
| const getActionItems = useCallback(() => { | ||
| const items: VersionActionItem[] = []; | ||
| let btn; | ||
| const isOverLimits = limits ? isOverLicenseLimits(limits) : false; |
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.
| const isOverLimits = limits ? isOverLicenseLimits(limits) : false; | |
| const isOverLimits = limits && isOverLicenseLimits(limits); |
| export const isOverLicenseLimits = (limits: Limits): boolean => { | ||
| for (const key in limits) { | ||
| if (Object.hasOwn(limits, key)) { | ||
| const limit = limits[key as keyof Limits]; | ||
| if (limit.value !== undefined && limit.value > limit.max) { | ||
| return true; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return false; | ||
| }; |
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.
| export const isOverLicenseLimits = (limits: Limits): boolean => { | |
| for (const key in limits) { | |
| if (Object.hasOwn(limits, key)) { | |
| const limit = limits[key as keyof Limits]; | |
| if (limit.value !== undefined && limit.value > limit.max) { | |
| return true; | |
| } | |
| } | |
| } | |
| return false; | |
| }; | |
| export const isOverLicenseLimits = (limits: Limits): boolean => | |
| Object.values(limits).some((limit) => limit.value !== undefined && limit.value > limit.max); |
| label: <Trans i18nKey='Plan_limits_reached' />, | ||
| }); | ||
|
|
||
| btn = { path: '/admin/manage-subscription', label: <Trans i18nKey='Manage_subscription' /> }; |
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.
| btn = { path: '/admin/manage-subscription', label: <Trans i18nKey='Manage_subscription' /> }; | |
| btn = { path: '/admin/subscription', label: <Trans i18nKey='Manage_subscription' /> }; |
| if (path.startsWith('http')) { | ||
| return window.open(path, '_blank'); | ||
| } |
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.
I dont think this is the best way to choose if it opens in a new one or not
| if (path === 'modal#registerWorkspace') { | ||
| handleRegisterWorkspaceClick(); | ||
| return; | ||
| } |
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 doenst look like a generic component to me
pierre-lehnen-rc
left a comment
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.
backend 👍
NBJ-356
Proposed changes (including videos or screenshots)
New Workspace status page in place of Information Page
Changes:
Front-end:
infofolder toworkspaceStatususeUpgradeParams.tshook to fit to V3 license structureworkspaceroute toworkspace-statusroute and created a fallback for mobile app to still work underinfopathnameBoxcomponent props toCardcomponents to give more flexibility on styling card elements due to design specsBoxcomponent props toExternalLinkcomponent to give more flexibility on styling due to design specsFramedIconcomponent inui-clientpackage, should be moved to fuselage in the futureexpect download info as JSONe2e testuseWorkspaceInfo.tshook that joins all queries necessary forworkspace-statuspage (queries: statistics, instances.get, info)useLicense.tshook to use the newlicense.infoendpointisOverLicenseLimitsutil function to check if the license went over the license limitsBack-end:
IWorkspaceInfotype tocore-typingspackagegetServerInfo.tsfunctionstatistics.totalDiscussionsMessagesproperty to IStatsTODO:
Issue(s)
Steps to test or reproduce
Further comments