mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-22 09:57:00 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
cc3393d1ff
@ -30,7 +30,7 @@ export function ReportDeleteButton({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalTrigger>
|
<ModalTrigger>
|
||||||
<Button variant="quiet">
|
<Button>
|
||||||
<Icon>
|
<Icon>
|
||||||
<Icons.Trash />
|
<Icons.Trash />
|
||||||
</Icon>
|
</Icon>
|
||||||
|
@ -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.cloudMode;
|
||||||
|
|
||||||
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>
|
||||||
|
@ -25,7 +25,7 @@ export function TeamMemberEditButton({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalTrigger>
|
<ModalTrigger>
|
||||||
<Button variant="quiet">
|
<Button>
|
||||||
<Icon>
|
<Icon>
|
||||||
<Icons.Edit />
|
<Icons.Edit />
|
||||||
</Icon>
|
</Icon>
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
SubmitButton,
|
SubmitButton,
|
||||||
} from 'react-basics';
|
} from 'react-basics';
|
||||||
|
|
||||||
export function UserAddForm({
|
export function TeamMemberEditForm({
|
||||||
teamId,
|
teamId,
|
||||||
userId,
|
userId,
|
||||||
role,
|
role,
|
||||||
@ -41,7 +41,7 @@ export function UserAddForm({
|
|||||||
|
|
||||||
const renderValue = (value: string) => {
|
const renderValue = (value: string) => {
|
||||||
if (value === ROLES.teamMember) {
|
if (value === ROLES.teamMember) {
|
||||||
return formatMessage(labels.teamMember);
|
return formatMessage(labels.member);
|
||||||
}
|
}
|
||||||
if (value === ROLES.teamViewOnly) {
|
if (value === ROLES.teamViewOnly) {
|
||||||
return formatMessage(labels.viewOnly);
|
return formatMessage(labels.viewOnly);
|
||||||
@ -58,7 +58,7 @@ export function UserAddForm({
|
|||||||
minWidth: '250px',
|
minWidth: '250px',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Item key={ROLES.teamMember}>{formatMessage(labels.teamMember)}</Item>
|
<Item key={ROLES.teamMember}>{formatMessage(labels.member)}</Item>
|
||||||
<Item key={ROLES.teamViewOnly}>{formatMessage(labels.viewOnly)}</Item>
|
<Item key={ROLES.teamViewOnly}>{formatMessage(labels.viewOnly)}</Item>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</FormInput>
|
</FormInput>
|
||||||
@ -75,4 +75,4 @@ export function UserAddForm({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default UserAddForm;
|
export default TeamMemberEditForm;
|
||||||
|
@ -35,7 +35,7 @@ export function TeamMemberRemoveButton({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalTrigger>
|
<ModalTrigger>
|
||||||
<Button variant="quiet">
|
<Button>
|
||||||
<Icon>
|
<Icon>
|
||||||
<Icons.Close />
|
<Icons.Close />
|
||||||
</Icon>
|
</Icon>
|
||||||
|
@ -36,7 +36,7 @@ export function TeamMembersTable({
|
|||||||
return (
|
return (
|
||||||
allowEdit &&
|
allowEdit &&
|
||||||
row?.role !== ROLES.teamOwner &&
|
row?.role !== ROLES.teamOwner &&
|
||||||
user?.id !== row?.id && (
|
user?.id !== row?.user?.id && (
|
||||||
<>
|
<>
|
||||||
<TeamMemberEditButton teamId={teamId} userId={row?.user?.id} role={row?.role} />
|
<TeamMemberEditButton teamId={teamId} userId={row?.user?.id} role={row?.role} />
|
||||||
<TeamMemberRemoveButton
|
<TeamMemberRemoveButton
|
||||||
|
@ -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.cloudMode;
|
||||||
|
|
||||||
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 />
|
||||||
|
@ -28,6 +28,7 @@ export const labels = defineMessages({
|
|||||||
created: { id: 'label.created', defaultMessage: 'Created' },
|
created: { id: 'label.created', defaultMessage: 'Created' },
|
||||||
edit: { id: 'label.edit', defaultMessage: 'Edit' },
|
edit: { id: 'label.edit', defaultMessage: 'Edit' },
|
||||||
name: { id: 'label.name', defaultMessage: 'Name' },
|
name: { id: 'label.name', defaultMessage: 'Name' },
|
||||||
|
member: { id: 'label.member', defaultMessage: 'Member' },
|
||||||
members: { id: 'label.members', defaultMessage: 'Members' },
|
members: { id: 'label.members', defaultMessage: 'Members' },
|
||||||
accessCode: { id: 'label.access-code', defaultMessage: 'Access code' },
|
accessCode: { id: 'label.access-code', defaultMessage: 'Access code' },
|
||||||
teamId: { id: 'label.team-id', defaultMessage: 'Team ID' },
|
teamId: { id: 'label.team-id', defaultMessage: 'Team ID' },
|
||||||
|
Loading…
Reference in New Issue
Block a user