Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev -p 3002 --turbopack",
"dev": "next dev -p 3002",
"build": "next build",
"docker:build": "docker build -t dashboard:latest -f Dockerfile --progress plain ../..",
"start": "next start",
Expand All @@ -19,7 +19,6 @@
"@dotkomonline/environment": "workspace:*",
"@dotkomonline/logger": "workspace:*",
"@dotkomonline/rpc": "workspace:*",
"@dotkomonline/types": "workspace:*",
"@dotkomonline/ui": "workspace:*",
"@dotkomonline/utils": "workspace:*",
"@fontsource-variable/google-sans-code": "^5.2.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Attendance } from "@dotkomonline/types"
import type { Attendance } from "@dotkomonline/rpc/attendance"
import { Box, Divider, Title } from "@mantine/core"
import type { FC } from "react"
import { useAttendanceForm } from "../components/attendance-form"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { UserSearch } from "@/app/(internal)/brukere/components/user-search"
import type { Attendance, Event, FeedbackFormAnswer } from "@dotkomonline/types"
import type { Attendance } from "@dotkomonline/rpc/attendance"
import type { Event } from "@dotkomonline/rpc/event"
import type { FeedbackFormAnswer } from "@dotkomonline/rpc/feedback-form"
import { Anchor, Button, Group, List, ListItem, Space, Stack, Text, Title } from "@mantine/core"
import { skipToken } from "@tanstack/react-query"
import type { FC } from "react"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import {
type EventId,
type FeedbackFormId,
type FeedbackFormWrite,
type FeedbackQuestionWrite,
getDefaultFeedbackAnswerDeadline,
} from "@dotkomonline/types"
import { type EventId, getDefaultFeedbackAnswerDeadline } from "@dotkomonline/rpc/event"
import type { FeedbackFormId, FeedbackFormWrite, FeedbackQuestionWrite } from "@dotkomonline/rpc/feedback-form"
import { Box, Button, Group, Select, Stack, Title, Text } from "@mantine/core"
import type { FC } from "react"
import { FeedbackFormEditForm } from "../components/feedback-form-edit-form"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
type Attendee,
getAttendeePaymentStatus,
isAttendeeChargedAndUnrefunded,
} from "@dotkomonline/types"
} from "@dotkomonline/rpc/attendance"
import { Badge, type BadgeProps, Box, Button, Group, Input, Stack, Title } from "@mantine/core"
import { IconExternalLink } from "@tabler/icons-react"
import { createColumnHelper, getCoreRowModel, useReactTable } from "@tanstack/react-table"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import type { EventWithAttendance } from "@dotkomonline/types"
import type { EventWithAttendance } from "@dotkomonline/rpc/event"
import { createContext, useContext } from "react"

/** Context consisting of everything required to use and render the form */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useTRPC } from "@/lib/trpc-client"
import type { Attendance } from "@dotkomonline/types"
import type { Attendance } from "@dotkomonline/rpc/attendance"
import { ActionIcon, Box, Button, Divider, Paper, Table, Title } from "@mantine/core"
import { IconEdit, IconTrash } from "@tabler/icons-react"
import { useQuery } from "@tanstack/react-query"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AttendancePool } from "@dotkomonline/types"
import type { AttendancePool } from "@dotkomonline/rpc/attendance"
import { Box, Table } from "@mantine/core"
import type { FC } from "react"
import { formatPoolYearCriterias } from "./utils"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import type {
AttendeePaymentStatus,
Attendee,
AttendeeSelectionResponse,
FeedbackFormAnswer,
} from "@dotkomonline/types"
import { getAttendeePaymentStatus } from "@dotkomonline/types"
} from "@dotkomonline/rpc/attendance"
import type { FeedbackFormAnswer } from "@dotkomonline/rpc/feedback-form"
import { getAttendeePaymentStatus } from "@dotkomonline/rpc/attendance"
import { getCurrentUTC } from "@dotkomonline/utils"
import {
ActionIcon,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createDateTimeInput } from "@/components/forms/DateTimeInput"
import { useFormBuilder } from "@/components/forms/Form"
import { AttendanceWriteSchema } from "@dotkomonline/types"
import { AttendanceWriteSchema } from "@dotkomonline/rpc/attendance"
import type { z } from "zod"

