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

feat: workspace info admin page #30434

Merged
merged 64 commits into from
Oct 31, 2023
Merged

Conversation

hugocostadev
Copy link
Contributor

@hugocostadev hugocostadev commented Sep 18, 2023

NBJ-356

Proposed changes (including videos or screenshots)

New Workspace status page in place of Information Page

Changes:

Front-end:

  • Renamed info folder to workspaceStatus
  • New VersionCard component to Worksapace status admin page
  • updated useUpgradeParams.ts hook to fit to V3 license structure
  • updated workspace route to workspace-status route and created a fallback for mobile app to still work under info pathname
  • Added Box component props to Card components to give more flexibility on styling card elements due to design specs
  • Added Box component props to ExternalLink component to give more flexibility on styling due to design specs
  • New FramedIcon component in ui-client package, should be moved to fuselage in the future
  • Fixed expect download info as JSON e2e test
  • new i18n translations
  • new useWorkspaceInfo.ts hook that joins all queries necessary for workspace-status page (queries: statistics, instances.get, info)
  • changes to useLicense.ts hook to use the new license.info endpoint
  • new isOverLicenseLimits util function to check if the license went over the license limits

Back-end:

  • New IWorkspaceInfo type to core-typings package
  • Improvement in typing of getServerInfo.ts function
  • New statistics.totalDiscussionsMessages property to IStats

image

TODO:

Issue(s)

Steps to test or reproduce

Further comments

@changeset-bot
Copy link

changeset-bot bot commented Sep 18, 2023

🦋 Changeset detected

Latest commit: 1a630f2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 30 packages
Name Type
@rocket.chat/meteor Minor
@rocket.chat/core-typings Minor
@rocket.chat/rest-typings Minor
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/gazzodown Major
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-contexts Major
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/api-client Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/ddp-client Patch
@rocket.chat/fuselage-ui-kit Major
@rocket.chat/models Patch
@rocket.chat/ui-client Major
@rocket.chat/ui-video-conf Major
@rocket.chat/uikit-playground Patch
@rocket.chat/web-ui-registration Major
@rocket.chat/instance-status Patch

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
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Merging #30434 (1a630f2) into develop (bd9d2b7) will decrease coverage by 0.29%.
Report is 1 commits behind head on develop.
The diff coverage is 70.00%.

Impacted file tree graph

@@             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     
Flag Coverage Δ
e2e 48.22% <70.00%> (-0.25%) ⬇️
unit 64.46% <100.00%> (+0.04%) ⬆️

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

@hugocostadev hugocostadev added this to the 6.5.0 milestone Oct 4, 2023
@hugocostadev hugocostadev force-pushed the feature/info-page-overview-cards branch from 010c403 to 4409dec Compare October 5, 2023 18:46
@hugocostadev hugocostadev marked this pull request as ready for review October 9, 2023 16:09
Copy link
Member

@ggazzo ggazzo left a 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 => {
Copy link
Member

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 ? (
Copy link
Member

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;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const isOverLimits = limits ? isOverLicenseLimits(limits) : false;
const isOverLimits = limits && isOverLicenseLimits(limits);

Comment on lines 11 to 22
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;
};
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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' /> };
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
btn = { path: '/admin/manage-subscription', label: <Trans i18nKey='Manage_subscription' /> };
btn = { path: '/admin/subscription', label: <Trans i18nKey='Manage_subscription' /> };

Comment on lines 24 to 26
if (path.startsWith('http')) {
return window.open(path, '_blank');
}
Copy link
Member

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

Comment on lines 28 to 31
if (path === 'modal#registerWorkspace') {
handleRegisterWorkspaceClick();
return;
}
Copy link
Member

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

Copy link
Contributor

@pierre-lehnen-rc pierre-lehnen-rc left a comment

Choose a reason for hiding this comment

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

backend 👍

@ggazzo ggazzo merged commit 5d55a93 into develop Oct 31, 2023
41 checks passed
@ggazzo ggazzo deleted the feature/info-page-overview-cards branch October 31, 2023 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants