Skip to content

Commit

Permalink
forandret etikett for profil siden, neste steg er å kunne gå til ande…
Browse files Browse the repository at this point in the history
…r sine profiler

Lagt til navnet mitt på webkom siden. (#2230)

🔥 Remove boomtown (#2233)

Fix weird images (#2234)

change href for happening tab (#2235)

added name (#2236)

Ekstern link til påmelding + navn i webkom medlemsliste (#2232)

Update dependency jsdom to v25 (#2202)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

Update dependency @tailwindcss/forms to v0.5.9 (#2229)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

Update dependency @testing-library/react to v16.0.1 (#2217)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

Update dependency @sanity/icons to v3.4.0 (#2194)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

Update dependency tsx to v4.19.0 (#2198)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

Update dependency @types/node to v20.16.5 (#2218)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

Update dependency tsx to v4.19.1 (#2242)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

added tidspunkt to csv

Update dependency @types/pg to v8.11.9 (#2237)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
Herwal and renovate[bot] committed Sep 17, 2024
1 parent c33e1f8 commit 6386b64
Show file tree
Hide file tree
Showing 31 changed files with 216 additions and 270 deletions.
4 changes: 0 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ NEXTAUTH_SECRET="foobar"
NEXTAUTH_URL="http://localhost:3000"


# --- Boomtown
# The hostname of the boomtown server
#NEXT_PUBLIC_BOOMTOWN_HOSTNAME="localhost:8080"

# --- Kaffe (can be found in the nano repository)
# The URL of the Kaffe server
#NEXT_PUBLIC_KAFFE_URL="http://localhost:8002"
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ NB: "Backenden" til Drizzle vil kjøre på [http://localhost:4983](http://localh

## Relaterte prosjekter

- [boomtown](https://github.com/echo-webkom/boomtown) - Systemet for live oppdatering av påmeldinger på arrangementer.
- [nano](https://github.com/echo-webkom/nano) - Nano-services for siden.

## Dokumentasjon
Expand Down
2 changes: 1 addition & 1 deletion apps/cms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"@echo-webkom/lib": "workspace:*",
"@sanity/client": "6.21.3",
"@sanity/icons": "3.3.1",
"@sanity/icons": "3.4.0",
"@sanity/ui": "2.8.9",
"@sanity/vision": "3.56.0",
"nanoid": "5.0.7",
Expand Down
14 changes: 14 additions & 0 deletions apps/cms/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1783,6 +1783,13 @@
},
"optional": false
},
"endDate": {
"type": "objectAttribute",
"value": {
"type": "string"
},
"optional": true
},
"registrationStartGroups": {
"type": "objectAttribute",
"value": {
Expand Down Expand Up @@ -1914,6 +1921,13 @@
},
"optional": true
},
"externalLink": {
"type": "objectAttribute",
"value": {
"type": "string"
},
"optional": true
},
"body": {
"type": "objectAttribute",
"value": {
Expand Down
5 changes: 5 additions & 0 deletions apps/cms/schemas/happening.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ export default defineType({
}),
],
}),
defineField({
name: "externalLink",
type: "url",
hidden: ({ document }) => document?.happeningType !== "external",
}),
defineField({
name: "body",
title: "Brødtekst",
Expand Down
8 changes: 4 additions & 4 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,18 @@
},
"devDependencies": {
"@echo-webkom/tsconfig": "workspace:*",
"@tailwindcss/forms": "0.5.8",
"@tailwindcss/forms": "0.5.9",
"@tailwindcss/typography": "0.5.14",
"@testing-library/react": "16.0.0",
"@types/node": "20.16.1",
"@testing-library/react": "16.0.1",
"@types/node": "20.16.5",
"@types/react": "18.3.4",
"@types/react-dom": "18.3.0",
"@vitejs/plugin-react": "4.3.1",
"autoprefixer": "10.4.20",
"dotenv-cli": "7.4.2",
"eslint": "8.57.0",
"eslint-config-webkom": "workspace:*",
"jsdom": "24.1.1",
"jsdom": "25.0.0",
"postcss": "8.4.41",
"server-only": "^0.0.1",
"tailwindcss": "3.4.10",
Expand Down
5 changes: 0 additions & 5 deletions apps/web/src/actions/deregister.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { answers, registrations } from "@echo-webkom/db/schemas";
import { DeregistrationNotificationEmail } from "@echo-webkom/email";
import { emailClient } from "@echo-webkom/email/client";

import { pingBoomtown } from "@/api/boomtown";
import { revalidateRegistrations } from "@/data/registrations/revalidate";
import { getUser } from "@/lib/get-user";
import { getContactsBySlug } from "@/sanity/utils/contacts";
Expand Down Expand Up @@ -73,10 +72,6 @@ export const deregister = async (id: string, payload: z.infer<typeof deregisterP

revalidateRegistrations(id, user.id);

void (async () => {
await pingBoomtown(id);
})();

return {
success: true,
message: "Du er nå avmeldt",
Expand Down
5 changes: 0 additions & 5 deletions apps/web/src/actions/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
type SpotRange,
} from "@echo-webkom/db/schemas";

import { pingBoomtown } from "@/api/boomtown";
import { revalidateRegistrations } from "@/data/registrations/revalidate";
import { isUserBannedFromBedpres } from "@/lib/ban-info";
import { getUser } from "@/lib/get-user";
Expand Down Expand Up @@ -304,10 +303,6 @@ export const register = async (id: string, payload: z.infer<typeof registrationF
isWaitlisted,
});

void (async () => {
await pingBoomtown(id);
})();

return {
success: true,
message: isWaitlisted ? "Du er nå på venteliste" : "Du er nå påmeldt arrangementet",
Expand Down
15 changes: 0 additions & 15 deletions apps/web/src/api/boomtown.ts

This file was deleted.

3 changes: 1 addition & 2 deletions apps/web/src/app/(default)/auth/user/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ export default async function ProfilePage({ params }: { params: { id: string } }

return (
<div className="max-w-2xl space-y-4">
<Heading level={2}>Din profil</Heading>

<Heading level={2}>{`${user.name?.split(" ")[0]} sin profil`}</Heading>
<div className="flex flex-col gap-4">
<div className="flex flex-col gap-6 md:flex-row">
<UploadProfilePicture name={user.name ?? "Bo Bakseter"} image={user.image} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const getColumns = (questions: Array<Question>) => {

columns.push(...questions.map((question) => question.title));
columns.push("Status");
columns.push("Tidspunkt");

return columns.filter((header) => header !== undefined).filter((header) => header.trim() !== "");
};
6 changes: 3 additions & 3 deletions apps/web/src/app/(default)/hjem/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ export default async function Home() {
className="flex space-y-8 md:grid md:grid-cols-3 md:grid-rows-2 md:gap-8 md:space-y-0"
>
<ComingHappenings
title="Kommende arrangementer"
href="/for-studenter/arrangementer"
title="Arrangementer"
href="/for-studenter/arrangementer?type=event"
types={["external", "event"]}
n={7}
className="col-span-1 row-span-2"
/>
<ComingHappenings
title="Kommende bedpres"
title="Bedpresser"
href="/for-studenter/arrangementer?type=bedpres"
types={["bedpres"]}
n={3}
Expand Down
7 changes: 7 additions & 0 deletions apps/web/src/app/(default)/webkom/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,15 @@ export default function WebkomPage() {
</UnorderedList>

{/* --- V24 --- */}
<UnorderedList className="list-none p-0 text-lg">
<ListItem>Jesper Kierulf Hammer</ListItem>
</UnorderedList>

{/* --- H24 --- */}
<UnorderedList className="list-none p-0 text-lg">
<ListItem>Andreas Drevdal</ListItem>
<ListItem>Birk Monsen</ListItem>
</UnorderedList>
</div>
</Container>
);
Expand Down
17 changes: 11 additions & 6 deletions apps/web/src/components/happening-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,7 @@ export const HappeningSidebar = async ({ event }: EventSidebarProps) => {
<SidebarItem>
<SidebarItemTitle>Påmeldte:</SidebarItemTitle>
<SidebarItemContent>
<RegistrationCount
happeningId={event._id}
maxCapacity={maxCapacity}
initialRegistaredCount={registeredCount}
initialWaitlistCount={waitlistCount}
/>
<RegistrationCount registeredCount={registeredCount} maxCapacity={maxCapacity} />
</SidebarItemContent>
</SidebarItem>
)}
Expand Down Expand Up @@ -463,6 +458,16 @@ export const HappeningSidebar = async ({ event }: EventSidebarProps) => {
<Countdown toDate={userRegistrationStart} />
</SidebarItem>
)}

{event.externalLink && (
<SidebarItem>
<Button asChild fullWidth>
<a href={event.externalLink} target="_blank" rel="noopener noreferrer">
Til påmelding
</a>
</Button>
</SidebarItem>
)}
</div>
</Sidebar>
{/**
Expand Down
37 changes: 2 additions & 35 deletions apps/web/src/components/registration-count.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,18 @@

import { BiInfinite } from "react-icons/bi";

import { useRegistrations } from "@/hooks/use-registrations";
import { cn } from "@/utils/cn";

type RegistrationCountProps = {
happeningId: string;
registeredCount: number;
maxCapacity: number | null;
initialRegistaredCount: number;
initialWaitlistCount: number;
};

export const RegistrationCount = ({
happeningId,
maxCapacity,
initialRegistaredCount,
initialWaitlistCount,
}: RegistrationCountProps) => {
const { registeredCount } = useRegistrations(
happeningId,
initialRegistaredCount,
initialWaitlistCount,
);

const precent = Math.round((registeredCount / (maxCapacity || 1)) * 100);
const hasProgressBar = Boolean(maxCapacity && precent > 0);

export const RegistrationCount = ({ maxCapacity, registeredCount }: RegistrationCountProps) => {
return (
<div className="flex flex-col gap-2">
<div className="flex items-center gap-1">
{Math.min(registeredCount, maxCapacity || Number.POSITIVE_INFINITY)} /{" "}
{maxCapacity || <BiInfinite className="h-5 w-5" />}
</div>
{hasProgressBar && (
<div className="h-4 w-full overflow-hidden rounded-md border">
<div
style={{
width: `${precent}%`,
transition: "width 0.5s",
}}
className={cn("h-full", {
"bg-red-500": precent >= 100,
"bg-green-400": precent < 100,
})}
/>
</div>
)}
</div>
);
};
2 changes: 1 addition & 1 deletion apps/web/src/components/ui/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const AvatarImage = React.forwardRef<
>(({ className, ...props }, ref) => (
<AvatarPrimitive.Image
ref={ref}
className={cn("aspect-square h-full w-full", className)}
className={cn("aspect-square h-full w-full object-cover", className)}
{...props}
/>
));
Expand Down
4 changes: 0 additions & 4 deletions apps/web/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ export const dev = process.env.NODE_ENV !== "production";

export const HTTP = dev ? "http" : "https";

export const WS = dev ? "ws" : "wss";

export const PORT = process.env.PORT ?? 3000;

export const BASE_URL = dev
Expand All @@ -16,8 +14,6 @@ export const PROFILE_IMAGE_FUNCTION_URL = "https://echo-images.azurewebsites.net

export const COOKIE_BANNER = "cookie-banner";

export const BOOMTOWN_HOSTNAME = process.env.NEXT_PUBLIC_BOOMTOWN_HOSTNAME;

export const NUM_HAPPENINGS = !isNaN(Number(process.env.NUM_HAPPENINGS))
? Number(process.env.NUM_HAPPENINGS)
: 4;
50 changes: 0 additions & 50 deletions apps/web/src/hooks/use-registrations.ts

This file was deleted.

2 changes: 2 additions & 0 deletions apps/web/src/lib/csv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ export const toCsv = (happening: FullHappening, selectedHeaders: Array<string> =
obj[question.title] = formattedAnswer;
});

obj.Tidspunkt = r.changedAt ? stringify(r.changedAt) : stringify(r.createdAt);

return obj;
})
.sort((a, b) => {
Expand Down
Loading

0 comments on commit 6386b64

Please sign in to comment.