// Define the schema without the omitted fields
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { User } from "@dotkomonline/types"
import type { User } from "@dotkomonline/rpc/user"
import { type ContextModalProps, modals } from "@mantine/modals"
import type { FC } from "react"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Attendance } from "@dotkomonline/types"
import type { Attendance } from "@dotkomonline/rpc/attendance"
import { type ContextModalProps, modals } from "@mantine/modals"
import type { FC } from "react"
import { useUpdateAttendanceMutation } from "../mutations"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AttendanceId } from "@dotkomonline/types"
import type { AttendanceId } from "@dotkomonline/rpc/attendance"
import { type ContextModalProps, modals } from "@mantine/modals"
import type { FC } from "react"
import { useCreatePoolMutation } from "../mutations"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Attendance, AttendanceSelection } from "@dotkomonline/types"
import type { Attendance, AttendanceSelection } from "@dotkomonline/rpc/attendance"
import { type ContextModalProps, modals } from "@mantine/modals"
import type { FC } from "react"
import { useUpdateAttendanceMutation } from "../mutations"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import { createMultipleSelectInput } from "@/components/forms/MultiSelectInput"
import { createRichTextInput } from "@/components/forms/RichTextInput/RichTextInput"
import { createSelectInput } from "@/components/forms/SelectInput"
import { createTextInput } from "@/components/forms/TextInput"
import type { Company } from "@dotkomonline/rpc/company"
import {
type Company,
EVENT_IMAGE_MAX_SIZE_KIB,
EventSchema,
type EventStatus,
EventTypeSchema,
type Group,
mapEventTypeToLabel,
} from "@dotkomonline/types"
} from "@dotkomonline/rpc/event"
import type { Group } from "@dotkomonline/rpc/group"
import { z } from "zod"
import { validateEventWrite } from "../validation"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { User } from "@dotkomonline/types"
import type { User } from "@dotkomonline/rpc/user"
import { type ContextModalProps, modals } from "@mantine/modals"
import type { FC } from "react"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { EventFilterQuery } from "@dotkomonline/types"
import type { EventFilterQuery } from "@dotkomonline/rpc/event"
import { ActionIcon, Group, TextInput } from "@mantine/core"
import { useDebouncedValue } from "@mantine/hooks"
import { IconX } from "@tabler/icons-react"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Company, Group } from "@dotkomonline/types"
import type { Company } from "@dotkomonline/rpc/company"
import type { Group } from "@dotkomonline/rpc/group"
import { Anchor, Group as MantineGroup, Text } from "@mantine/core"
import Link from "next/link"
import type { FC } from "react"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DateTooltip } from "@/components/DateTooltip"
import { GenericTable } from "@/components/GenericTable"
import { type EventWithAttendance, mapEventStatusToLabel, mapEventTypeToLabel } from "@dotkomonline/types"
import { type EventWithAttendance, mapEventStatusToLabel, mapEventTypeToLabel } from "@dotkomonline/rpc/event"
import { Anchor } from "@mantine/core"
import { createColumnHelper, getCoreRowModel, useReactTable } from "@tanstack/react-table"
import Link from "next/link"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { EventId } from "@dotkomonline/rpc/event"
import {
type EventId,
type FeedbackFormId,
type FeedbackFormWrite,
FeedbackFormWriteSchema,
FeedbackQuestionSchema,
type FeedbackQuestionWrite,
FeedbackQuestionWriteSchema,
getFeedbackQuestionTypeName,
} from "@dotkomonline/types"
} from "@dotkomonline/rpc/feedback-form"
import { DragDropContext, Draggable, type DropResult, Droppable } from "@hello-pangea/dnd"
import { zodResolver } from "@hookform/resolvers/zod"
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AttendeeId } from "@dotkomonline/types"
import type { AttendeeId } from "@dotkomonline/rpc/attendance"
import { Button } from "@mantine/core"
import { type ContextModalProps, modals } from "@mantine/modals"
import type { FC } from "react"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ErrorMessage } from "@hookform/error-message"
import { zodResolver } from "@hookform/resolvers/zod"
import type { Attendee, EventId } from "@dotkomonline/types"
import type { Attendee } from "@dotkomonline/rpc/attendance"
import type { EventId } from "@dotkomonline/rpc/event"
import { Button, ScrollArea, Stack, Table, Textarea } from "@mantine/core"
import { type ContextModalProps, modals } from "@mantine/modals"
import type { FC } from "react"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
type AttendancePool,
getReservedAttendeeCount,
getUnreservedAttendeeCount,
} from "@dotkomonline/types"
} from "@dotkomonline/rpc/attendance"
import { Box, Button, Card, Flex, Group, Space, Text, Title } from "@mantine/core"
import type { FC } from "react"
import { useDeletePoolMutation } from "../mutations"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
import {
type Attendance,
type AttendeeId,
type User,
findActiveMembership,
getAttendeeQueuePosition,
getUnreservedAttendeeCount,
getMembershipTypeName,
getGenderName,
} from "@dotkomonline/types"
} from "@dotkomonline/rpc/attendance"
import { type User, findActiveMembership, getMembershipTypeName, getGenderName } from "@dotkomonline/rpc/user"
import { getCurrentUTC, getStudyGrade } from "@dotkomonline/utils"
import { Button, Flex, Group, Image, Stack, Text, Title, useComputedColorScheme } from "@mantine/core"
import { useMediaQuery } from "@mantine/hooks"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Attendance } from "@dotkomonline/types"
import type { Attendance } from "@dotkomonline/rpc/attendance"
import { ActionIcon, AspectRatio, Button, Group, Loader, Skeleton, Stack, Text } from "@mantine/core"
import { useDisclosure } from "@mantine/hooks"
import { IconFlipVertical, IconQrcode, IconQrcodeOff } from "@tabler/icons-react"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
EventTypeSchema,
EventWriteSchema,
mapEventTypeToLabel,
} from "@dotkomonline/types"
} from "@dotkomonline/rpc/event"
import { addHours, roundToNearestHours } from "date-fns"
import { z } from "zod"

Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/app/(internal)/arrangementer/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import type { EventFilterQuery } from "@dotkomonline/types"
import type { EventFilterQuery } from "@dotkomonline/rpc/event"
import { Button, Group, Skeleton, Stack, Title } from "@mantine/core"
import { IconPencil } from "@tabler/icons-react"
import Link from "next/link"
Expand Down
5 changes: 4 additions & 1 deletion apps/dashboard/src/app/(internal)/arrangementer/queries.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import type { AttendanceId, EventFilterQuery, EventId, FeedbackFormId, UserId } from "@dotkomonline/types"
import type { AttendanceId } from "@dotkomonline/rpc/attendance"
import type { EventFilterQuery, EventId } from "@dotkomonline/rpc/event"
import type { FeedbackFormId } from "@dotkomonline/rpc/feedback-form"
import type { UserId } from "@dotkomonline/rpc/user"
import { type SkipToken, useInfiniteQuery, useQuery } from "@tanstack/react-query"

