more cleanup
This commit is contained in:
@@ -33,10 +33,10 @@ const startServer = async () => {
|
|||||||
fastify.register(profileRouter, { prefix: '/profile' });
|
fastify.register(profileRouter, { prefix: '/profile' });
|
||||||
fastify.register(liveRouter, { prefix: '/live' });
|
fastify.register(liveRouter, { prefix: '/live' });
|
||||||
fastify.register(miscRouter, { prefix: '/misc' });
|
fastify.register(miscRouter, { prefix: '/misc' });
|
||||||
fastify.setErrorHandler((error, request, reply) => {
|
fastify.setErrorHandler((error) => {
|
||||||
fastify.log.error(error);
|
fastify.log.error(error);
|
||||||
});
|
});
|
||||||
fastify.get('/', (request, reply) => {
|
fastify.get('/', (_request, reply) => {
|
||||||
reply.send({ name: 'openpanel sdk api' });
|
reply.send({ name: 'openpanel sdk api' });
|
||||||
});
|
});
|
||||||
// fastify.get('/health-check', async (request, reply) => {
|
// fastify.get('/health-check', async (request, reply) => {
|
||||||
|
|||||||
@@ -12,10 +12,12 @@ import {
|
|||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from '@/components/ui/dropdown-menu';
|
} from '@/components/ui/dropdown-menu';
|
||||||
import { useAppParams } from '@/hooks/useAppParams';
|
import { useAppParams } from '@/hooks/useAppParams';
|
||||||
|
import { api, handleError } from '@/trpc/client';
|
||||||
import { cn } from '@/utils/cn';
|
import { cn } from '@/utils/cn';
|
||||||
import { ChevronRight, MoreHorizontal, PlusIcon, Trash } from 'lucide-react';
|
import { ChevronRight, MoreHorizontal, PlusIcon, Trash } from 'lucide-react';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
|
import { toast } from 'sonner';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getDefaultIntervalByDates,
|
getDefaultIntervalByDates,
|
||||||
@@ -33,7 +35,13 @@ export function ListReports({ reports }: ListReportsProps) {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const params = useAppParams<{ dashboardId: string }>();
|
const params = useAppParams<{ dashboardId: string }>();
|
||||||
const { range, startDate, endDate } = useOverviewOptions();
|
const { range, startDate, endDate } = useOverviewOptions();
|
||||||
|
const deletion = api.report.delete.useMutation({
|
||||||
|
onError: handleError,
|
||||||
|
onSuccess() {
|
||||||
|
router.refresh();
|
||||||
|
toast('Report deleted');
|
||||||
|
},
|
||||||
|
});
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<StickyBelowHeader className="flex items-center justify-between p-4">
|
<StickyBelowHeader className="flex items-center justify-between p-4">
|
||||||
@@ -95,10 +103,10 @@ export function ListReports({ reports }: ListReportsProps) {
|
|||||||
<DropdownMenuItem
|
<DropdownMenuItem
|
||||||
className="text-destructive"
|
className="text-destructive"
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
// event.stopPropagation();
|
event.stopPropagation();
|
||||||
// deletion.mutate({
|
deletion.mutate({
|
||||||
// reportId: report.id,
|
reportId: report.id,
|
||||||
// });
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Trash size={16} className="mr-2" />
|
<Trash size={16} className="mr-2" />
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
import { StickyBelowHeader } from '@/app/(app)/[organizationSlug]/[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 {
|
import {
|
||||||
Accordion,
|
Accordion,
|
||||||
AccordionContent,
|
AccordionContent,
|
||||||
@@ -13,7 +12,6 @@ import {
|
|||||||
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert';
|
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Tooltiper } from '@/components/ui/tooltip';
|
import { Tooltiper } from '@/components/ui/tooltip';
|
||||||
import { useAppParams } from '@/hooks/useAppParams';
|
|
||||||
import { pushModal } from '@/modals';
|
import { pushModal } from '@/modals';
|
||||||
import { InfoIcon, PlusIcon, PlusSquareIcon } from 'lucide-react';
|
import { InfoIcon, PlusIcon, PlusSquareIcon } from 'lucide-react';
|
||||||
|
|
||||||
@@ -24,20 +22,12 @@ interface ListProjectsProps {
|
|||||||
clients: IServiceClientWithProject[];
|
clients: IServiceClientWithProject[];
|
||||||
}
|
}
|
||||||
export default function ListProjects({ projects, clients }: ListProjectsProps) {
|
export default function ListProjects({ projects, clients }: ListProjectsProps) {
|
||||||
const { organizationSlug } = useAppParams();
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<StickyBelowHeader>
|
<StickyBelowHeader>
|
||||||
<div className="flex items-center justify-between p-4">
|
<div className="flex items-center justify-between p-4">
|
||||||
<div />
|
<div />
|
||||||
<Button
|
<Button icon={PlusIcon} onClick={() => pushModal('AddProject')}>
|
||||||
icon={PlusIcon}
|
|
||||||
onClick={() =>
|
|
||||||
pushModal('AddProject', {
|
|
||||||
organizationSlug,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<span className="max-sm:hidden">Create project</span>
|
<span className="max-sm:hidden">Create project</span>
|
||||||
<span className="sm:hidden">Project</span>
|
<span className="sm:hidden">Project</span>
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { ButtonContainer } from '@/components/button-container';
|
import { ButtonContainer } from '@/components/button-container';
|
||||||
import { InputWithLabel } from '@/components/forms/input-with-label';
|
import { InputWithLabel } from '@/components/forms/input-with-label';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
|
import { useAppParams } from '@/hooks/useAppParams';
|
||||||
import { api, handleError } from '@/trpc/client';
|
import { api, handleError } from '@/trpc/client';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
@@ -16,10 +17,9 @@ const validator = z.object({
|
|||||||
});
|
});
|
||||||
|
|
||||||
type IForm = z.infer<typeof validator>;
|
type IForm = z.infer<typeof validator>;
|
||||||
interface AddProjectProps {
|
|
||||||
organizationSlug: string;
|
export default function AddProject() {
|
||||||
}
|
const { organizationSlug } = useAppParams();
|
||||||
export default function AddProject({ organizationSlug }: AddProjectProps) {
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const mutation = api.project.create.useMutation({
|
const mutation = api.project.create.useMutation({
|
||||||
onError: handleError,
|
onError: handleError,
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { ButtonContainer } from '@/components/button-container';
|
import { ButtonContainer } from '@/components/button-container';
|
||||||
import { InputWithLabel } from '@/components/forms/input-with-label';
|
import { InputWithLabel } from '@/components/forms/input-with-label';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Calendar } from '@/components/ui/calendar';
|
|
||||||
import { useAppParams } from '@/hooks/useAppParams';
|
import { useAppParams } from '@/hooks/useAppParams';
|
||||||
import { api, handleError } from '@/trpc/client';
|
import { api, handleError } from '@/trpc/client';
|
||||||
import { zodResolver } from '@hookform/resolvers/zod';
|
import { zodResolver } from '@hookform/resolvers/zod';
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
import { Controller, useForm } from 'react-hook-form';
|
import { useForm } from 'react-hook-form';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import type { z } from 'zod';
|
import type { z } from 'zod';
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ type EditReportProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default function EditReport({ form, onSubmit }: EditReportProps) {
|
export default function EditReport({ form, onSubmit }: EditReportProps) {
|
||||||
const { register, handleSubmit, reset, formState } = useForm<IForm>({
|
const { register, handleSubmit, formState } = useForm<IForm>({
|
||||||
resolver: zodResolver(validator),
|
resolver: zodResolver(validator),
|
||||||
defaultValues: form,
|
defaultValues: form,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,11 +4,10 @@ import Image from 'next/image';
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
|
||||||
import { Heading2, Lead2 } from './copy';
|
import { Heading2, Lead2 } from './copy';
|
||||||
import { JoinWaitlist } from './join-waitlist';
|
|
||||||
|
|
||||||
export default function Footer() {
|
export default function Footer() {
|
||||||
return (
|
return (
|
||||||
<footer className="bg-blue-darker relative relative mt-40 text-white">
|
<footer className="bg-blue-darker relative mt-40 text-white">
|
||||||
<div className="absolute inset-0 h-full w-full bg-[radial-gradient(circle,rgba(255,255,255,0.2)_0%,rgba(255,255,255,0)_100%)]"></div>
|
<div className="absolute inset-0 h-full w-full bg-[radial-gradient(circle,rgba(255,255,255,0.2)_0%,rgba(255,255,255,0)_100%)]"></div>
|
||||||
<div className="container relative flex flex-col items-center text-center">
|
<div className="container relative flex flex-col items-center text-center">
|
||||||
<div className="my-24">
|
<div className="my-24">
|
||||||
|
|||||||
Reference in New Issue
Block a user