rename folder organizationId -> organizationSlug

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-04-08 21:49:20 +02:00
parent 19b0e509e0
commit d922c31455
51 changed files with 47 additions and 49 deletions

View File

@@ -1,6 +1,6 @@
'use client'; 'use client';
import { StickyBelowHeader } from '@/app/(app)/[organizationId]/[projectId]/layout-sticky-below-header'; import { StickyBelowHeader } from '@/app/(app)/[organizationSlug]/[projectId]/layout-sticky-below-header';
import { useOverviewOptions } from '@/components/overview/useOverviewOptions'; import { useOverviewOptions } from '@/components/overview/useOverviewOptions';
import { LazyChart } from '@/components/report/chart/LazyChart'; import { LazyChart } from '@/components/report/chart/LazyChart';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';

View File

@@ -1,4 +1,4 @@
import PageLayout from '@/app/(app)/[organizationId]/[projectId]/page-layout'; import PageLayout from '@/app/(app)/[organizationSlug]/[projectId]/page-layout';
import { notFound } from 'next/navigation'; import { notFound } from 'next/navigation';
import { getDashboardById, getReportsByDashboardId } from '@openpanel/db'; import { getDashboardById, getReportsByDashboardId } from '@openpanel/db';
@@ -7,14 +7,14 @@ import { ListReports } from './list-reports';
interface PageProps { interface PageProps {
params: { params: {
organizationId: string; organizationSlug: string;
projectId: string; projectId: string;
dashboardId: string; dashboardId: string;
}; };
} }
export default async function Page({ export default async function Page({
params: { organizationId: organizationSlug, projectId, dashboardId }, params: { organizationSlug, projectId, dashboardId },
}: PageProps) { }: PageProps) {
const [dashboard, reports] = await Promise.all([ const [dashboard, reports] = await Promise.all([
getDashboardById(dashboardId, projectId), getDashboardById(dashboardId, projectId),

View File

@@ -1,4 +1,4 @@
import PageLayout from '@/app/(app)/[organizationId]/[projectId]/page-layout'; import PageLayout from '@/app/(app)/[organizationSlug]/[projectId]/page-layout';
import { getDashboardsByProjectId } from '@openpanel/db'; import { getDashboardsByProjectId } from '@openpanel/db';
@@ -8,12 +8,12 @@ import { ListDashboards } from './list-dashboards';
interface PageProps { interface PageProps {
params: { params: {
projectId: string; projectId: string;
organizationId: string; organizationSlug: string;
}; };
} }
export default async function Page({ export default async function Page({
params: { projectId, organizationId: organizationSlug }, params: { projectId, organizationSlug },
}: PageProps) { }: PageProps) {
const dashboards = await getDashboardsByProjectId(projectId); const dashboards = await getDashboardsByProjectId(projectId);

View File

@@ -1,4 +1,4 @@
import PageLayout from '@/app/(app)/[organizationId]/[projectId]/page-layout'; import PageLayout from '@/app/(app)/[organizationSlug]/[projectId]/page-layout';
import { OverviewFiltersButtons } from '@/components/overview/filters/overview-filters-buttons'; import { OverviewFiltersButtons } from '@/components/overview/filters/overview-filters-buttons';
import { OverviewFiltersDrawer } from '@/components/overview/filters/overview-filters-drawer'; import { OverviewFiltersDrawer } from '@/components/overview/filters/overview-filters-drawer';
import { import {
@@ -17,7 +17,7 @@ import { EventList } from './event-list';
interface PageProps { interface PageProps {
params: { params: {
projectId: string; projectId: string;
organizationId: string; organizationSlug: string;
}; };
searchParams: { searchParams: {
events?: string; events?: string;
@@ -31,7 +31,7 @@ const nuqsOptions = {
}; };
export default async function Page({ export default async function Page({
params: { projectId, organizationId: organizationSlug }, params: { projectId, organizationSlug },
searchParams, searchParams,
}: PageProps) { }: PageProps) {
const filters = const filters =

View File

@@ -11,14 +11,14 @@ import { LayoutSidebar } from './layout-sidebar';
interface AppLayoutProps { interface AppLayoutProps {
children: React.ReactNode; children: React.ReactNode;
params: { params: {
organizationId: string; organizationSlug: string;
projectId: string; projectId: string;
}; };
} }
export default async function AppLayout({ export default async function AppLayout({
children, children,
params: { organizationId: organizationSlug, projectId }, params: { organizationSlug, projectId },
}: AppLayoutProps) { }: AppLayoutProps) {
const [organizations, projects, dashboards] = await Promise.all([ const [organizations, projects, dashboards] = await Promise.all([
getCurrentOrganizations(), getCurrentOrganizations(),

View File

@@ -1,4 +1,4 @@
import PageLayout from '@/app/(app)/[organizationId]/[projectId]/page-layout'; import PageLayout from '@/app/(app)/[organizationSlug]/[projectId]/page-layout';
import { OverviewFiltersButtons } from '@/components/overview/filters/overview-filters-buttons'; import { OverviewFiltersButtons } from '@/components/overview/filters/overview-filters-buttons';
import { OverviewFiltersDrawer } from '@/components/overview/filters/overview-filters-drawer'; import { OverviewFiltersDrawer } from '@/components/overview/filters/overview-filters-drawer';
import ServerLiveCounter from '@/components/overview/live-counter'; import ServerLiveCounter from '@/components/overview/live-counter';
@@ -18,13 +18,13 @@ import { OverviewReportRange } from './overview-sticky-header';
interface PageProps { interface PageProps {
params: { params: {
organizationId: string; organizationSlug: string;
projectId: string; projectId: string;
}; };
} }
export default async function Page({ export default async function Page({
params: { organizationId: organizationSlug, projectId }, params: { organizationSlug, projectId },
}: PageProps) { }: PageProps) {
const share = await getShareByProjectId(projectId); const share = await getShareByProjectId(projectId);

View File

@@ -1,4 +1,4 @@
import PageLayout from '@/app/(app)/[organizationId]/[projectId]/page-layout'; import PageLayout from '@/app/(app)/[organizationSlug]/[projectId]/page-layout';
import { OverviewFiltersButtons } from '@/components/overview/filters/overview-filters-buttons'; import { OverviewFiltersButtons } from '@/components/overview/filters/overview-filters-buttons';
import { OverviewFiltersDrawer } from '@/components/overview/filters/overview-filters-drawer'; import { OverviewFiltersDrawer } from '@/components/overview/filters/overview-filters-drawer';
import { ProfileAvatar } from '@/components/profiles/profile-avatar'; import { ProfileAvatar } from '@/components/profiles/profile-avatar';
@@ -27,9 +27,9 @@ import { StickyBelowHeader } from '../../layout-sticky-below-header';
interface PageProps { interface PageProps {
params: { params: {
organizationSlug: string;
projectId: string; projectId: string;
profileId: string; profileId: string;
organizationId: string;
}; };
searchParams: { searchParams: {
events?: string; events?: string;
@@ -41,7 +41,7 @@ interface PageProps {
} }
export default async function Page({ export default async function Page({
params: { projectId, profileId, organizationId: organizationSlug }, params: { projectId, profileId, organizationSlug },
searchParams, searchParams,
}: PageProps) { }: PageProps) {
const eventListOptions: GetEventListOptions = { const eventListOptions: GetEventListOptions = {

View File

@@ -1,4 +1,4 @@
import PageLayout from '@/app/(app)/[organizationId]/[projectId]/page-layout'; import PageLayout from '@/app/(app)/[organizationSlug]/[projectId]/page-layout';
import { OverviewFiltersButtons } from '@/components/overview/filters/overview-filters-buttons'; import { OverviewFiltersButtons } from '@/components/overview/filters/overview-filters-buttons';
import { OverviewFiltersDrawer } from '@/components/overview/filters/overview-filters-drawer'; import { OverviewFiltersDrawer } from '@/components/overview/filters/overview-filters-drawer';
import { eventQueryFiltersParser } from '@/hooks/useEventQueryFilters'; import { eventQueryFiltersParser } from '@/hooks/useEventQueryFilters';
@@ -11,7 +11,7 @@ import ProfileTopServer from './profile-top';
interface PageProps { interface PageProps {
params: { params: {
organizationId: string; organizationSlug: string;
projectId: string; projectId: string;
}; };
searchParams: { searchParams: {
@@ -25,7 +25,7 @@ const nuqsOptions = {
}; };
export default function Page({ export default function Page({
params: { organizationId: organizationSlug, projectId }, params: { organizationSlug, projectId },
searchParams: { cursor, f }, searchParams: { cursor, f },
}: PageProps) { }: PageProps) {
return ( return (

View File

@@ -1,4 +1,4 @@
import PageLayout from '@/app/(app)/[organizationId]/[projectId]/page-layout'; import PageLayout from '@/app/(app)/[organizationSlug]/[projectId]/page-layout';
import { Pencil } from 'lucide-react'; import { Pencil } from 'lucide-react';
import { notFound } from 'next/navigation'; import { notFound } from 'next/navigation';
@@ -8,14 +8,14 @@ import ReportEditor from '../report-editor';
interface PageProps { interface PageProps {
params: { params: {
organizationSlug: string;
projectId: string; projectId: string;
reportId: string; reportId: string;
organizationId: string;
}; };
} }
export default async function Page({ export default async function Page({
params: { reportId, organizationId: organizationSlug }, params: { reportId, organizationSlug },
}: PageProps) { }: PageProps) {
const report = await getReportById(reportId); const report = await getReportById(reportId);

View File

@@ -1,18 +1,16 @@
import PageLayout from '@/app/(app)/[organizationId]/[projectId]/page-layout'; import PageLayout from '@/app/(app)/[organizationSlug]/[projectId]/page-layout';
import { Pencil } from 'lucide-react'; import { Pencil } from 'lucide-react';
import ReportEditor from './report-editor'; import ReportEditor from './report-editor';
interface PageProps { interface PageProps {
params: { params: {
organizationId: string; organizationSlug: string;
projectId: string; projectId: string;
}; };
} }
export default function Page({ export default function Page({ params: { organizationSlug } }: PageProps) {
params: { organizationId: organizationSlug },
}: PageProps) {
return ( return (
<PageLayout <PageLayout
organizationSlug={organizationSlug} organizationSlug={organizationSlug}

View File

@@ -1,7 +1,7 @@
'use client'; 'use client';
import { useEffect } from 'react'; import { useEffect } from 'react';
import { StickyBelowHeader } from '@/app/(app)/[organizationId]/[projectId]/layout-sticky-below-header'; import { StickyBelowHeader } from '@/app/(app)/[organizationSlug]/[projectId]/layout-sticky-below-header';
import { ChartSwitch } from '@/components/report/chart'; import { ChartSwitch } from '@/components/report/chart';
import { ReportChartType } from '@/components/report/ReportChartType'; import { ReportChartType } from '@/components/report/ReportChartType';
import { ReportInterval } from '@/components/report/ReportInterval'; import { ReportInterval } from '@/components/report/ReportInterval';

View File

@@ -1,7 +1,7 @@
import PageLayout from '@/app/(app)/[organizationId]/[projectId]/page-layout'; import PageLayout from '@/app/(app)/[organizationSlug]/[projectId]/page-layout';
import { notFound } from 'next/navigation'; import { notFound } from 'next/navigation';
import { getInvites, getOrganizationBySlug } from '@openpanel/db'; import { getOrganizationBySlug } from '@openpanel/db';
import EditOrganization from './edit-organization'; import EditOrganization from './edit-organization';
import InvitesServer from './invites'; import InvitesServer from './invites';
@@ -9,12 +9,12 @@ import MembersServer from './members';
interface PageProps { interface PageProps {
params: { params: {
organizationId: string; organizationSlug: string;
}; };
} }
export default async function Page({ export default async function Page({
params: { organizationId: organizationSlug }, params: { organizationSlug },
}: PageProps) { }: PageProps) {
const organization = await getOrganizationBySlug(organizationSlug); const organization = await getOrganizationBySlug(organizationSlug);

View File

@@ -1,4 +1,4 @@
import PageLayout from '@/app/(app)/[organizationId]/[projectId]/page-layout'; import PageLayout from '@/app/(app)/[organizationSlug]/[projectId]/page-layout';
import { auth } from '@clerk/nextjs'; import { auth } from '@clerk/nextjs';
import { getUserById } from '@openpanel/db'; import { getUserById } from '@openpanel/db';
@@ -8,11 +8,11 @@ import { Logout } from './logout';
interface PageProps { interface PageProps {
params: { params: {
organizationId: string; organizationSlug: string;
}; };
} }
export default async function Page({ export default async function Page({
params: { organizationId: organizationSlug }, params: { organizationSlug },
}: PageProps) { }: PageProps) {
const { userId } = auth(); const { userId } = auth();
const profile = await getUserById(userId!); const profile = await getUserById(userId!);

View File

@@ -1,6 +1,6 @@
'use client'; 'use client';
import { StickyBelowHeader } from '@/app/(app)/[organizationId]/[projectId]/layout-sticky-below-header'; import { StickyBelowHeader } from '@/app/(app)/[organizationSlug]/[projectId]/layout-sticky-below-header';
import { ClientActions } from '@/components/clients/client-actions'; import { ClientActions } from '@/components/clients/client-actions';
import { ProjectActions } from '@/components/projects/project-actions'; import { ProjectActions } from '@/components/projects/project-actions';
// import { columns } from '@/components/projects/table'; // import { columns } from '@/components/projects/table';

View File

@@ -1,4 +1,4 @@
import PageLayout from '@/app/(app)/[organizationId]/[projectId]/page-layout'; import PageLayout from '@/app/(app)/[organizationSlug]/[projectId]/page-layout';
import { import {
getClientsByOrganizationSlug, getClientsByOrganizationSlug,
@@ -9,12 +9,12 @@ import ListProjects from './list-projects';
interface PageProps { interface PageProps {
params: { params: {
organizationId: string; organizationSlug: string;
}; };
} }
export default async function Page({ export default async function Page({
params: { organizationId: organizationSlug }, params: { organizationSlug },
}: PageProps) { }: PageProps) {
const [projects, clients] = await Promise.all([ const [projects, clients] = await Promise.all([
getProjectsByOrganizationSlug(organizationSlug), getProjectsByOrganizationSlug(organizationSlug),

View File

@@ -1,6 +1,6 @@
'use client'; 'use client';
import { StickyBelowHeader } from '@/app/(app)/[organizationId]/[projectId]/layout-sticky-below-header'; import { StickyBelowHeader } from '@/app/(app)/[organizationSlug]/[projectId]/layout-sticky-below-header';
import { DataTable } from '@/components/data-table'; import { DataTable } from '@/components/data-table';
import { columns } from '@/components/references/table'; import { columns } from '@/components/references/table';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';

View File

@@ -1,4 +1,4 @@
import PageLayout from '@/app/(app)/[organizationId]/[projectId]/page-layout'; import PageLayout from '@/app/(app)/[organizationSlug]/[projectId]/page-layout';
import { getReferences } from '@openpanel/db'; import { getReferences } from '@openpanel/db';
@@ -6,13 +6,13 @@ import ListReferences from './list-references';
interface PageProps { interface PageProps {
params: { params: {
organizationId: string; organizationSlug: string;
projectId: string; projectId: string;
}; };
} }
export default async function Page({ export default async function Page({
params: { organizationId: organizationSlug, projectId }, params: { organizationSlug, projectId },
}: PageProps) { }: PageProps) {
const references = await getReferences({ const references = await getReferences({
where: { where: {

View File

@@ -12,12 +12,12 @@ import { CreateProject } from './create-project';
interface PageProps { interface PageProps {
params: { params: {
organizationId: string; organizationSlug: string;
}; };
} }
export default async function Page({ export default async function Page({
params: { organizationId: organizationSlug }, params: { organizationSlug },
}: PageProps) { }: PageProps) {
const [organization, projects] = await Promise.all([ const [organization, projects] = await Promise.all([
getOrganizationBySlug(organizationSlug), getOrganizationBySlug(organizationSlug),

View File

@@ -1,5 +1,5 @@
import { StickyBelowHeader } from '@/app/(app)/[organizationId]/[projectId]/layout-sticky-below-header'; import { StickyBelowHeader } from '@/app/(app)/[organizationSlug]/[projectId]/layout-sticky-below-header';
import { OverviewReportRange } from '@/app/(app)/[organizationId]/[projectId]/overview-sticky-header'; import { OverviewReportRange } from '@/app/(app)/[organizationSlug]/[projectId]/overview-sticky-header';
import { Logo } from '@/components/logo'; import { Logo } from '@/components/logo';
import { OverviewFiltersButtons } from '@/components/overview/filters/overview-filters-buttons'; import { OverviewFiltersButtons } from '@/components/overview/filters/overview-filters-buttons';
import ServerLiveCounter from '@/components/overview/live-counter'; import ServerLiveCounter from '@/components/overview/live-counter';