import { useTRPC } from "@/lib/trpc-client"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EventStatusSchema, EventTypeSchema, type EventWrite } from "@dotkomonline/types"
import { EventStatusSchema, EventTypeSchema, type EventWrite } from "@dotkomonline/rpc/event"
import { isAfter } from "date-fns"
import type { z } from "zod"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import type { Article } from "@dotkomonline/types"
import type { Article } from "@dotkomonline/rpc/article"
import { createContext, useContext } from "react"

/** Context consisting of everything required to use and render the form */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FilterableTable, arrayOrEqualsFilter } from "@/components/molecules/FilterableTable/FilterableTable"
import type { Article } from "@dotkomonline/types"
import type { Article } from "@dotkomonline/rpc/article"
import { Anchor, Group } from "@mantine/core"
import { createColumnHelper, getCoreRowModel } from "@tanstack/react-table"
import Link from "next/link"
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/app/(internal)/artikler/write-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { createImageInput } from "@/components/forms/ImageInput"
import { createRichTextInput } from "@/components/forms/RichTextInput/RichTextInput"
import { createTagInput } from "@/components/forms/TagInput"
import { createTextInput } from "@/components/forms/TextInput"
import { ARTICLE_IMAGE_MAX_SIZE_KIB, ArticleTagSchema, ArticleWriteSchema } from "@dotkomonline/types"
import { ARTICLE_IMAGE_MAX_SIZE_KIB, ArticleTagSchema, ArticleWriteSchema } from "@dotkomonline/rpc/article"
import type { z } from "zod"

const ARTICLE_FORM_DEFAULT_VALUES: Partial<ArticleWriteFormSchema> = {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GenericTable } from "@/components/GenericTable"
import { type DeregisterReasonWithEvent, mapDeregisterReasonTypeToLabel } from "@dotkomonline/types"
import { type DeregisterReasonWithEvent, mapDeregisterReasonTypeToLabel } from "@dotkomonline/rpc/event"
import { Anchor } from "@mantine/core"
import { createColumnHelper, getCoreRowModel, useReactTable } from "@tanstack/react-table"
import { formatDate } from "date-fns"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import type { Company } from "@dotkomonline/types"
import type { Company } from "@dotkomonline/rpc/company"
import { createContext, useContext } from "react"

