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

Regression: Hide Workspace registration feature for non-admin users #28154

Merged
merged 1 commit into from
Feb 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OptionTitle } from '@rocket.chat/fuselage';
import { useTranslation, useRoute, useMethod, useSetModal } from '@rocket.chat/ui-contexts';
import { useTranslation, useRoute, useMethod, useSetModal, useRole } from '@rocket.chat/ui-contexts';
import { useQuery } from '@tanstack/react-query';
import { FlowRouter } from 'meteor/kadira:flow-router';
import type { FC } from 'react';
Expand Down Expand Up @@ -27,6 +27,7 @@ const AdministrationModelList: FC<AdministrationModelListProps> = ({ accountBoxI
const shouldShowEmoji = isFullyFeature(tabType);
const label = getUpgradeTabLabel(tabType);
const hasInfoPermission = userHasAllPermission(INFO_PERMISSIONS);
const isAdmin = useRole('admin');
const setModal = useSetModal();

const checkCloudRegisterStatus = useMethod('cloud:checkRegisterStatus');
Expand Down Expand Up @@ -62,18 +63,20 @@ const AdministrationModelList: FC<AdministrationModelListProps> = ({ accountBoxI
}}
/>
)}
<ListItem
icon='cloud-plus'
text={workspaceRegistered ? t('Registration') : t('Register')}
action={(): void => {
if (workspaceRegistered) {
cloudRoute.push({ context: '/' });
onDismiss();
return;
}
handleRegisterWorkspaceClick();
}}
/>
{isAdmin && (
<ListItem
icon='cloud-plus'
text={workspaceRegistered ? t('Registration') : t('Register')}
action={(): void => {
if (workspaceRegistered) {
cloudRoute.push({ context: '/' });
onDismiss();
return;
}
handleRegisterWorkspaceClick();
}}
/>
)}
{showWorkspace && (
<ListItem
icon='cog'
Expand Down