feat: dashboard v2, esm, upgrades (#211)
* esm * wip * wip * wip * wip * wip * wip * subscription notice * wip * wip * wip * fix envs * fix: update docker build * fix * esm/types * delete dashboard :D * add patches to dockerfiles * update packages + catalogs + ts * wip * remove native libs * ts * improvements * fix redirects and fetching session * try fix favicon * fixes * fix * order and resize reportds within a dashboard * improvements * wip * added userjot to dashboard * fix * add op * wip * different cache key * improve date picker * fix table * event details loading * redo onboarding completely * fix login * fix * fix * extend session, billing and improve bars * fix * reduce price on 10M
This commit is contained in:
committed by
GitHub
parent
436e81ecc9
commit
81a7e5d62e
@@ -14,7 +14,7 @@ import type {
|
||||
} from '@openpanel/validation';
|
||||
|
||||
import { db } from '../prisma-client';
|
||||
import type { Report as DbReport } from '../prisma-client';
|
||||
import type { Report as DbReport, ReportLayout } from '../prisma-client';
|
||||
|
||||
export type IServiceReport = Awaited<ReturnType<typeof getReportById>>;
|
||||
|
||||
@@ -46,8 +46,8 @@ export function transformReportEvent(
|
||||
}
|
||||
|
||||
export function transformReport(
|
||||
report: DbReport,
|
||||
): IChartProps & { id: string } {
|
||||
report: DbReport & { layout?: ReportLayout | null },
|
||||
): IChartProps & { id: string; layout?: ReportLayout | null } {
|
||||
return {
|
||||
id: report.id,
|
||||
projectId: report.projectId,
|
||||
@@ -68,6 +68,7 @@ export function transformReport(
|
||||
criteria: (report.criteria as ICriteria) ?? undefined,
|
||||
funnelGroup: report.funnelGroup ?? undefined,
|
||||
funnelWindow: report.funnelWindow ?? undefined,
|
||||
layout: report.layout ?? undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -77,6 +78,9 @@ export function getReportsByDashboardId(dashboardId: string) {
|
||||
where: {
|
||||
dashboardId,
|
||||
},
|
||||
include: {
|
||||
layout: true,
|
||||
},
|
||||
})
|
||||
.then((reports) => reports.map(transformReport));
|
||||
}
|
||||
@@ -86,6 +90,9 @@ export async function getReportById(id: string) {
|
||||
where: {
|
||||
id,
|
||||
},
|
||||
include: {
|
||||
layout: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!report) {
|
||||
|
||||
Reference in New Issue
Block a user