mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-22 09:57:00 +01:00
Remove team access code functionality from cloud mode
This commit is contained in:
parent
d62dd3be44
commit
6b381e7157
@ -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>
|
||||||
|
@ -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 />
|
||||||
|
Loading…
Reference in New Issue
Block a user