mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
Fixed 'use client' usage.
This commit is contained in:
parent
be5592446a
commit
f7151a880e
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { Loading } from 'react-basics';
|
||||
import Script from 'next/script';
|
||||
import { usePathname } from 'next/navigation';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { Icon, Text } from 'react-basics';
|
||||
import Link from 'next/link';
|
||||
import classNames from 'classnames';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { useEffect, useCallback, useState } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { Button } from 'react-basics';
|
||||
|
6
src/app/(main)/console/ConsolePage.tsx
Normal file
6
src/app/(main)/console/ConsolePage.tsx
Normal file
@ -0,0 +1,6 @@
|
||||
'use client';
|
||||
import TestConsole from './TestConsole';
|
||||
|
||||
export default function ConsolePage({ websiteId }) {
|
||||
return <TestConsole websiteId={websiteId} />;
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
.container {
|
||||
display: grid;
|
||||
gap: 30px;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.actions {
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { Button } from 'react-basics';
|
||||
import Head from 'next/head';
|
||||
import Link from 'next/link';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import TestConsole from '../TestConsole';
|
||||
import { Metadata } from 'next';
|
||||
import ConsolePage from '../ConsolePage';
|
||||
|
||||
async function getEnabled() {
|
||||
return !!process.env.ENABLE_TEST_CONSOLE;
|
||||
@ -12,7 +12,7 @@ export default async function ({ params: { websiteId } }) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <TestConsole websiteId={websiteId?.[0]} />;
|
||||
return <ConsolePage websiteId={websiteId?.[0]} />;
|
||||
}
|
||||
|
||||
export const metadata: Metadata = {
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { useState, useMemo } from 'react';
|
||||
import { DragDropContext, Draggable, Droppable } from 'react-beautiful-dnd';
|
||||
import classNames from 'classnames';
|
||||
|
@ -10,7 +10,7 @@ import { useMessages, useLocale, useTeamUrl, useWebsites } from 'components/hook
|
||||
import useDashboard from 'store/dashboard';
|
||||
import LinkButton from 'components/common/LinkButton';
|
||||
|
||||
export function Dashboard() {
|
||||
export function DashboardPage() {
|
||||
const { formatMessage, labels, messages } = useMessages();
|
||||
const { teamId, renderTeamUrl } = useTeamUrl();
|
||||
const { showCharts, editing } = useDashboard();
|
||||
@ -68,4 +68,4 @@ export function Dashboard() {
|
||||
);
|
||||
}
|
||||
|
||||
export default Dashboard;
|
||||
export default DashboardPage;
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { TooltipPopup, Icon, Text, Flexbox, Button } from 'react-basics';
|
||||
import Icons from 'components/icons';
|
||||
import { saveDashboard } from 'store/dashboard';
|
||||
|
@ -1,8 +1,8 @@
|
||||
import Dashboard from 'app/(main)/dashboard/Dashboard';
|
||||
import DashboardPage from './DashboardPage';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
export default function () {
|
||||
return <Dashboard />;
|
||||
return <DashboardPage />;
|
||||
}
|
||||
|
||||
export const metadata: Metadata = {
|
||||
|
@ -19,3 +19,15 @@
|
||||
height: calc(100vh - 60px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: 1320px;
|
||||
margin: 0 auto;
|
||||
padding: 0 20px;
|
||||
min-height: calc(100vh - 60px);
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
'use client';
|
||||
import App from './App';
|
||||
import NavBar from './NavBar';
|
||||
import Page from 'components/layout/Page';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import DateFilter from 'components/input/DateFilter';
|
||||
import { Button, Flexbox } from 'react-basics';
|
||||
import { useDateRange, useMessages } from 'components/hooks';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { useState } from 'react';
|
||||
import { Button, Dropdown, Item, Flexbox } from 'react-basics';
|
||||
import { useLocale, useMessages } from 'components/hooks';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { Button, Icon, Text, useToasts, ModalTrigger, Modal } from 'react-basics';
|
||||
import PasswordEditForm from 'app/(main)/profile/PasswordEditForm';
|
||||
import Icons from 'components/icons';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { useRef } from 'react';
|
||||
import { Form, FormRow, FormInput, FormButtons, PasswordField, Button } from 'react-basics';
|
||||
import { useApi, useMessages } from 'components/hooks';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import PageHeader from 'components/layout/PageHeader';
|
||||
import { useMessages } from 'components/hooks';
|
||||
|
||||
|
13
src/app/(main)/profile/ProfilePage.tsx
Normal file
13
src/app/(main)/profile/ProfilePage.tsx
Normal file
@ -0,0 +1,13 @@
|
||||
'use client';
|
||||
import ProfileHeader from './ProfileHeader';
|
||||
import ProfileSettings from './ProfileSettings';
|
||||
import styles from './ProfilePage.module.css';
|
||||
|
||||
export default function () {
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<ProfileHeader />
|
||||
<ProfileSettings />
|
||||
</div>
|
||||
);
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { Form, FormRow } from 'react-basics';
|
||||
import TimezoneSetting from 'app/(main)/profile/TimezoneSetting';
|
||||
import DateRangeSetting from 'app/(main)/profile/DateRangeSetting';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import classNames from 'classnames';
|
||||
import { Button, Icon } from 'react-basics';
|
||||
import { useTheme } from 'components/hooks';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { useState } from 'react';
|
||||
import { Dropdown, Item, Button, Flexbox } from 'react-basics';
|
||||
import { listTimeZones } from 'timezone-support';
|
||||
|
@ -1,15 +1,8 @@
|
||||
import ProfileHeader from './ProfileHeader';
|
||||
import ProfileSettings from './ProfileSettings';
|
||||
import { Metadata } from 'next';
|
||||
import styles from './page.module.css';
|
||||
import ProfilePage from './ProfilePage';
|
||||
|
||||
export default function () {
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<ProfileHeader />
|
||||
<ProfileSettings />
|
||||
</div>
|
||||
);
|
||||
return <ProfilePage />;
|
||||
}
|
||||
|
||||
export const metadata: Metadata = {
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { Button, Icon, Icons, Modal, ModalTrigger, Text } from 'react-basics';
|
||||
import { useApi, useMessages } from 'components/hooks';
|
||||
import { touch } from 'store/modified';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { useReports } from 'components/hooks';
|
||||
import ReportsTable from './ReportsTable';
|
||||
import DataTable from 'components/common/DataTable';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import PageHeader from 'components/layout/PageHeader';
|
||||
import { Icon, Icons, Text } from 'react-basics';
|
||||
import { useMessages, useTeamUrl } from 'components/hooks';
|
||||
|
15
src/app/(main)/reports/ReportsPage.tsx
Normal file
15
src/app/(main)/reports/ReportsPage.tsx
Normal file
@ -0,0 +1,15 @@
|
||||
'use client';
|
||||
import ReportsHeader from './ReportsHeader';
|
||||
import ReportsDataTable from './ReportsDataTable';
|
||||
|
||||
export default function ReportsPage({ teamId }: { teamId: string }) {
|
||||
return (
|
||||
<>
|
||||
<ReportsHeader />
|
||||
<ReportsDataTable teamId={teamId} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
export const metadata = {
|
||||
title: 'Reports | Umami',
|
||||
};
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { GridColumn, GridTable, Icon, Icons, Text, useBreakpoint } from 'react-basics';
|
||||
import LinkButton from 'components/common/LinkButton';
|
||||
import { useMessages, useLogin, useTeamUrl } from 'components/hooks';
|
||||
|
@ -1,11 +1,10 @@
|
||||
'use client';
|
||||
import { useContext } from 'react';
|
||||
import { FormRow } from 'react-basics';
|
||||
import { parseDateRange } from 'lib/date';
|
||||
import DateFilter from 'components/input/DateFilter';
|
||||
import WebsiteSelect from 'components/input/WebsiteSelect';
|
||||
import { useMessages, useTeamUrl } from 'components/hooks';
|
||||
import { ReportContext } from './Report';
|
||||
import { ReportContext } from './ReportPage';
|
||||
|
||||
export interface BaseParametersProps {
|
||||
showWebsiteSelect?: boolean;
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { useState } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { REPORT_PARAMETERS } from 'lib/constants';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { Form, FormRow, Menu, Item } from 'react-basics';
|
||||
import { useMessages } from 'components/hooks';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { useState, useMemo } from 'react';
|
||||
import { Form, FormRow, Item, Flexbox, Dropdown, Button } from 'react-basics';
|
||||
import { useMessages, useFilters, useFormat, useLocale } from 'components/hooks';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { Menu, Item, Form, FormRow } from 'react-basics';
|
||||
import { useMessages } from 'components/hooks';
|
||||
import styles from './FieldSelectForm.module.css';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { useState } from 'react';
|
||||
import { Loading } from 'react-basics';
|
||||
import { subDays } from 'date-fns';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { ReactNode } from 'react';
|
||||
import { Icon, TooltipPopup } from 'react-basics';
|
||||
import Icons from 'components/icons';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { CSSProperties, ReactNode } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import styles from './PopupForm.module.css';
|
||||
|
@ -1,7 +1,6 @@
|
||||
'use client';
|
||||
import styles from './ReportBody.module.css';
|
||||
import { useContext } from 'react';
|
||||
import { ReportContext } from './Report';
|
||||
import { ReportContext } from './ReportPage';
|
||||
|
||||
export function ReportBody({ children }) {
|
||||
const { report } = useContext(ReportContext);
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import FunnelReport from '../funnel/FunnelReport';
|
||||
import EventDataReport from '../event-data/EventDataReport';
|
||||
import InsightsReport from '../insights/InsightsReport';
|
||||
|
@ -1,8 +1,7 @@
|
||||
'use client';
|
||||
import { useContext } from 'react';
|
||||
import { Icon, LoadingButton, InlineEditField, useToasts } from 'react-basics';
|
||||
import { useMessages, useApi, useNavigation, useTeamUrl } from 'components/hooks';
|
||||
import { ReportContext } from './Report';
|
||||
import { ReportContext } from './ReportPage';
|
||||
import styles from './ReportHeader.module.css';
|
||||
import { REPORT_TYPES } from 'lib/constants';
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
'use client';
|
||||
import styles from './ReportMenu.module.css';
|
||||
import { useContext } from 'react';
|
||||
import { ReportContext } from './Report';
|
||||
import { ReportContext } from './ReportPage';
|
||||
|
||||
export function ReportMenu({ children }) {
|
||||
const { report } = useContext(ReportContext);
|
||||
|
@ -1,20 +1,22 @@
|
||||
'use client';
|
||||
import { createContext, ReactNode } from 'react';
|
||||
import { Loading } from 'react-basics';
|
||||
import classNames from 'classnames';
|
||||
import { useReport } from 'components/hooks';
|
||||
import styles from './Report.module.css';
|
||||
import classNames from 'classnames';
|
||||
|
||||
export const ReportContext = createContext(null);
|
||||
|
||||
export interface ReportProps {
|
||||
export function ReportPage({
|
||||
reportId,
|
||||
defaultParameters,
|
||||
children,
|
||||
className,
|
||||
}: {
|
||||
reportId: string;
|
||||
defaultParameters: { [key: string]: any };
|
||||
children: ReactNode;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function Report({ reportId, defaultParameters, children, className }: ReportProps) {
|
||||
}) {
|
||||
const report = useReport(reportId, defaultParameters);
|
||||
|
||||
if (!report) {
|
||||
@ -28,4 +30,4 @@ export function Report({ reportId, defaultParameters, children, className }: Rep
|
||||
);
|
||||
}
|
||||
|
||||
export default Report;
|
||||
export default ReportPage;
|
6
src/app/(main)/reports/create/ReportCreatePage.tsx
Normal file
6
src/app/(main)/reports/create/ReportCreatePage.tsx
Normal file
@ -0,0 +1,6 @@
|
||||
'use client';
|
||||
import ReportTemplates from './ReportTemplates';
|
||||
|
||||
export default function ReportCreatePage() {
|
||||
return <ReportTemplates />;
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import Link from 'next/link';
|
||||
import { Button, Icons, Text, Icon } from 'react-basics';
|
||||
import PageHeader from 'components/layout/PageHeader';
|
||||
@ -8,30 +7,6 @@ import Magnet from 'assets/magnet.svg';
|
||||
import styles from './ReportTemplates.module.css';
|
||||
import { useMessages, useTeamUrl } from 'components/hooks';
|
||||
|
||||
function ReportItem({ title, description, url, icon }) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
return (
|
||||
<div className={styles.report}>
|
||||
<div className={styles.title}>
|
||||
<Icon size="lg">{icon}</Icon>
|
||||
<Text>{title}</Text>
|
||||
</div>
|
||||
<div className={styles.description}>{description}</div>
|
||||
<div className={styles.buttons}>
|
||||
<Link href={url}>
|
||||
<Button variant="primary">
|
||||
<Icon>
|
||||
<Icons.Plus />
|
||||
</Icon>
|
||||
<Text>{formatMessage(labels.create)}</Text>
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function ReportTemplates({ showHeader = true }: { showHeader?: boolean }) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { renderTeamUrl } = useTeamUrl();
|
||||
@ -71,4 +46,28 @@ export function ReportTemplates({ showHeader = true }: { showHeader?: boolean })
|
||||
);
|
||||
}
|
||||
|
||||
function ReportItem({ title, description, url, icon }) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
return (
|
||||
<div className={styles.report}>
|
||||
<div className={styles.title}>
|
||||
<Icon size="lg">{icon}</Icon>
|
||||
<Text>{title}</Text>
|
||||
</div>
|
||||
<div className={styles.description}>{description}</div>
|
||||
<div className={styles.buttons}>
|
||||
<Link href={url}>
|
||||
<Button variant="primary">
|
||||
<Icon>
|
||||
<Icons.Plus />
|
||||
</Icon>
|
||||
<Text>{formatMessage(labels.create)}</Text>
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default ReportTemplates;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import ReportTemplates from './ReportTemplates';
|
||||
import ReportCreatePage from './ReportCreatePage';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
export default function ReportsCreatePage() {
|
||||
return <ReportTemplates />;
|
||||
export default function () {
|
||||
return <ReportCreatePage />;
|
||||
}
|
||||
|
||||
export const metadata: Metadata = {
|
||||
|
@ -1,11 +1,10 @@
|
||||
'use client';
|
||||
import { useContext } from 'react';
|
||||
import { Form, FormRow, FormButtons, SubmitButton, PopupTrigger, Icon, Popup } from 'react-basics';
|
||||
import Empty from 'components/common/Empty';
|
||||
import Icons from 'components/icons';
|
||||
import { useApi, useMessages } from 'components/hooks';
|
||||
import { DATA_TYPES, REPORT_PARAMETERS } from 'lib/constants';
|
||||
import { ReportContext } from '../[reportId]/Report';
|
||||
import { ReportContext } from '../[reportId]/ReportPage';
|
||||
import FieldAddForm from '../[reportId]/FieldAddForm';
|
||||
import ParameterList from '../[reportId]/ParameterList';
|
||||
import BaseParameters from '../[reportId]/BaseParameters';
|
||||
|
@ -1,5 +1,4 @@
|
||||
'use client';
|
||||
import Report from '../[reportId]/Report';
|
||||
import ReportPage from '../[reportId]/ReportPage';
|
||||
import ReportHeader from '../[reportId]/ReportHeader';
|
||||
import ReportMenu from '../[reportId]/ReportMenu';
|
||||
import ReportBody from '../[reportId]/ReportBody';
|
||||
@ -14,7 +13,7 @@ const defaultParameters = {
|
||||
|
||||
export default function EventDataReport({ reportId }: { reportId?: string }) {
|
||||
return (
|
||||
<Report reportId={reportId} defaultParameters={defaultParameters}>
|
||||
<ReportPage reportId={reportId} defaultParameters={defaultParameters}>
|
||||
<ReportHeader icon={<Nodes />} />
|
||||
<ReportMenu>
|
||||
<EventDataParameters />
|
||||
@ -22,6 +21,6 @@ export default function EventDataReport({ reportId }: { reportId?: string }) {
|
||||
<ReportBody>
|
||||
<EventDataTable />
|
||||
</ReportBody>
|
||||
</Report>
|
||||
</ReportPage>
|
||||
);
|
||||
}
|
||||
|
@ -0,0 +1,6 @@
|
||||
'use client';
|
||||
import EventDataReport from './EventDataReport';
|
||||
|
||||
export default function EventDataReportPage() {
|
||||
return <EventDataReport />;
|
||||
}
|
@ -1,8 +1,7 @@
|
||||
'use client';
|
||||
import { useContext } from 'react';
|
||||
import { GridTable, GridColumn } from 'react-basics';
|
||||
import { useMessages } from 'components/hooks';
|
||||
import { ReportContext } from '../[reportId]/Report';
|
||||
import { ReportContext } from '../[reportId]/ReportPage';
|
||||
|
||||
export function EventDataTable() {
|
||||
const { report } = useContext(ReportContext);
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Metadata } from 'next';
|
||||
import EventDataReport from './EventDataReport';
|
||||
|
||||
export default function EventDataReportPage() {
|
||||
export default function () {
|
||||
return <EventDataReport />;
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,9 @@
|
||||
'use client';
|
||||
import { JSX, useCallback, useContext, useMemo } from 'react';
|
||||
import { Loading, StatusLight } from 'react-basics';
|
||||
import { useMessages, useTheme } from 'components/hooks';
|
||||
import BarChart from 'components/metrics/BarChart';
|
||||
import { formatLongNumber } from 'lib/format';
|
||||
import { ReportContext } from '../[reportId]/Report';
|
||||
import { ReportContext } from '../[reportId]/ReportPage';
|
||||
import styles from './FunnelChart.module.css';
|
||||
|
||||
export interface FunnelChartProps {
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { useContext } from 'react';
|
||||
import { useMessages } from 'components/hooks';
|
||||
import {
|
||||
@ -14,7 +13,7 @@ import {
|
||||
} from 'react-basics';
|
||||
import Icons from 'components/icons';
|
||||
import UrlAddForm from './UrlAddForm';
|
||||
import { ReportContext } from '../[reportId]/Report';
|
||||
import { ReportContext } from '../[reportId]/ReportPage';
|
||||
import BaseParameters from '../[reportId]/BaseParameters';
|
||||
import ParameterList from '../[reportId]/ParameterList';
|
||||
import PopupForm from '../[reportId]/PopupForm';
|
||||
|
@ -1,8 +1,7 @@
|
||||
'use client';
|
||||
import FunnelChart from './FunnelChart';
|
||||
import FunnelTable from './FunnelTable';
|
||||
import FunnelParameters from './FunnelParameters';
|
||||
import Report from '../[reportId]/Report';
|
||||
import ReportPage from '../[reportId]/ReportPage';
|
||||
import ReportHeader from '../[reportId]/ReportHeader';
|
||||
import ReportMenu from '../[reportId]/ReportMenu';
|
||||
import ReportBody from '../[reportId]/ReportBody';
|
||||
@ -16,7 +15,7 @@ const defaultParameters = {
|
||||
|
||||
export default function FunnelReport({ reportId }: { reportId?: string }) {
|
||||
return (
|
||||
<Report reportId={reportId} defaultParameters={defaultParameters}>
|
||||
<ReportPage reportId={reportId} defaultParameters={defaultParameters}>
|
||||
<ReportHeader icon={<Funnel />} />
|
||||
<ReportMenu>
|
||||
<FunnelParameters />
|
||||
@ -25,6 +24,6 @@ export default function FunnelReport({ reportId }: { reportId?: string }) {
|
||||
<FunnelChart />
|
||||
<FunnelTable />
|
||||
</ReportBody>
|
||||
</Report>
|
||||
</ReportPage>
|
||||
);
|
||||
}
|
||||
|
6
src/app/(main)/reports/funnel/FunnelReportPage.tsx
Normal file
6
src/app/(main)/reports/funnel/FunnelReportPage.tsx
Normal file
@ -0,0 +1,6 @@
|
||||
'use client';
|
||||
import FunnelReport from './FunnelReport';
|
||||
|
||||
export default function FunnelReportPage() {
|
||||
return <FunnelReport />;
|
||||
}
|
@ -1,8 +1,7 @@
|
||||
'use client';
|
||||
import { useContext } from 'react';
|
||||
import ListTable from 'components/metrics/ListTable';
|
||||
import { useMessages } from 'components/hooks';
|
||||
import { ReportContext } from '../[reportId]/Report';
|
||||
import { ReportContext } from '../[reportId]/ReportPage';
|
||||
|
||||
export function FunnelTable() {
|
||||
const { report } = useContext(ReportContext);
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { useState } from 'react';
|
||||
import { useMessages } from 'components/hooks';
|
||||
import { Button, Form, FormRow, TextField, Flexbox } from 'react-basics';
|
||||
|
@ -1,8 +1,8 @@
|
||||
import FunnelReport from './FunnelReport';
|
||||
import FunnelReportPage from './FunnelReportPage';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
export default function FunnelReportPage() {
|
||||
return <FunnelReport />;
|
||||
export default function () {
|
||||
return <FunnelReportPage />;
|
||||
}
|
||||
|
||||
export const metadata: Metadata = {
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { useContext } from 'react';
|
||||
import { useFormat, useMessages, useFilters } from 'components/hooks';
|
||||
import {
|
||||
@ -13,7 +12,7 @@ import {
|
||||
} from 'react-basics';
|
||||
import Icons from 'components/icons';
|
||||
import BaseParameters from '../[reportId]/BaseParameters';
|
||||
import { ReportContext } from '../[reportId]/Report';
|
||||
import { ReportContext } from '../[reportId]/ReportPage';
|
||||
import ParameterList from '../[reportId]/ParameterList';
|
||||
import FilterSelectForm from '../[reportId]/FilterSelectForm';
|
||||
import FieldSelectForm from '../[reportId]/FieldSelectForm';
|
||||
|
@ -1,5 +1,4 @@
|
||||
'use client';
|
||||
import Report from '../[reportId]/Report';
|
||||
import ReportPage from '../[reportId]/ReportPage';
|
||||
import ReportHeader from '../[reportId]/ReportHeader';
|
||||
import ReportMenu from '../[reportId]/ReportMenu';
|
||||
import ReportBody from '../[reportId]/ReportBody';
|
||||
@ -15,7 +14,7 @@ const defaultParameters = {
|
||||
|
||||
export default function InsightsReport({ reportId }: { reportId?: string }) {
|
||||
return (
|
||||
<Report reportId={reportId} defaultParameters={defaultParameters}>
|
||||
<ReportPage reportId={reportId} defaultParameters={defaultParameters}>
|
||||
<ReportHeader icon={<Lightbulb />} />
|
||||
<ReportMenu>
|
||||
<InsightsParameters />
|
||||
@ -23,6 +22,6 @@ export default function InsightsReport({ reportId }: { reportId?: string }) {
|
||||
<ReportBody>
|
||||
<InsightsTable />
|
||||
</ReportBody>
|
||||
</Report>
|
||||
</ReportPage>
|
||||
);
|
||||
}
|
||||
|
6
src/app/(main)/reports/insights/InsightsReportPage.tsx
Normal file
6
src/app/(main)/reports/insights/InsightsReportPage.tsx
Normal file
@ -0,0 +1,6 @@
|
||||
'use client';
|
||||
import InsightsReport from './InsightsReport';
|
||||
|
||||
export default function InsightsReportPage() {
|
||||
return <InsightsReport />;
|
||||
}
|
@ -1,8 +1,7 @@
|
||||
'use client';
|
||||
import { useContext, useEffect, useState } from 'react';
|
||||
import { GridTable, GridColumn } from 'react-basics';
|
||||
import { useFormat, useMessages } from 'components/hooks';
|
||||
import { ReportContext } from '../[reportId]/Report';
|
||||
import { ReportContext } from '../[reportId]/ReportPage';
|
||||
import EmptyPlaceholder from 'components/common/EmptyPlaceholder';
|
||||
|
||||
export function InsightsTable() {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import InsightsReport from './InsightsReport';
|
||||
import InsightsReportPage from './InsightsReportPage';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
export default function InsightsReportPage() {
|
||||
return <InsightsReport />;
|
||||
export default function () {
|
||||
return <InsightsReportPage />;
|
||||
}
|
||||
|
||||
export const metadata: Metadata = {
|
||||
|
@ -1,14 +1,10 @@
|
||||
import ReportsHeader from './ReportsHeader';
|
||||
import ReportsDataTable from './ReportsDataTable';
|
||||
import ReportsPage from './ReportsPage';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
export default function ({ params: { teamId } }: { params: { teamId: string } }) {
|
||||
return (
|
||||
<>
|
||||
<ReportsHeader />
|
||||
<ReportsDataTable teamId={teamId} />
|
||||
</>
|
||||
);
|
||||
return <ReportsPage teamId={teamId} />;
|
||||
}
|
||||
export const metadata = {
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Reports | Umami',
|
||||
};
|
||||
|
@ -1,8 +1,7 @@
|
||||
'use client';
|
||||
import { useContext } from 'react';
|
||||
import { useMessages } from 'components/hooks';
|
||||
import { Form, FormButtons, FormRow, SubmitButton } from 'react-basics';
|
||||
import { ReportContext } from '../[reportId]/Report';
|
||||
import { ReportContext } from '../[reportId]/ReportPage';
|
||||
import { MonthSelect } from 'components/input/MonthSelect';
|
||||
import BaseParameters from '../[reportId]/BaseParameters';
|
||||
import { parseDateRange } from 'lib/date';
|
||||
|
@ -1,7 +1,6 @@
|
||||
'use client';
|
||||
import RetentionTable from './RetentionTable';
|
||||
import RetentionParameters from './RetentionParameters';
|
||||
import Report from '../[reportId]/Report';
|
||||
import ReportPage from '../[reportId]/ReportPage';
|
||||
import ReportHeader from '../[reportId]/ReportHeader';
|
||||
import ReportMenu from '../[reportId]/ReportMenu';
|
||||
import ReportBody from '../[reportId]/ReportBody';
|
||||
@ -21,7 +20,7 @@ const defaultParameters = {
|
||||
|
||||
export default function RetentionReport({ reportId }: { reportId?: string }) {
|
||||
return (
|
||||
<Report reportId={reportId} defaultParameters={defaultParameters}>
|
||||
<ReportPage reportId={reportId} defaultParameters={defaultParameters}>
|
||||
<ReportHeader icon={<Magnet />} />
|
||||
<ReportMenu>
|
||||
<RetentionParameters />
|
||||
@ -29,6 +28,6 @@ export default function RetentionReport({ reportId }: { reportId?: string }) {
|
||||
<ReportBody>
|
||||
<RetentionTable />
|
||||
</ReportBody>
|
||||
</Report>
|
||||
</ReportPage>
|
||||
);
|
||||
}
|
||||
|
6
src/app/(main)/reports/retention/RetentionReportPage.tsx
Normal file
6
src/app/(main)/reports/retention/RetentionReportPage.tsx
Normal file
@ -0,0 +1,6 @@
|
||||
'use client';
|
||||
import RetentionReport from './RetentionReport';
|
||||
|
||||
export default function RetentionReportPage() {
|
||||
return <RetentionReport />;
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
'use client';
|
||||
import { useContext } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { ReportContext } from '../[reportId]/Report';
|
||||
import { ReportContext } from '../[reportId]/ReportPage';
|
||||
import EmptyPlaceholder from 'components/common/EmptyPlaceholder';
|
||||
import { useMessages, useLocale } from 'components/hooks';
|
||||
import { formatDate } from 'lib/date';
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Metadata } from 'next';
|
||||
import RetentionReport from './RetentionReport';
|
||||
import RetentionReportPage from './RetentionReportPage';
|
||||
|
||||
export default function RetentionReportPage() {
|
||||
return <RetentionReport />;
|
||||
export default function () {
|
||||
return <RetentionReportPage />;
|
||||
}
|
||||
|
||||
export const metadata: Metadata = {
|
||||
|
@ -1,9 +1,9 @@
|
||||
'use client';
|
||||
import { ReactNode } from 'react';
|
||||
import { useLogin, useMessages } from 'components/hooks';
|
||||
import SettingsLayout from 'components/layout/SettingsLayout';
|
||||
import MenuLayout from 'components/layout/MenuLayout';
|
||||
|
||||
export default function Settings({ children }: { children: ReactNode }) {
|
||||
export default function SettingsLayout({ children }: { children: ReactNode }) {
|
||||
const { user } = useLogin();
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
@ -21,5 +21,5 @@ export default function Settings({ children }: { children: ReactNode }) {
|
||||
},
|
||||
].filter(n => n);
|
||||
|
||||
return <SettingsLayout items={items}>{children}</SettingsLayout>;
|
||||
return <MenuLayout items={items}>{children}</MenuLayout>;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import Settings from './Settings';
|
||||
import SettingsLayout from './SettingsLayout';
|
||||
|
||||
export default function ({ children }) {
|
||||
return <Settings>{children}</Settings>;
|
||||
return <SettingsLayout>{children}</SettingsLayout>;
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import {
|
||||
Form,
|
||||
FormRow,
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { useRef } from 'react';
|
||||
import {
|
||||
Form,
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { Button, Icon, Icons, Modal, ModalTrigger, Text } from 'react-basics';
|
||||
import { useMessages, useLocale, useLogin } from 'components/hooks';
|
||||
import TeamDeleteForm from './TeamLeaveForm';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { useApi, useMessages } from 'components/hooks';
|
||||
import { touch } from 'store/modified';
|
||||
import ConfirmationForm from 'components/common/ConfirmationForm';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { Button, Icon, Modal, ModalTrigger, Text } from 'react-basics';
|
||||
import Icons from 'components/icons';
|
||||
import { useMessages } from 'components/hooks';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import DataTable from 'components/common/DataTable';
|
||||
import TeamsTable from 'app/(main)/settings/teams/TeamsTable';
|
||||
import { useTeams } from 'components/hooks';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { Flexbox } from 'react-basics';
|
||||
import PageHeader from 'components/layout/PageHeader';
|
||||
import { ROLES } from 'lib/constants';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { Button, Icon, Modal, ModalTrigger, Text, useToasts } from 'react-basics';
|
||||
import Icons from 'components/icons';
|
||||
import { useMessages } from 'components/hooks';
|
||||
|
12
src/app/(main)/settings/teams/TeamsPage.tsx
Normal file
12
src/app/(main)/settings/teams/TeamsPage.tsx
Normal file
@ -0,0 +1,12 @@
|
||||
'use client';
|
||||
import TeamsDataTable from './TeamsDataTable';
|
||||
import TeamsHeader from './TeamsHeader';
|
||||
|
||||
export default function TeamsPage() {
|
||||
return (
|
||||
<>
|
||||
<TeamsHeader />
|
||||
<TeamsDataTable />
|
||||
</>
|
||||
);
|
||||
}
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { GridColumn, GridTable, Icon, Text, useBreakpoint } from 'react-basics';
|
||||
import { useMessages } from 'components/hooks';
|
||||
import Icons from 'components/icons';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { Button, Icon, Icons, Text } from 'react-basics';
|
||||
import styles from './WebsiteTags.module.css';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { useApi, useMessages } from 'components/hooks';
|
||||
import { Icon, Icons, LoadingButton, Text } from 'react-basics';
|
||||
import { touch } from 'store/modified';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import DataTable from 'components/common/DataTable';
|
||||
import TeamMembersTable from './TeamMembersTable';
|
||||
import { useTeamMembers } from 'components/hooks';
|
||||
|
@ -1,17 +1,18 @@
|
||||
'use client';
|
||||
import TeamProvider from 'app/(main)/teams/[teamId]/TeamProvider';
|
||||
import TeamMembersDataTable from './TeamMembersDataTable';
|
||||
import PageHeader from 'components/layout/PageHeader';
|
||||
import { useMessages } from 'components/hooks';
|
||||
|
||||
export function TeamMembers({ teamId }: { teamId: string }) {
|
||||
export function TeamMembersPage({ teamId }: { teamId: string }) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
return (
|
||||
<>
|
||||
<TeamProvider teamId={teamId}>
|
||||
<PageHeader title={formatMessage(labels.members)} />
|
||||
<TeamMembersDataTable teamId={teamId} allowEdit={true} />
|
||||
</>
|
||||
</TeamProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export default TeamMembers;
|
||||
export default TeamMembersPage;
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { GridColumn, GridTable, useBreakpoint } from 'react-basics';
|
||||
import { useMessages, useLogin } from 'components/hooks';
|
||||
import { ROLES } from 'lib/constants';
|
||||
|
@ -1,13 +1,8 @@
|
||||
import TeamMembers from './TeamMembers';
|
||||
import TeamProvider from 'app/(main)/teams/[teamId]/TeamProvider';
|
||||
import TeamMembersPage from './TeamMembersPage';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
export default function ({ params: { teamId } }) {
|
||||
return (
|
||||
<TeamProvider teamId={teamId}>
|
||||
<TeamMembers teamId={teamId} />
|
||||
</TeamProvider>
|
||||
);
|
||||
return <TeamMembersPage teamId={teamId} />;
|
||||
}
|
||||
|
||||
export const metadata: Metadata = {
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { ActionForm, Button, Modal, ModalTrigger } from 'react-basics';
|
||||
import { useMessages } from 'components/hooks';
|
||||
import TeamDeleteForm from './TeamDeleteForm';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { useApi, useMessages } from 'components/hooks';
|
||||
import { touch } from 'store/modified';
|
||||
import TypeConfirmationForm from 'components/common/TypeConfirmationForm';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { useContext, useState } from 'react';
|
||||
import { Item, Tabs, Flexbox, Text, Icon } from 'react-basics';
|
||||
import PageHeader from 'components/layout/PageHeader';
|
||||
@ -10,7 +9,7 @@ import TeamAdmin from './TeamAdmin';
|
||||
import LinkButton from 'components/common/LinkButton';
|
||||
import { TeamContext } from 'app/(main)/teams/[teamId]/TeamProvider';
|
||||
|
||||
export function Team({ teamId }: { teamId: string }) {
|
||||
export function TeamDetails({ teamId }: { teamId: string }) {
|
||||
const team = useContext(TeamContext);
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { user } = useLogin();
|
||||
@ -42,4 +41,4 @@ export function Team({ teamId }: { teamId: string }) {
|
||||
);
|
||||
}
|
||||
|
||||
export default Team;
|
||||
export default TeamDetails;
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import {
|
||||
SubmitButton,
|
||||
Form,
|
||||
|
13
src/app/(main)/settings/teams/[teamId]/team/TeamPage.tsx
Normal file
13
src/app/(main)/settings/teams/[teamId]/team/TeamPage.tsx
Normal file
@ -0,0 +1,13 @@
|
||||
'use client';
|
||||
import TeamProvider from 'app/(main)/teams/[teamId]/TeamProvider';
|
||||
import TeamDetails from './TeamDetails';
|
||||
|
||||
export function TeamMembersPage({ teamId }: { teamId: string }) {
|
||||
return (
|
||||
<TeamProvider teamId={teamId}>
|
||||
<TeamDetails teamId={teamId} />
|
||||
</TeamProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export default TeamMembersPage;
|
@ -1,13 +1,8 @@
|
||||
import Team from './Team';
|
||||
import TeamProvider from 'app/(main)/teams/[teamId]/TeamProvider';
|
||||
import { Metadata } from 'next';
|
||||
import TeamPage from './TeamPage';
|
||||
|
||||
export default function ({ params: { teamId } }) {
|
||||
return (
|
||||
<TeamProvider teamId={teamId}>
|
||||
<Team teamId={teamId} />
|
||||
</TeamProvider>
|
||||
);
|
||||
return <TeamPage teamId={teamId} />;
|
||||
}
|
||||
|
||||
export const metadata: Metadata = {
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { useApi, useMessages } from 'components/hooks';
|
||||
import { Icon, Icons, LoadingButton, Text } from 'react-basics';
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import DataTable from 'components/common/DataTable';
|
||||
import { useTeamWebsites } from 'components/hooks';
|
||||
import TeamWebsitesTable from './TeamWebsitesTable';
|
||||
|
@ -1,17 +1,18 @@
|
||||
'use client';
|
||||
import TeamProvider from 'app/(main)/teams/[teamId]/TeamProvider';
|
||||
import TeamWebsitesDataTable from './TeamWebsitesDataTable';
|
||||
import PageHeader from 'components/layout/PageHeader';
|
||||
import { useMessages } from 'components/hooks';
|
||||
|
||||
export function TeamWebsites({ teamId }: { teamId: string }) {
|
||||
export function TeamWebsitesPage({ teamId }: { teamId: string }) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
return (
|
||||
<>
|
||||
<TeamProvider teamId={teamId}>
|
||||
<PageHeader title={formatMessage(labels.websites)} />
|
||||
<TeamWebsitesDataTable teamId={teamId} allowEdit={true} />
|
||||
</>
|
||||
</TeamProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export default TeamWebsites;
|
||||
export default TeamWebsitesPage;
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { GridColumn, GridTable, Icon, Text } from 'react-basics';
|
||||
import { useLogin, useMessages } from 'components/hooks';
|
||||
import Icons from 'components/icons';
|
||||
|
@ -1,15 +1,10 @@
|
||||
import TeamWebsites from './TeamWebsites';
|
||||
import TeamProvider from 'app/(main)/teams/[teamId]/TeamProvider';
|
||||
import TeamWebsitesPage from './TeamWebsitesPage';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
export default function ({ params: { teamId } }) {
|
||||
return (
|
||||
<TeamProvider teamId={teamId}>
|
||||
<TeamWebsites teamId={teamId} />
|
||||
</TeamProvider>
|
||||
);
|
||||
return <TeamWebsitesPage teamId={teamId} />;
|
||||
}
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Teams websites - Umami',
|
||||
title: 'Teams Websites - Umami',
|
||||
};
|
||||
|
@ -1,14 +1,8 @@
|
||||
import { Metadata } from 'next';
|
||||
import TeamsDataTable from './TeamsDataTable';
|
||||
import TeamsHeader from './TeamsHeader';
|
||||
import TeamsPage from './TeamsPage';
|
||||
|
||||
export default function () {
|
||||
return (
|
||||
<>
|
||||
<TeamsHeader />
|
||||
<TeamsDataTable />
|
||||
</>
|
||||
);
|
||||
return <TeamsPage />;
|
||||
}
|
||||
|
||||
export const metadata: Metadata = {
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import { Button, Icon, Text, Modal, Icons, ModalTrigger, useToasts } from 'react-basics';
|
||||
import UserAddForm from './UserAddForm';
|
||||
import { useMessages } from 'components/hooks';
|
||||
|
@ -1,4 +1,3 @@
|
||||
'use client';
|
||||
import {
|
||||
Dropdown,
|
||||
Item,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user