/** Context consisting of everything required to use and render the form */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import type { Company } from "@dotkomonline/types"
import type { Company } from "@dotkomonline/rpc/company"
import { Anchor } from "@mantine/core"
import { createColumnHelper, getCoreRowModel, useReactTable } from "@tanstack/react-table"
import Link from "next/link"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useFormBuilder } from "@/components/forms/Form"
import { createImageInput } from "@/components/forms/ImageInput"
import { createRichTextInput } from "@/components/forms/RichTextInput/RichTextInput"
import { createTextInput } from "@/components/forms/TextInput"
import { COMPANY_IMAGE_MAX_SIZE_KIB, type CompanyWrite, CompanyWriteSchema } from "@dotkomonline/types"
import { COMPANY_IMAGE_MAX_SIZE_KIB, type CompanyWrite, CompanyWriteSchema } from "@dotkomonline/rpc/company"
import { z } from "zod"

const COMPANY_FORM_DEFAULT_VALUES: Partial<CompanyWrite> = {
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/app/(internal)/bedrifter/queries.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useTRPC } from "@/lib/trpc-client"
import type { Company, CompanyId, CompanySlug } from "@dotkomonline/types"
import type { Company, CompanyId, CompanySlug } from "@dotkomonline/rpc/company"
import { useQuery } from "@tanstack/react-query"
import { useMemo } from "react"

Expand Down
3 changes: 2 additions & 1 deletion apps/dashboard/src/app/(internal)/brukere/[id]/edit-card.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { env } from "@/lib/env"
import { useUser } from "@auth0/nextjs-auth0/client"
import { UserWriteSchema, type WorkspaceUser, findActiveMembership, getMembershipTypeName } from "@dotkomonline/types"
import { UserWriteSchema, findActiveMembership, getMembershipTypeName } from "@dotkomonline/rpc/user"
import type { WorkspaceUser } from "@dotkomonline/rpc/workspace"
import { Button, Group, Loader, Stack, Text, TextInput, Title } from "@mantine/core"
import { useDebouncedValue } from "@mantine/hooks"
import { IconCheck, IconLink, IconUsersGroup, IconX, IconArrowUpRight } from "@tabler/icons-react"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
USER_IMAGE_MAX_SIZE_KIB,
type UserWrite,
UserWriteSchema,
} from "@dotkomonline/types"
} from "@dotkomonline/rpc/user"
import { createTextareaInput } from "@/components/forms/TextareaInput"
import { useIsAdminQuery } from "../queries"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import type { User } from "@dotkomonline/types"
import type { User } from "@dotkomonline/rpc/user"
import { createContext, useContext } from "react"

/** Context consisting of everything required to use and render the form */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AuditLogFilters } from "@/app/(internal)/logg/components/audit-log-filters"
import { useAuditLogSearchQuery } from "@/app/(internal)/logg/queries"
import { AuditLogsTable } from "@/app/(internal)/logg/use-audit-log-table"
import type { AuditLogFilterQuery } from "@dotkomonline/types"
import type { AuditLogFilterQuery } from "@dotkomonline/rpc/audit-log"
import { Skeleton, Stack, Title } from "@mantine/core"
import type { FC } from "react"
import { useState } from "react"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useConfirmDeleteModal } from "@/components/molecules/ConfirmDeleteModal/confirm-delete-modal"
import type { Membership } from "@dotkomonline/types"
import type { Membership } from "@dotkomonline/rpc/user"
import { useDeleteMembershipMutation } from "../mutations"

export const useConfirmDeleteMembershipModal = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { User } from "@dotkomonline/types"
import type { User } from "@dotkomonline/rpc/user"
import { type ContextModalProps, modals } from "@mantine/modals"
import type { FC } from "react"
import { useCreateMembershipMutation } from "../mutations"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Membership } from "@dotkomonline/types"
import type { Membership } from "@dotkomonline/rpc/user"
import { type ContextModalProps, modals } from "@mantine/modals"
import type { FC } from "react"
import { useUpdateMembershipMutation } from "../mutations"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
MembershipWriteSchema,
getMembershipTypeName,
getSpecializationName,
} from "@dotkomonline/types"
} from "@dotkomonline/rpc/user"
import {
getCurrentSemesterStart,
getNextSemesterStart,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import { type Membership, type UserId, getMembershipTypeName, getSpecializationName } from "@dotkomonline/types"
import { type Membership, type UserId, getMembershipTypeName, getSpecializationName } from "@dotkomonline/rpc/user"
import { Button } from "@mantine/core"
import { IconEdit, IconTrash } from "@tabler/icons-react"
import { createColumnHelper, getCoreRowModel, useReactTable } from "@tanstack/react-table"
Expand Down
Loading
Loading