-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/Consent form fridge leaderboard #473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
bdf8c89
3012d10
6681df2
1a956f1
bbbfbbc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| 'use client' | ||
| import { updateUserAction } from '@/services/users/actions' | ||
| import Form from '@/app/_components/Form/Form' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @/components |
||
| import Checkbox from '@/app/_components/UI/Checkbox' | ||
| import { configureAction } from '@/services/configureAction' | ||
|
|
||
|
|
||
| export default function RegisterKioleskapLeaderboard({ | ||
| userId, | ||
| kioleskapLead, | ||
| }: { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use PropTypes semantics
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also think (if this is a separate form) that the form name should include the word consent |
||
| userId: number, | ||
| kioleskapLead: boolean, | ||
| }) { | ||
| return <Form | ||
| action={configureAction(updateUserAction, { params: { id: userId } })} | ||
| submitText="Oppdater innstilling over" | ||
| > | ||
| <Checkbox name="kioleskapLead" defaultChecked={kioleskapLead}>Jeg vil vises på Kioleskapets leaderboard</Checkbox> | ||
| </Form> | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| import RegisterKioleskapLeaderboard from './kioleskapLeaderboard' | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. whitespace |
||
| 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 */},. | ||
| <h2>Generelle Instillinger</h2> | ||
| <Image width={300} image={profile.user.image} /> | ||
|
|
||
| <RegisterKioleskapLeaderboard userId={profile.user.id} kioleskapLead={profile.user.kioleskapLead} /> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this form anyways just calls the updateUserAction the form should probably be for all updateable user fields and not its own form. I.e. all fields updateable through updateUser should be in the same form |
||
| </div> | ||
| ) | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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]) | ||
| } | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ model User { | |
| memberships Membership[] | ||
| credentials Credentials? | ||
| feideAccount FeideAccount? | ||
| kioleskapLead Boolean @default(false) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this field name is non-descriptive. It should at least include the word consent. Also: avoid abbreviating the name. |
||
|
|
||
| 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. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should be uppercased and have he same name as the function it exports