diff --git a/projectNext b/projectNext
new file mode 160000
index 000000000..c7b2f2445
--- /dev/null
+++ b/projectNext
@@ -0,0 +1 @@
+Subproject commit c7b2f2445113979eadeb1d0fcb19e70af1c23327
diff --git a/src/app/users/[username]/(user-admin)/settings/kioleskapLeaderboard.tsx b/src/app/users/[username]/(user-admin)/settings/kioleskapLeaderboard.tsx
new file mode 100644
index 000000000..af34329e8
--- /dev/null
+++ b/src/app/users/[username]/(user-admin)/settings/kioleskapLeaderboard.tsx
@@ -0,0 +1,21 @@
+'use client'
+import { updateUserAction } from '@/services/users/actions'
+import Form from '@/app/_components/Form/Form'
+import Checkbox from '@/app/_components/UI/Checkbox'
+import { configureAction } from '@/services/configureAction'
+
+
+export default function RegisterKioleskapLeaderboard({
+ userId,
+ kioleskapLead,
+}: {
+ userId: number,
+ kioleskapLead: boolean,
+}) {
+ return
+}
diff --git a/src/app/users/[username]/(user-admin)/settings/page.tsx b/src/app/users/[username]/(user-admin)/settings/page.tsx
index 384c77aa0..374277fee 100644
--- a/src/app/users/[username]/(user-admin)/settings/page.tsx
+++ b/src/app/users/[username]/(user-admin)/settings/page.tsx
@@ -1,3 +1,5 @@
+import RegisterKioleskapLeaderboard from './kioleskapLeaderboard'
+
import UserSettingsForm from './UserProfileSettingsForm'
import { getProfileForAdmin } from '@/app/users/[username]/(user-admin)/getProfileForAdmin'
import Image from '@/components/Image/Image'
@@ -18,6 +20,8 @@ export default async function UserSettings({ params }: PropTypes) {
{/* TODO: add Email registration form and admin user settings */},.
Generelle Instillinger
+
+
)
}
diff --git a/src/prisma/schema/ombul.prisma b/src/prisma/schema/ombul.prisma
index d55b56a7a..2a1914325 100644
--- a/src/prisma/schema/ombul.prisma
+++ b/src/prisma/schema/ombul.prisma
@@ -1,15 +1,16 @@
model Ombul {
- id Int @id @default(autoincrement())
+ id Int @id @default(autoincrement())
name String
description String?
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
- fsLocation String @unique //location in /store/ombul/[fsLocation]
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
+ fsLocation String @unique //location in /store/ombul/[fsLocation]
year Int
issueNumber Int
- coverImage CmsImage @relation(fields: [coverImageId], references: [id], onDelete: Cascade)
- coverImageId Int @unique
+ coverImage CmsImage @relation(fields: [coverImageId], references: [id], onDelete: Cascade)
+ coverImageId Int @unique
@@unique([year, name])
@@unique([year, issueNumber])
}
+
diff --git a/src/prisma/schema/user.prisma b/src/prisma/schema/user.prisma
index b519aac27..c3594c6e7 100644
--- a/src/prisma/schema/user.prisma
+++ b/src/prisma/schema/user.prisma
@@ -28,6 +28,7 @@ model User {
memberships Membership[]
credentials Credentials?
feideAccount FeideAccount?
+ kioleskapLead Boolean @default(false)
notificationSubscriptions NotificationSubscription[]
mailingLists MailingListUser[]
@@ -41,6 +42,7 @@ model User {
Event Event[]
cabinBooking Booking[] @relation()
+
// We need to explicitly mark the combination of 'id', 'username' and 'email' as
// unique to make the relation to 'Credentials' work.
diff --git a/src/services/users/operations.ts b/src/services/users/operations.ts
index 48375e5c7..b80d10338 100644
--- a/src/services/users/operations.ts
+++ b/src/services/users/operations.ts
@@ -109,6 +109,7 @@ export const userOperations = {
...userFilterSelection,
bio: true,
image: true,
+ kioleskapLead: true,
memberships: {
where: {
OR: [
diff --git a/src/services/users/schemas.ts b/src/services/users/schemas.ts
index bef724572..855a1e687 100644
--- a/src/services/users/schemas.ts
+++ b/src/services/users/schemas.ts
@@ -15,9 +15,12 @@ export const userSchema = z.object({
allergies: z.string().max(150).optional().nullable(),
bio: z.string().max(2047).optional(),
studentCard: studentCardSchema,
+ kioleskapLead: Zpn.checkboxOrBoolean({
+ label: 'leaderboard'
+ }),
password: z.string().max(50).min(12, {
// eslint-disable-next-line
- message: 'Passoret må minst ha 12 tegn, en stor og en liten bokstav, et tall, en rune, to emojier, en musikk note, en magisk sopp og en dråpe smørekopp-blod (avsky).'
+ message: 'Passordet må minst ha 12 tegn, en stor og en liten bokstav, et tall, en rune, to emojier, en musikk note, en magisk sopp og en dråpe smørekopp-blod (avsky).'
}),
confirmPassword: z.string().max(50).min(12),
imageConsent: Zpn.checkboxOrBoolean({
@@ -46,6 +49,8 @@ export const userSchemas = {
firstname: true,
lastname: true,
username: true,
+ kioleskapLead: true,
+
mobile: true,
allergies: true,
sex: true,