Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.10.1 #2548

Merged
merged 17 commits into from
Feb 29, 2024
Merged

v2.10.1 #2548

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 15 additions & 17 deletions src/app/(main)/settings/websites/[websiteId]/WebsiteData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
Expand Down
7 changes: 7 additions & 0 deletions src/lib/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 1 addition & 7 deletions src/pages/api/teams/[teamId]/users/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ export default async (
return unauthorized(res);
}

const { query, page, pageSize } = req.query;

const users = await getTeamUsers(
{
where: {
Expand All @@ -63,11 +61,7 @@ export default async (
},
},
},
{
query,
page,
pageSize,
},
req.query,
);

return ok(res, users);
Expand Down
8 changes: 1 addition & 7 deletions src/pages/api/teams/[teamId]/websites/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
8 changes: 1 addition & 7 deletions src/pages/api/users/[userId]/teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down