Merge pull request #2548 from umami-software/analytics

v2.10.1
This commit is contained in:
Mike Cao 2024-02-29 14:10:46 -08:00 committed by GitHub
commit 2795d0ecea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 25 additions and 38 deletions

View File

@ -33,23 +33,21 @@ export function WebsiteData({ websiteId, onSave }: { websiteId: string; onSave?:
return (
<>
{process.env.cloudMode && (
<ActionForm
label={formatMessage(labels.transferWebsite)}
description={formatMessage(messages.transferWebsite)}
>
<ModalTrigger disabled={!isTeamOwner}>
<Button variant="secondary" disabled={!isTeamOwner}>
{formatMessage(labels.transfer)}
</Button>
<Modal title={formatMessage(labels.transferWebsite)}>
{(close: () => void) => (
<WebsiteTransferForm websiteId={websiteId} onSave={handleSave} onClose={close} />
)}
</Modal>
</ModalTrigger>
</ActionForm>
)}
<ActionForm
label={formatMessage(labels.transferWebsite)}
description={formatMessage(messages.transferWebsite)}
>
<ModalTrigger disabled={!isTeamOwner}>
<Button variant="secondary" disabled={!isTeamOwner}>
{formatMessage(labels.transfer)}
</Button>
<Modal title={formatMessage(labels.transferWebsite)}>
{(close: () => void) => (
<WebsiteTransferForm websiteId={websiteId} onSave={handleSave} onClose={close} />
)}
</Modal>
</ModalTrigger>
</ActionForm>
<ActionForm
label={formatMessage(labels.resetWebsite)}
description={formatMessage(messages.resetWebsiteWarning)}

View File

@ -263,6 +263,13 @@ export function getOffsetDateRange(dateRange: DateRange, increment: number) {
const { unit: originalUnit } = parseDateValue(value) || {};
switch (originalUnit) {
case 'day':
return {
...dateRange,
startDate: addDays(startDate, increment),
endDate: addDays(endDate, increment),
offset: offset + increment,
};
case 'week':
return {
...dateRange,

View File

@ -44,8 +44,6 @@ export default async (
return unauthorized(res);
}
const { query, page, pageSize } = req.query;
const users = await getTeamUsers(
{
where: {
@ -63,11 +61,7 @@ export default async (
},
},
},
{
query,
page,
pageSize,
},
req.query,
);
return ok(res, users);

View File

@ -43,13 +43,7 @@ export default async (
return unauthorized(res);
}
const { page, query, pageSize } = req.query;
const websites = await getTeamWebsites(teamId, {
page,
query,
pageSize,
});
const websites = await getTeamWebsites(teamId, req.query);
return ok(res, websites);
}

View File

@ -39,13 +39,7 @@ export default async (
return unauthorized(res);
}
const { page, query, pageSize } = req.query;
const teams = await getUserTeams(userId as string, {
query,
page,
pageSize,
});
const teams = await getUserTeams(userId as string, req.query);
return ok(res, teams);
}