-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Merged
Merged
Changes from 63 commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
98438fe
chore: improve deprecation warning
dougfabris f6277d6
replacing Card component to naming imports
hugocostadev 91f10e3
fix typo
hugocostadev 2bea3c3
Merge remote-tracking branch 'origin/develop' into feature/info-page-…
hugocostadev 965018a
adding props to Card components
hugocostadev d3424a0
updating deps
hugocostadev b3d1798
adding mock types and payloads
hugocostadev 6991c32
new workspace status page
hugocostadev f8ece5c
Merge remote-tracking branch 'origin/develop' into feature/info-page-…
hugocostadev 914638b
cleaning unused components
hugocostadev e184f5c
change request
hugocostadev 738b28d
Merge remote-tracking branch 'origin/develop' into feature/info-page-…
hugocostadev de0c449
feat: adding discussion statistics
hugocostadev 88494cb
refactoring VersionCard and spliting into separated components
hugocostadev e7ff4c2
Merge branch 'develop' into feature/info-page-overview-cards
hugocostadev f9f0f07
Merge remote-tracking branch 'origin/develop' into feature/info-page-…
hugocostadev 05b117f
replacing license.get with license.info endpoint at useLicense hook
hugocostadev bf3cb21
feat: FramedIcon component
hugocostadev 6ca4a8a
chore: IWorkspaceInfo type def
hugocostadev d496a83
integrating backend with frontend and renaming folder/files
hugocostadev 4409dec
Merge remote-tracking branch 'origin/develop' into feature/info-page-…
hugocostadev d8fb6e8
updating go links
hugocostadev 5b0460d
Merge remote-tracking branch 'origin/develop' into feature/info-page-…
hugocostadev 7482034
Implementing license limits check FE
hugocostadev dc78308
fix: ts errors
hugocostadev 4529843
fix: unit test
hugocostadev e3517b9
fix: unit test
hugocostadev d33eef5
Create workspace-status-admin-page.md
hugocostadev d72b6a1
Merge remote-tracking branch 'origin/develop' into feature/info-page-…
hugocostadev 7053533
fix: e2e test at workspace-status
hugocostadev 1987da7
fix: route fallback for mobile apps
hugocostadev 9643672
Merge branch 'develop' into feature/info-page-overview-cards
hugocostadev 6b7dfef
fix: e2e tests
hugocostadev a755612
fix: e2e test
hugocostadev f947a88
Merge branch 'develop' into feature/info-page-overview-cards
hugocostadev 78599bd
Merge branch 'develop' into feature/info-page-overview-cards
hugocostadev a6bbb48
Update .changeset/workspace-status-admin-page.md
hugocostadev 45a1429
fixing tab size
hugocostadev 7a42f1a
fix tab size
hugocostadev 5f34548
Merge remote-tracking branch 'origin/develop' into feature/info-page-…
hugocostadev 2c2f1cb
fixing invalid date error
hugocostadev 4814a38
Merge remote-tracking branch 'origin/develop' into feature/info-page-…
hugocostadev 6debd1e
changes request
hugocostadev 98fd4fa
fix: no license scenario
hugocostadev a7b8ba1
fix version check
hugocostadev 8a5e9dd
fix: rename Workspace status to Workspace
hugocostadev 59b63bf
Merge remote-tracking branch 'origin/develop' into feature/info-page-…
hugocostadev 769e341
renaming folder and components to Workspace
hugocostadev 32844c5
Merge remote-tracking branch 'origin/develop' into feature/info-page-…
hugocostadev 051e887
Implementing useLicense chages
hugocostadev 6ca2f66
Merge remote-tracking branch 'origin/develop' into feature/info-page-…
hugocostadev 2ca720c
Merge remote-tracking branch 'origin/develop' into feature/info-page-…
hugocostadev ed5ac73
Merge branch 'develop' into feature/info-page-overview-cards
hugocostadev 4df19b1
fix: typecheck error
hugocostadev 05a0605
revert: :art: card component changes
hugocostadev c5d6513
Merge branch 'develop' into feature/info-page-overview-cards
hugocostadev 279726c
fix: :pencil2: implementing background to Card component and fixing t…
hugocostadev fa9d9e5
Merge branch 'develop' into feature/info-page-overview-cards
hugocostadev f0a4307
Merge remote-tracking branch 'origin/develop' into feature/info-page-…
hugocostadev 0f1e49d
fix: homepage > cards e2e test
hugocostadev cf47b6f
Merge remote-tracking branch 'origin/develop' into feature/info-page-…
hugocostadev 39d1865
fix:
hugocostadev 9fc2ae7
Merge branch 'develop' into feature/info-page-overview-cards
hugocostadev 1a630f2
review
ggazzo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@rocket.chat/meteor": minor | ||
| --- | ||
|
|
||
| Added a new Admin page called `Workspace info` in place of Information page, to make it easier to check the license |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import type { IWorkspaceInfo, IStats } from '@rocket.chat/core-typings'; | ||
| import type { IInstance } from '@rocket.chat/rest-typings'; | ||
| import { useEndpoint } from '@rocket.chat/ui-contexts'; | ||
| import { useQueries } from '@tanstack/react-query'; | ||
|
|
||
| export const useWorkspaceInfo = () => { | ||
| const getStatistics = useEndpoint('GET', '/v1/statistics'); | ||
| const getInstances = useEndpoint('GET', '/v1/instances.get'); | ||
| const getServerInfo = useEndpoint('GET', '/info'); | ||
|
|
||
| const results = useQueries({ | ||
| queries: [ | ||
| { queryKey: ['info', 'serverInfo'], queryFn: () => getServerInfo(), staleTime: Infinity, keepPreviousData: true }, | ||
| { queryKey: ['info', 'instances'], queryFn: () => getInstances(), staleTime: Infinity, keepPreviousData: true }, | ||
| { queryKey: ['info', 'statistics'], queryFn: () => getStatistics({ refresh: 'true' }), staleTime: Infinity, keepPreviousData: true }, | ||
| ], | ||
| }); | ||
|
|
||
| const [serverInfoQuery, instancesQuery, statisticsQuery] = results; | ||
|
|
||
| const instances: IInstance[] | undefined = instancesQuery?.data?.instances as IInstance[]; | ||
| const statistics: IStats | undefined = statisticsQuery?.data as IStats; | ||
| const serverInfo: IWorkspaceInfo | undefined = serverInfoQuery?.data as IWorkspaceInfo; | ||
|
|
||
| const isLoading = results.some((query) => query.isLoading); | ||
| const isError = results.some((query) => query.isError); | ||
|
|
||
| return { instances, statistics, serverInfo, isLoading, isError, refetchStatistics: statisticsQuery.refetch }; | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,22 @@ | ||||||||||||||||||||||||||||||
| import type { LicenseLimitKind } from '@rocket.chat/license'; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| type Limits = Record< | ||||||||||||||||||||||||||||||
|
hugocostadev marked this conversation as resolved.
|
||||||||||||||||||||||||||||||
| LicenseLimitKind, | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| max: number; | ||||||||||||||||||||||||||||||
| value?: number; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| >; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| 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; | ||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||
|
hugocostadev marked this conversation as resolved.
Outdated
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.