diff --git a/.vscode/settings.json b/.vscode/settings.json index 44a73ec3..8609b921 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,5 +3,7 @@ { "mode": "auto" } - ] -} + ], + "typescript.tsdk": "./node_modules/typescript/lib", + "typescript.enablePromptUseWorkspaceTsdk": true +} \ No newline at end of file diff --git a/apps/analytics-web/.eslintrc.js b/apps/analytics-web/.eslintrc.js deleted file mode 100644 index 0e5e86f8..00000000 --- a/apps/analytics-web/.eslintrc.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - extends: ["custom/next"], -}; diff --git a/apps/analytics-web/app/_components/analytics/AnalyticsView.tsx b/apps/analytics-web/app/_components/analytics/AnalyticsView.tsx index e32024ee..2ace1e57 100644 --- a/apps/analytics-web/app/_components/analytics/AnalyticsView.tsx +++ b/apps/analytics-web/app/_components/analytics/AnalyticsView.tsx @@ -1,13 +1,13 @@ -import { Card, CardHeader, CardContent } from "~/components/ui/card"; -import EventsTable from "./EventsTable/EventsTable"; -import TotalAppsCard from "./cards/TotalAppsCard"; -import TotalInterviewsCompletedCard from "./cards/TotalInterviewsCompletedCard"; -import TotalInterviewsStartedCard from "./cards/TotalInterviewsStartedCard"; -import TotalProtocolsInstalledCard from "./cards/TotalProtocolsInstalledCard"; -import RegionsTable from "./RegionsTable/RegionsTable"; -import getEvents from "~/db/getEvents"; -import TotalErrorsCard from "./cards/TotalErrorsCard"; -import TotalDataExported from "./cards/TotalDataExported"; +import { Card, CardHeader, CardContent } from '~/components/ui/card'; +import EventsTable from './EventsTable/EventsTable'; +import TotalAppsCard from './cards/TotalAppsCard'; +import TotalInterviewsCompletedCard from './cards/TotalInterviewsCompletedCard'; +import TotalInterviewsStartedCard from './cards/TotalInterviewsStartedCard'; +import TotalProtocolsInstalledCard from './cards/TotalProtocolsInstalledCard'; +import RegionsTable from './RegionsTable/RegionsTable'; +import getEvents from '~/db/getEvents'; +import TotalErrorsCard from './cards/TotalErrorsCard'; +import TotalDataExported from './cards/TotalDataExported'; export default async function AnalyticsView() { const events = await getEvents(); @@ -22,7 +22,7 @@ export default async function AnalyticsView() { -
+
diff --git a/apps/analytics-web/app/_components/analytics/EventsTable/Columns.tsx b/apps/analytics-web/app/_components/analytics/EventsTable/Columns.tsx index 32b3c9a5..68f13a05 100644 --- a/apps/analytics-web/app/_components/analytics/EventsTable/Columns.tsx +++ b/apps/analytics-web/app/_components/analytics/EventsTable/Columns.tsx @@ -1,21 +1,21 @@ -"use client"; +'use client'; -import { ColumnDef } from "@tanstack/react-table"; -import { type Dispatch, type SetStateAction } from "react"; -import { DataTableColumnHeader } from "~/components/DataTable/column-header"; -import { MetadataDialog } from "~/components/MetadataDialog"; -import type { Event } from "~/db/getEvents"; -import { type EventType } from "./EventsTable"; -import { StackTraceDialog } from "./StackTraceDialog"; -import TableFilter from "./TableFilter"; +import { type ColumnDef } from '@tanstack/react-table'; +import { type Dispatch, type SetStateAction } from 'react'; +import { DataTableColumnHeader } from '~/components/DataTable/column-header'; +import { MetadataDialog } from '~/components/MetadataDialog'; +import type { Event } from '~/db/getEvents'; +import { type EventType } from './EventsTable'; +import { StackTraceDialog } from './StackTraceDialog'; +import TableFilter from './TableFilter'; export const getColumns = ( eventTypes: EventType[], - setEventTypes: Dispatch> + setEventTypes: Dispatch>, ) => { const columns: ColumnDef[] = [ { - accessorKey: "type", + accessorKey: 'type', header: ({ column }) => (
@@ -24,7 +24,7 @@ export const getColumns = ( ), }, { - accessorKey: "timestamp", + accessorKey: 'timestamp', header: ({ column }) => ( ), @@ -37,7 +37,7 @@ export const getColumns = ( }, }, { - accessorKey: "installationId", + accessorKey: 'installationId', header: ({ column }) => ( ), @@ -46,26 +46,26 @@ export const getColumns = ( }, }, { - accessorKey: "name", + accessorKey: 'name', header: ({ column }) => ( ), }, { - accessorKey: "message", + accessorKey: 'message', header: ({ column }) => ( ), }, { - accessorKey: "cause", + accessorKey: 'cause', header: ({ column }) => ( ), }, { - accessorKey: "stack", - header: "", + accessorKey: 'stack', + header: '', cell: ({ row }) => row.original.stack && (
@@ -74,8 +74,8 @@ export const getColumns = ( ), }, { - accessorKey: "metadata", - header: "", + accessorKey: 'metadata', + header: '', cell: ({ row }) => { return (
diff --git a/apps/analytics-web/app/_components/analytics/EventsTable/EventsTable.tsx b/apps/analytics-web/app/_components/analytics/EventsTable/EventsTable.tsx index 1b650e46..bb4b4f23 100644 --- a/apps/analytics-web/app/_components/analytics/EventsTable/EventsTable.tsx +++ b/apps/analytics-web/app/_components/analytics/EventsTable/EventsTable.tsx @@ -1,10 +1,10 @@ -"use client"; +'use client'; -import { useEffect, useMemo, useState } from "react"; -import { DataTable } from "~/components/DataTable/data-table"; -import ExportButton from "~/components/ExportButton"; -import { Event } from "~/db/getEvents"; -import { getColumns } from "./Columns"; +import { useEffect, useMemo, useState } from 'react'; +import { DataTable } from '~/components/DataTable/data-table'; +import ExportButton from '~/components/ExportButton'; +import { type Event } from '~/db/getEvents'; +import { getColumns } from './Columns'; export type EventType = { text: string; @@ -17,7 +17,7 @@ export default function EventsTable({ events }: { events: Event[] }) { useEffect(() => { const eventTypesMap = new Map(); events.forEach((event) => - eventTypesMap.set(event.type, { text: event.type, isSelected: true }) + eventTypesMap.set(event.type, { text: event.type, isSelected: true }), ); setEventTypes([...Array.from(eventTypesMap.values())]); @@ -33,7 +33,7 @@ export default function EventsTable({ events }: { events: Event[] }) { return (
-
+

Events

diff --git a/apps/analytics-web/app/_components/analytics/EventsTable/StackTraceDialog.tsx b/apps/analytics-web/app/_components/analytics/EventsTable/StackTraceDialog.tsx index ed049cf2..cc1df0cd 100644 --- a/apps/analytics-web/app/_components/analytics/EventsTable/StackTraceDialog.tsx +++ b/apps/analytics-web/app/_components/analytics/EventsTable/StackTraceDialog.tsx @@ -1,5 +1,5 @@ -import { DialogButton } from "~/components/DialogButton"; -import { Event } from "~/db/getEvents"; +import { DialogButton } from '~/components/DialogButton'; +import { type Event } from '~/db/getEvents'; export function StackTraceDialog({ error }: { error: Event }) { return ( diff --git a/apps/analytics-web/app/_components/analytics/EventsTable/TableFilter.tsx b/apps/analytics-web/app/_components/analytics/EventsTable/TableFilter.tsx index 191ebad4..f027d660 100644 --- a/apps/analytics-web/app/_components/analytics/EventsTable/TableFilter.tsx +++ b/apps/analytics-web/app/_components/analytics/EventsTable/TableFilter.tsx @@ -1,16 +1,16 @@ -"use client"; +'use client'; -import { useState, type Dispatch, type SetStateAction } from "react"; -import { Button } from "~/components/ui/button"; -import { Checkbox } from "~/components/ui/checkbox"; +import { useState, type Dispatch, type SetStateAction } from 'react'; +import { Button } from '~/components/ui/button'; +import { Checkbox } from '~/components/ui/checkbox'; import { DropdownMenu, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, -} from "~/components/ui/dropdown-menu"; -import { type EventType } from "./EventsTable"; +} from '~/components/ui/dropdown-menu'; +import { type EventType } from './EventsTable'; type TableFilterProps = { eventTypes: EventType[]; @@ -23,8 +23,8 @@ const TableFilter = ({ eventTypes, setEventTypes }: TableFilterProps) => { const toggleOption = (option: string) => { setOptions((prevState) => prevState.map((t) => - t.text === option ? { ...t, isSelected: !t.isSelected } : t - ) + t.text === option ? { ...t, isSelected: !t.isSelected } : t, + ), ); }; @@ -37,17 +37,21 @@ const TableFilter = ({ eventTypes, setEventTypes }: TableFilterProps) => { return ( - - + Select events
-