mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 12:05:41 +01:00
Compare commits
No commits in common. "78c1fd8283d1150a09830d12986078f8681ed318" and "f06ef6fbc9743aba3ea593cb8123912b60962752" have entirely different histories.
78c1fd8283
...
f06ef6fbc9
2 changed files with 9 additions and 19 deletions
|
|
@ -55,9 +55,7 @@ export function SettingsLayout({ children }: { children: ReactNode }) {
|
|||
allowMinimize={false}
|
||||
/>
|
||||
</Column>
|
||||
<Column gap="6" margin="2">
|
||||
<PageBody>{children}</PageBody>
|
||||
</Column>
|
||||
<PageBody gap="6">{children}</PageBody>
|
||||
</Grid>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,33 +100,25 @@ export async function getQueryFilters(
|
|||
await setWebsiteDate(websiteId, dateRange);
|
||||
|
||||
if (params.segment) {
|
||||
const segmentParams = (await getWebsiteSegment(websiteId, params.segment))
|
||||
?.parameters as Record<string, any>;
|
||||
|
||||
Object.assign(filters, segmentParams.filters);
|
||||
Object.assign(filters, (await getWebsiteSegment(websiteId, params.segment))?.parameters);
|
||||
}
|
||||
|
||||
if (params.cohort) {
|
||||
const cohortParams = (await getWebsiteSegment(websiteId, params.cohort))
|
||||
const cohortFilters = (await getWebsiteSegment(websiteId, params.cohort))
|
||||
?.parameters as Record<string, any>;
|
||||
|
||||
// convert dateRange to startDate and endDate
|
||||
if (cohortParams.dateRange) {
|
||||
const { startDate, endDate } = parseDateRange(cohortParams.dateRange);
|
||||
cohortParams.startDate = startDate;
|
||||
cohortParams.endDate = endDate;
|
||||
delete cohortParams.dateRange;
|
||||
}
|
||||
|
||||
if (cohortParams.filters) {
|
||||
Object.assign(cohortParams, cohortParams.filters);
|
||||
delete cohortParams.filters;
|
||||
if (cohortFilters.dateRange) {
|
||||
const { startDate, endDate } = parseDateRange(cohortFilters.dateRange);
|
||||
cohortFilters.startDate = startDate;
|
||||
cohortFilters.endDate = endDate;
|
||||
delete cohortFilters.dateRange;
|
||||
}
|
||||
|
||||
Object.assign(
|
||||
filters,
|
||||
Object.fromEntries(
|
||||
Object.entries(cohortParams || {}).map(([key, value]) =>
|
||||
Object.entries(cohortFilters || {}).map(([key, value]) =>
|
||||
key === 'startDate' || key === 'endDate'
|
||||
? [`cohort_${key}`, new Date(value)]
|
||||
: [`cohort_${key}`, value],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue