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 }) { export function TeamsHeader({ allowCreate = true }: { allowCreate?: boolean }) {
const { formatMessage, labels } = useMessages(); const { formatMessage, labels } = useMessages();
const { user } = useLogin(); const { user } = useLogin();
const cloudMode = process.env.CLOUD_MODE;
return ( return (
<PageHeader title={formatMessage(labels.teams)}> <PageHeader title={formatMessage(labels.teams)}>
<Flexbox gap={10}> <Flexbox gap={10}>
<TeamsJoinButton /> {!cloudMode && <TeamsJoinButton />}
{allowCreate && user.role !== ROLES.viewOnly && <TeamsAddButton />} {allowCreate && user.role !== ROLES.viewOnly && <TeamsAddButton />}
</Flexbox> </Flexbox>
</PageHeader> </PageHeader>

View File

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