mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-22 09:57:00 +01:00
commit
2795d0ecea
@ -33,23 +33,21 @@ export function WebsiteData({ websiteId, onSave }: { websiteId: string; onSave?:
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{process.env.cloudMode && (
|
<ActionForm
|
||||||
<ActionForm
|
label={formatMessage(labels.transferWebsite)}
|
||||||
label={formatMessage(labels.transferWebsite)}
|
description={formatMessage(messages.transferWebsite)}
|
||||||
description={formatMessage(messages.transferWebsite)}
|
>
|
||||||
>
|
<ModalTrigger disabled={!isTeamOwner}>
|
||||||
<ModalTrigger disabled={!isTeamOwner}>
|
<Button variant="secondary" disabled={!isTeamOwner}>
|
||||||
<Button variant="secondary" disabled={!isTeamOwner}>
|
{formatMessage(labels.transfer)}
|
||||||
{formatMessage(labels.transfer)}
|
</Button>
|
||||||
</Button>
|
<Modal title={formatMessage(labels.transferWebsite)}>
|
||||||
<Modal title={formatMessage(labels.transferWebsite)}>
|
{(close: () => void) => (
|
||||||
{(close: () => void) => (
|
<WebsiteTransferForm websiteId={websiteId} onSave={handleSave} onClose={close} />
|
||||||
<WebsiteTransferForm websiteId={websiteId} onSave={handleSave} onClose={close} />
|
)}
|
||||||
)}
|
</Modal>
|
||||||
</Modal>
|
</ModalTrigger>
|
||||||
</ModalTrigger>
|
</ActionForm>
|
||||||
</ActionForm>
|
|
||||||
)}
|
|
||||||
<ActionForm
|
<ActionForm
|
||||||
label={formatMessage(labels.resetWebsite)}
|
label={formatMessage(labels.resetWebsite)}
|
||||||
description={formatMessage(messages.resetWebsiteWarning)}
|
description={formatMessage(messages.resetWebsiteWarning)}
|
||||||
|
@ -263,6 +263,13 @@ export function getOffsetDateRange(dateRange: DateRange, increment: number) {
|
|||||||
const { unit: originalUnit } = parseDateValue(value) || {};
|
const { unit: originalUnit } = parseDateValue(value) || {};
|
||||||
|
|
||||||
switch (originalUnit) {
|
switch (originalUnit) {
|
||||||
|
case 'day':
|
||||||
|
return {
|
||||||
|
...dateRange,
|
||||||
|
startDate: addDays(startDate, increment),
|
||||||
|
endDate: addDays(endDate, increment),
|
||||||
|
offset: offset + increment,
|
||||||
|
};
|
||||||
case 'week':
|
case 'week':
|
||||||
return {
|
return {
|
||||||
...dateRange,
|
...dateRange,
|
||||||
|
@ -44,8 +44,6 @@ export default async (
|
|||||||
return unauthorized(res);
|
return unauthorized(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
const { query, page, pageSize } = req.query;
|
|
||||||
|
|
||||||
const users = await getTeamUsers(
|
const users = await getTeamUsers(
|
||||||
{
|
{
|
||||||
where: {
|
where: {
|
||||||
@ -63,11 +61,7 @@ export default async (
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
req.query,
|
||||||
query,
|
|
||||||
page,
|
|
||||||
pageSize,
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return ok(res, users);
|
return ok(res, users);
|
||||||
|
@ -43,13 +43,7 @@ export default async (
|
|||||||
return unauthorized(res);
|
return unauthorized(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
const { page, query, pageSize } = req.query;
|
const websites = await getTeamWebsites(teamId, req.query);
|
||||||
|
|
||||||
const websites = await getTeamWebsites(teamId, {
|
|
||||||
page,
|
|
||||||
query,
|
|
||||||
pageSize,
|
|
||||||
});
|
|
||||||
|
|
||||||
return ok(res, websites);
|
return ok(res, websites);
|
||||||
}
|
}
|
||||||
|
@ -39,13 +39,7 @@ export default async (
|
|||||||
return unauthorized(res);
|
return unauthorized(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
const { page, query, pageSize } = req.query;
|
const teams = await getUserTeams(userId as string, req.query);
|
||||||
|
|
||||||
const teams = await getUserTeams(userId as string, {
|
|
||||||
query,
|
|
||||||
page,
|
|
||||||
pageSize,
|
|
||||||
});
|
|
||||||
|
|
||||||
return ok(res, teams);
|
return ok(res, teams);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user