rename mixan to OPENPANEL!

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-03-11 13:40:46 +01:00
parent 6d4f9010d4
commit e6c0bc2ec8
201 changed files with 1193 additions and 1047 deletions

View File

@@ -3,12 +3,11 @@
import { api } from '@/app/_trpc/client';
import { pushModal, showConfirm } from '@/modals';
import { clipboard } from '@/utils/clipboard';
import type { IServiceClientWithProject } from '@openpanel/db';
import { MoreHorizontal } from 'lucide-react';
import { useRouter } from 'next/navigation';
import { toast } from 'sonner';
import type { IServiceClientWithProject } from '@mixan/db';
import { Button } from '../ui/button';
import {
DropdownMenu,

View File

@@ -1,8 +1,7 @@
import { formatDate } from '@/utils/date';
import type { IServiceClientWithProject } from '@openpanel/db';
import type { ColumnDef } from '@tanstack/react-table';
import type { IServiceClientWithProject } from '@mixan/db';
import { ClientActions } from './ClientActions';
export const columns: ColumnDef<IServiceClientWithProject>[] = [

View File

@@ -1,4 +1,4 @@
import { toDots } from '@mixan/common';
import { toDots } from '@openpanel/common';
import { Table, TableBody, TableCell, TableRow } from '../ui/table';

View File

@@ -11,14 +11,13 @@ import {
import { useEventValues } from '@/hooks/useEventValues';
import { useProfileProperties } from '@/hooks/useProfileProperties';
import { useProfileValues } from '@/hooks/useProfileValues';
import { XIcon } from 'lucide-react';
import type { Options as NuqsOptions } from 'nuqs';
import type {
IChartEventFilter,
IChartEventFilterOperator,
IChartEventFilterValue,
} from '@mixan/validation';
} from '@openpanel/validation';
import { XIcon } from 'lucide-react';
import type { Options as NuqsOptions } from 'nuqs';
export interface OverviewFiltersDrawerContentProps {
projectId: string;

View File

@@ -1,4 +1,4 @@
import { getLiveVisitors } from '@mixan/db';
import { getLiveVisitors } from '@openpanel/db';
import type { LiveCounterProps } from './live-counter';
import LiveCounter from './live-counter';

View File

@@ -1,4 +1,4 @@
import { getConversionEventNames } from '@mixan/db';
import { getConversionEventNames } from '@openpanel/db';
import type { OverviewLatestEventsProps } from './overview-latest-events';
import OverviewLatestEvents from './overview-latest-events';

View File

@@ -3,11 +3,10 @@
import { Fragment } from 'react';
import { api } from '@/app/_trpc/client';
import { cn } from '@/utils/cn';
import type { IChartInput } from '@openpanel/validation';
import { ChevronsUpDownIcon } from 'lucide-react';
import AnimateHeight from 'react-animate-height';
import type { IChartInput } from '@mixan/validation';
import { redisSub } from '../../../../../packages/redis';
import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip';
import { useOverviewOptions } from './useOverviewOptions';

View File

@@ -6,8 +6,7 @@ import { ChartSwitch } from '@/components/report/chart';
import { Widget, WidgetBody } from '@/components/Widget';
import { useEventQueryFilters } from '@/hooks/useEventQueryFilters';
import { cn } from '@/utils/cn';
import type { IChartInput } from '@mixan/validation';
import type { IChartInput } from '@openpanel/validation';
interface OverviewMetricsProps {
projectId: string;

View File

@@ -2,12 +2,11 @@
import { api } from '@/app/_trpc/client';
import { pushModal } from '@/modals';
import type { ShareOverview } from '@openpanel/db';
import { EyeIcon, Globe2Icon, LockIcon } from 'lucide-react';
import Link from 'next/link';
import { useRouter } from 'next/navigation';
import type { ShareOverview } from '@mixan/db';
import { Button } from '../ui/button';
import {
DropdownMenu,

View File

@@ -1,4 +1,4 @@
import { getConversionEventNames } from '@mixan/db';
import { getConversionEventNames } from '@openpanel/db';
import type { OverviewTopEventsProps } from './overview-top-events';
import OverviewTopEvents from './overview-top-events';

View File

@@ -1,3 +1,9 @@
import {
getDefaultIntervalByDates,
getDefaultIntervalByRange,
timeRanges,
} from '@openpanel/constants';
import { mapKeys } from '@openpanel/validation';
import {
parseAsBoolean,
parseAsInteger,
@@ -6,13 +12,6 @@ import {
useQueryState,
} from 'nuqs';
import {
getDefaultIntervalByDates,
getDefaultIntervalByRange,
timeRanges,
} from '@mixan/constants';
import { mapKeys } from '@mixan/validation';
const nuqsOptions = { history: 'push' } as const;
export function useOverviewOptions() {

View File

@@ -1,8 +1,7 @@
import { mapKeys } from '@openpanel/validation';
import type { IChartInput } from '@openpanel/validation';
import { parseAsStringEnum, useQueryState } from 'nuqs';
import { mapKeys } from '@mixan/validation';
import type { IChartInput } from '@mixan/validation';
export function useOverviewWidget<T extends string>(
key: string,
widgets: Record<

View File

@@ -1,12 +1,11 @@
'use client';
import { cn } from '@/utils/cn';
import type { IServiceProfile } from '@openpanel/db';
import { AvatarImage } from '@radix-ui/react-avatar';
import type { VariantProps } from 'class-variance-authority';
import { cva } from 'class-variance-authority';
import type { IServiceProfile } from '@mixan/db';
import { Avatar, AvatarFallback } from '../ui/avatar';
interface ProfileAvatarProps

View File

@@ -3,12 +3,11 @@
import { api } from '@/app/_trpc/client';
import { pushModal, showConfirm } from '@/modals';
import { clipboard } from '@/utils/clipboard';
import type { IServiceProject } from '@openpanel/db';
import { MoreHorizontal } from 'lucide-react';
import { useRouter } from 'next/navigation';
import { toast } from 'sonner';
import type { IServiceProject } from '@mixan/db';
import { Button } from '../ui/button';
import {
DropdownMenu,

View File

@@ -1,8 +1,8 @@
import { shortNumber } from '@/hooks/useNumerFormatter';
import Link from 'next/link';
import type { IServiceProject } from '@mixan/db';
import { chQuery } from '@mixan/db';
import type { IServiceProject } from '@openpanel/db';
import { chQuery } from '@openpanel/db';
import { ChartSSR } from '../chart-ssr';

View File

@@ -1,9 +1,8 @@
import { formatDate } from '@/utils/date';
import { IServiceProject } from '@openpanel/db';
import type { Project as IProject } from '@openpanel/db';
import type { ColumnDef } from '@tanstack/react-table';
import { IServiceProject } from '@mixan/db';
import type { Project as IProject } from '@mixan/db';
import { ProjectActions } from './ProjectActions';
export type Project = IProject;

View File

@@ -1,8 +1,7 @@
import { formatDate, formatDateTime } from '@/utils/date';
import type { IServiceReference } from '@openpanel/db';
import type { ColumnDef } from '@tanstack/react-table';
import type { IServiceReference } from '@mixan/db';
export const columns: ColumnDef<IServiceReference>[] = [
{
accessorKey: 'title',

View File

@@ -1,9 +1,8 @@
import { useDispatch, useSelector } from '@/redux';
import { chartTypes } from '@openpanel/constants';
import { objectToZodEnums } from '@openpanel/validation';
import { LineChartIcon } from 'lucide-react';
import { chartTypes } from '@mixan/constants';
import { objectToZodEnums } from '@mixan/validation';
import { Combobox } from '../ui/combobox';
import { changeChartType } from './reportSlice';

View File

@@ -1,11 +1,10 @@
import { useDispatch, useSelector } from '@/redux';
import { ClockIcon } from 'lucide-react';
import {
isHourIntervalEnabledByRange,
isMinuteIntervalEnabledByRange,
} from '@mixan/constants';
import type { IInterval } from '@mixan/validation';
} from '@openpanel/constants';
import type { IInterval } from '@openpanel/validation';
import { ClockIcon } from 'lucide-react';
import { Combobox } from '../ui/combobox';
import { changeInterval } from './reportSlice';

View File

@@ -1,9 +1,8 @@
import { useDispatch, useSelector } from '@/redux';
import { lineTypes } from '@openpanel/constants';
import { objectToZodEnums } from '@openpanel/validation';
import { Tv2Icon } from 'lucide-react';
import { lineTypes } from '@mixan/constants';
import { objectToZodEnums } from '@mixan/validation';
import { Combobox } from '../ui/combobox';
import { changeLineType } from './reportSlice';

View File

@@ -9,13 +9,12 @@ import {
import { useBreakpoint } from '@/hooks/useBreakpoint';
import { useDispatch, useSelector } from '@/redux';
import { cn } from '@/utils/cn';
import { timeRanges } from '@openpanel/constants';
import type { IChartRange } from '@openpanel/validation';
import { endOfDay, format, startOfDay } from 'date-fns';
import { CalendarIcon, ChevronsUpDownIcon } from 'lucide-react';
import type { SelectRangeEventHandler } from 'react-day-picker';
import { timeRanges } from '@mixan/constants';
import type { IChartRange } from '@mixan/validation';
import type { ExtendedComboboxProps } from '../ui/combobox';
import { ToggleGroup, ToggleGroupItem } from '../ui/toggle-group';
import { changeDates, changeEndDate, changeStartDate } from './reportSlice';

View File

@@ -1,8 +1,7 @@
'use client';
import { api } from '@/app/_trpc/client';
import type { IChartInput } from '@mixan/validation';
import type { IChartInput } from '@openpanel/validation';
import { ChartEmpty } from './ChartEmpty';
import { ReportAreaChart } from './ReportAreaChart';

View File

@@ -10,8 +10,7 @@ import {
useState,
} from 'react';
import type { IChartSerie } from '@/server/api/routers/chart';
import type { IChartInput } from '@mixan/validation';
import type { IChartInput } from '@openpanel/validation';
import { ChartLoading } from './ChartLoading';
import { MetricCardLoading } from './MetricCard';

View File

@@ -4,11 +4,10 @@ import type { IChartData } from '@/app/_trpc/client';
import { ColorSquare } from '@/components/ColorSquare';
import { fancyMinutes, useNumber } from '@/hooks/useNumerFormatter';
import { theme } from '@/utils/theme';
import type { IChartMetric } from '@openpanel/validation';
import AutoSizer from 'react-virtualized-auto-sizer';
import { Area, AreaChart } from 'recharts';
import type { IChartMetric } from '@mixan/validation';
import {
getDiffIndicator,
PreviousDiffIndicatorText,

View File

@@ -5,6 +5,7 @@ import { useNumber } from '@/hooks/useNumerFormatter';
import { useRechartDataModel } from '@/hooks/useRechartDataModel';
import { useVisibleSeries } from '@/hooks/useVisibleSeries';
import { getChartColor } from '@/utils/theme';
import type { IChartLineType, IInterval } from '@openpanel/validation';
import {
Area,
AreaChart,
@@ -14,8 +15,6 @@ import {
YAxis,
} from 'recharts';
import type { IChartLineType, IInterval } from '@mixan/validation';
import { getYAxisWidth } from './chart-utils';
import { useChartContext } from './ChartProvider';
import { ReportChartTooltip } from './ReportChartTooltip';

View File

@@ -6,8 +6,7 @@ import { Progress } from '@/components/ui/progress';
import { useNumber } from '@/hooks/useNumerFormatter';
import { cn } from '@/utils/cn';
import { getChartColor } from '@/utils/theme';
import { NOT_SET_VALUE } from '@mixan/constants';
import { NOT_SET_VALUE } from '@openpanel/constants';
import { PreviousDiffIndicatorText } from '../PreviousDiffIndicator';
import { useChartContext } from './ChartProvider';

View File

@@ -5,10 +5,9 @@ import { useNumber } from '@/hooks/useNumerFormatter';
import { useRechartDataModel } from '@/hooks/useRechartDataModel';
import { useVisibleSeries } from '@/hooks/useVisibleSeries';
import { getChartColor, theme } from '@/utils/theme';
import type { IInterval } from '@openpanel/validation';
import { Bar, BarChart, CartesianGrid, Tooltip, XAxis, YAxis } from 'recharts';
import type { IInterval } from '@mixan/validation';
import { getYAxisWidth } from './chart-utils';
import { useChartContext } from './ChartProvider';
import { ReportChartTooltip } from './ReportChartTooltip';

View File

@@ -7,6 +7,8 @@ import { useNumber } from '@/hooks/useNumerFormatter';
import { useRechartDataModel } from '@/hooks/useRechartDataModel';
import { useVisibleSeries } from '@/hooks/useVisibleSeries';
import { getChartColor } from '@/utils/theme';
import type { IServiceReference } from '@openpanel/db';
import type { IChartLineType, IInterval } from '@openpanel/validation';
import {
CartesianGrid,
Line,
@@ -17,9 +19,6 @@ import {
YAxis,
} from 'recharts';
import type { IServiceReference } from '@mixan/db';
import type { IChartLineType, IInterval } from '@mixan/validation';
import { getYAxisWidth } from './chart-utils';
import { useChartContext } from './ChartProvider';
import { ReportChartTooltip } from './ReportChartTooltip';

View File

@@ -1,4 +1,5 @@
import { useMemo } from 'react';
import { NOT_SET_VALUE } from '@openpanel/constants';
import type { LucideIcon, LucideProps } from 'lucide-react';
import {
ActivityIcon,
@@ -14,8 +15,6 @@ import {
TabletIcon,
} from 'lucide-react';
import { NOT_SET_VALUE } from '@mixan/constants';
interface SerieIconProps extends LucideProps {
name: string;
}

View File

@@ -1,6 +1,6 @@
'use client';
import type { IChartInput } from '@mixan/validation';
import type { IChartInput } from '@openpanel/validation';
import { Funnel } from '../funnel';
import { Chart } from './Chart';

View File

@@ -2,8 +2,7 @@
import type { RouterOutputs } from '@/app/_trpc/client';
import { api } from '@/app/_trpc/client';
import type { IChartInput } from '@mixan/validation';
import type { IChartInput } from '@openpanel/validation';
import { ChartEmpty } from '../chart/ChartEmpty';
import { withChartProivder } from '../chart/ChartProvider';

View File

@@ -1,15 +1,11 @@
import { start } from 'repl';
import { createSlice } from '@reduxjs/toolkit';
import type { PayloadAction } from '@reduxjs/toolkit';
import { isSameDay, isSameMonth } from 'date-fns';
import {
alphabetIds,
getDefaultIntervalByDates,
getDefaultIntervalByRange,
isHourIntervalEnabledByRange,
isMinuteIntervalEnabledByRange,
} from '@mixan/constants';
} from '@openpanel/constants';
import type {
IChartBreakdown,
IChartEvent,
@@ -18,7 +14,10 @@ import type {
IChartRange,
IChartType,
IInterval,
} from '@mixan/validation';
} from '@openpanel/validation';
import { createSlice } from '@reduxjs/toolkit';
import type { PayloadAction } from '@reduxjs/toolkit';
import { isSameDay, isSameMonth } from 'date-fns';
type InitialState = IChartInput & {
dirty: boolean;

View File

@@ -3,10 +3,9 @@ import { Combobox } from '@/components/ui/combobox';
import { useAppParams } from '@/hooks/useAppParams';
import { useDispatch } from '@/redux';
import { cn } from '@/utils/cn';
import type { IChartEvent } from '@openpanel/validation';
import { DatabaseIcon } from 'lucide-react';
import type { IChartEvent } from '@mixan/validation';
import { changeEvent } from '../reportSlice';
interface EventPropertiesComboboxProps {

View File

@@ -5,10 +5,9 @@ import { ColorSquare } from '@/components/ColorSquare';
import { Combobox } from '@/components/ui/combobox';
import { useAppParams } from '@/hooks/useAppParams';
import { useDispatch, useSelector } from '@/redux';
import type { IChartBreakdown } from '@openpanel/validation';
import { SplitIcon } from 'lucide-react';
import type { IChartBreakdown } from '@mixan/validation';
import { addBreakdown, changeBreakdown, removeBreakdown } from '../reportSlice';
import { ReportBreakdownMore } from './ReportBreakdownMore';
import type { ReportEventMoreProps } from './ReportEventMore';

View File

@@ -9,10 +9,9 @@ import { useAppParams } from '@/hooks/useAppParams';
import { useDebounceFn } from '@/hooks/useDebounceFn';
import { useEventNames } from '@/hooks/useEventNames';
import { useDispatch, useSelector } from '@/redux';
import type { IChartEvent } from '@openpanel/validation';
import { GanttChart, GanttChartIcon, Users } from 'lucide-react';
import type { IChartEvent } from '@mixan/validation';
import {
addEvent,
changeEvent,

View File

@@ -7,15 +7,14 @@ import { RenderDots } from '@/components/ui/RenderDots';
import { useAppParams } from '@/hooks/useAppParams';
import { useMappings } from '@/hooks/useMappings';
import { useDispatch } from '@/redux';
import { SlidersHorizontal, Trash } from 'lucide-react';
import { operators } from '@mixan/constants';
import { operators } from '@openpanel/constants';
import type {
IChartEvent,
IChartEventFilterOperator,
IChartEventFilterValue,
} from '@mixan/validation';
import { mapKeys } from '@mixan/validation';
} from '@openpanel/validation';
import { mapKeys } from '@openpanel/validation';
import { SlidersHorizontal, Trash } from 'lucide-react';
import { changeEvent } from '../../reportSlice';

View File

@@ -2,10 +2,9 @@ import { api } from '@/app/_trpc/client';
import { Combobox } from '@/components/ui/combobox';
import { useAppParams } from '@/hooks/useAppParams';
import { useDispatch } from '@/redux';
import type { IChartEvent } from '@openpanel/validation';
import { FilterIcon } from 'lucide-react';
import type { IChartEvent } from '@mixan/validation';
import { changeEvent } from '../../reportSlice';
interface FiltersComboboxProps {

View File

@@ -1,4 +1,4 @@
import type { IChartEvent } from '@mixan/validation';
import type { IChartEvent } from '@openpanel/validation';
import { FilterItem } from './FilterItem';