Remove team access code functionality from cloud mode

This commit is contained in:
Francis Cao 2024-02-08 13:44:51 -08:00
parent d62dd3be44
commit 6b381e7157
2 changed files with 4 additions and 2 deletions

View File

@ -8,11 +8,12 @@ import TeamsAddButton from './TeamsAddButton';
export function TeamsHeader({ allowCreate = true }: { allowCreate?: boolean }) {
const { formatMessage, labels } = useMessages();
const { user } = useLogin();
const cloudMode = process.env.CLOUD_MODE;
return (
<PageHeader title={formatMessage(labels.teams)}>
<Flexbox gap={10}>
<TeamsJoinButton />
{!cloudMode && <TeamsJoinButton />}
{allowCreate && user.role !== ROLES.viewOnly && <TeamsAddButton />}
</Flexbox>
</PageHeader>

View File

@ -26,6 +26,7 @@ export function TeamEditForm({ teamId, allowEdit }: { teamId: string; allowEdit?
const ref = useRef(null);
const [accessCode, setAccessCode] = useState(team.accessCode);
const { showToast } = useToasts();
const cloudMode = process.env.CLOUD_MODE;
const handleSubmit = async (data: any) => {
mutate(data, {
@ -58,7 +59,7 @@ export function TeamEditForm({ teamId, allowEdit }: { teamId: string; allowEdit?
)}
{!allowEdit && team.name}
</FormRow>
{allowEdit && (
{!cloudMode && allowEdit && (
<FormRow label={formatMessage(labels.accessCode)}>
<Flexbox gap={10}>
<TextField value={accessCode} readOnly allowCopy />