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