Skip to content
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

Small Optimization #1152

Merged
merged 150 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
d7ef66f
chore(deps): bump @babel/traverse from 7.22.15 to 7.23.2 (#912)
dependabot[bot] Oct 19, 2023
2780318
chore: cleanup calendar pup-up (#913)
martcl Oct 19, 2023
5198423
chore: fix pre-commit file permissions
martcl Oct 19, 2023
3bc003e
chore(deps-dev): bump postcss from 8.4.29 to 8.4.31 (#904)
dependabot[bot] Oct 19, 2023
61e5351
Feat(event)/waitlist (#911)
lille-morille Oct 25, 2023
66243d1
Feat/event add users maunually (#917)
lille-morille Nov 6, 2023
c576650
Update CHANGELOG.md
MadsNyl Nov 6, 2023
6f3760d
Trigger build
MadsNyl Nov 6, 2023
47cde63
made page for creating and deleting QR codes (#907)
MadsNyl Nov 16, 2023
932a6ce
Activity (#922)
MadsNyl Nov 16, 2023
506ba7c
Update CHANGELOG.md
MadsNyl Nov 16, 2023
38eb2a5
Merge branch 'master' of https://github.com/TIHLDE/Kvark into dev
MadsNyl Nov 16, 2023
a81d890
Merge branch 'dev' of https://github.com/TIHLDE/Kvark into dev
MadsNyl Nov 16, 2023
590032f
vite 5.0.0 update (#928)
martcl Nov 20, 2023
3c591b9
added buttuns for filtering (#924)
Ester2109 Nov 20, 2023
7ee9e0d
fixed filtering of events and activities (#939)
MadsNyl Dec 14, 2023
a9df886
Reaksjoner (#900)
MadsNyl Dec 14, 2023
a7f2657
moved checkbox for emojies outside paid event collapse
MadsNyl Dec 15, 2023
d7a6d17
added id for each user in copy of participants of an event (#940)
MadsNyl Dec 16, 2023
c3b9ab9
disabled switch to change from free to paid event if an event has reg…
MadsNyl Jan 9, 2024
cf14ad7
changed text (#944)
MadsNyl Jan 9, 2024
049cb43
changed email for strike message (#945)
MadsNyl Jan 9, 2024
396565b
added package for allowing iframe (#949)
MadsNyl Jan 15, 2024
2fb83b6
reduced number of showcase to two for mobile fit (#950)
MadsNyl Jan 15, 2024
463062c
Update CHANGELOG.md (#951)
MadsNyl Jan 15, 2024
10bdd02
merge
MadsNyl Jan 15, 2024
4ff2078
added helpertext (#957)
MadsNyl Jan 22, 2024
196928a
removed timepicker. Paytime is set to constant 2 hours (#958)
MadsNyl Feb 7, 2024
1f10a06
Update CHANGELOG.md (#959)
MadsNyl Feb 7, 2024
45877e9
Merge branch 'master' of https://github.com/TIHLDE/Kvark into dev
MadsNyl Feb 7, 2024
d1f0104
Merge branch 'dev' of https://github.com/TIHLDE/Kvark into dev
MadsNyl Feb 7, 2024
3c49fa4
Clickable user component in reactions list (#961)
EmilJohns1 Feb 15, 2024
ee7fcd0
changed cheatsheet button (#962)
EmilJohns1 Feb 16, 2024
78a070d
Feat/paragraph description (#963)
MindChirp Feb 22, 2024
c94a4ea
Fix(waiting list)/fix waiting list order (#965)
eriskjel Mar 10, 2024
2f0d3ed
added tailwindcss and shadcn (#964)
MadsNyl Mar 11, 2024
f665c0a
Update CHANGELOG.md (#966)
MadsNyl Mar 11, 2024
51adbb8
Merge branch 'master' of https://github.com/TIHLDE/Kvark into dev
MadsNyl Mar 11, 2024
a8c8b2c
waiting-list will now only be sorted if there is a priority pool (#968)
eriskjel Mar 12, 2024
4ec1032
waiting list info will now only be rendered if not null (#969)
eriskjel Mar 12, 2024
007d516
Shadcn button refdesign (#970)
MadsNyl Mar 12, 2024
a12f6df
Shadcn redesign footer (#971)
MadsNyl Mar 13, 2024
8238279
Merge branch 'master' of https://github.com/TIHLDE/Kvark into dev
MadsNyl Mar 13, 2024
394c985
fixed pnpm-lock
MadsNyl Mar 13, 2024
456583c
Refactor(shadcn)/markdown (#974)
MadsNyl Mar 13, 2024
7955be0
fixed link for event calender (#976)
MadsNyl Mar 14, 2024
ebf8a63
redesigned to shadcn avatars (#977)
MadsNyl Mar 15, 2024
22fc72e
changed themesettings component to shadcn (#978)
MadsNyl Mar 15, 2024
68d1fe1
fixed merge
MadsNyl Mar 15, 2024
3b24b1e
fixed seperator for markdown (#981)
MadsNyl Mar 23, 2024
9f4869c
fixed seperator for markdown (#982)
MadsNyl Mar 24, 2024
9d87fb1
Refactor event renderer (#983)
MadsNyl Mar 27, 2024
b79c44d
started on redesign of profile page (#980)
MadsNyl Mar 27, 2024
a84e94b
chore(deps): bump eslint from 8.48.0 to 8.56.0 (#941)
dependabot[bot] Mar 27, 2024
459a4e5
docs(changelog): iterate changelog version (#919)
github-actions[bot] Mar 27, 2024
8261e20
refactored news renderer (#989)
MadsNyl Apr 2, 2024
a280ac5
chore(deps): bump @emotion/react from 11.9.0 to 11.11.4 (#988)
dependabot[bot] Apr 2, 2024
30318fb
chore(deps): bump @vercel/analytics from 1.0.2 to 1.1.4 (#984)
dependabot[bot] Apr 2, 2024
7e2dd0b
chore(deps): bump react-router-dom from 6.15.0 to 6.22.3 (#985)
dependabot[bot] Apr 2, 2024
5b4567a
chore(deps-dev): bump vite from 5.0.0 to 5.0.12 (#956)
dependabot[bot] Apr 2, 2024
60b1c79
Update CHANGELOG.md (#990)
MadsNyl Apr 2, 2024
ba6f7cd
fixed merge
MadsNyl Apr 2, 2024
9cec19b
fixed ts error
MadsNyl Apr 2, 2024
691aca0
added description of how to use spaces (#992)
MadsNyl Apr 3, 2024
6753d87
changed position of share and edit button for event (#993)
MadsNyl Apr 3, 2024
bc9c05a
diasbled theme selector (#998)
MadsNyl Apr 4, 2024
3a553d0
fixed merge
MadsNyl Apr 4, 2024
2e06dfc
NITO logo footer (#1002)
MadsNyl Apr 10, 2024
016ab60
added version name to changelog
MadsNyl Apr 10, 2024
6112c18
trigger build
MadsNyl Apr 10, 2024
fa61a9e
Menu for shortcuts (#1006)
MadsNyl Apr 11, 2024
76761d2
changed info for contact for strikes (#1007)
MadsNyl Apr 11, 2024
47707bd
changed changelog
MadsNyl Apr 11, 2024
b5fa49e
merge
MadsNyl Apr 11, 2024
15b8835
User bio (#1010)
LeMiTam Apr 16, 2024
2dd9aa6
Update CHANGELOG.md
MadsNyl Apr 16, 2024
efdee38
fixed pnpm-lock
MadsNyl Apr 16, 2024
4fcd320
PNG image bg fix (#1013)
MadsNyl Apr 26, 2024
22ab1c6
removed unregister button if registration is paid (#1015)
MadsNyl May 1, 2024
a1acf5b
fixed merge
MadsNyl May 1, 2024
5fa40b8
sort after category (#1018)
MadsNyl May 2, 2024
1687923
fixed merge
MadsNyl May 2, 2024
f3e8d42
fixed category for event view (#1020)
MadsNyl May 2, 2024
88be5d5
Remove MUI from Navigation (#1028)
MadsNyl Jun 10, 2024
755faaf
Remove MUI from signin pages (#1030)
MadsNyl Jun 10, 2024
8f1d766
Remove Page component (#1031)
MadsNyl Jun 11, 2024
4aba5e9
Replace MUI with ShadCN (#1038)
MadsNyl Jul 4, 2024
d53e79f
changelog
MadsNyl Jul 4, 2024
350154b
merge
MadsNyl Jul 4, 2024
bcbe3b4
fixed small design bugs and added scrollToTop component (#1040)
MadsNyl Jul 4, 2024
19c672b
merge
MadsNyl Jul 4, 2024
5d4b2f9
feat(changelog)/changelog site for logged in users (#1045)
lille-morille Jul 22, 2024
591bfa3
Fix bugs (#1044)
antontveito Jul 22, 2024
92f2109
Fix accordion stutter (#1043)
MarkussMadsbakken Jul 22, 2024
6c927a5
updated changelog.md
MadsNyl Jul 22, 2024
91d85a4
Redesing of Ny student page (#1050)
MadsNyl Jul 28, 2024
cf9da7c
added new button for wiki page redirect
MadsNyl Jul 29, 2024
4aa8cae
merge conflict and changelog update
MadsNyl Jul 29, 2024
b119ee2
merged from master
MadsNyl Jul 29, 2024
e3ae3e5
fixed small writing error
MadsNyl Jul 29, 2024
77f8e03
created option for registration with FEIDE
MadsNyl Jul 30, 2024
1c4e5b6
changelog update
MadsNyl Jul 30, 2024
14b9174
added paginate button for event participants
MadsNyl Aug 1, 2024
ddfee93
merge conflict
MadsNyl Aug 1, 2024
94b738a
changed main sponsor logo (#1055)
MadsNyl Aug 4, 2024
ded0c47
Update CHANGELOG.md
MadsNyl Aug 4, 2024
7a2d3e1
Added info box about how to create a feide user (#1057)
MadsNyl Aug 6, 2024
0952bb3
Redesign of notifications (#1059)
MadsNyl Aug 8, 2024
12fd0c7
fixed error on updating user, and form errors on manual singup (#1061)
MadsNyl Aug 15, 2024
c321877
Overview of admissions for groups in TIHLDE (#1063)
MadsNyl Aug 17, 2024
d761a2a
ipdated changelog
MadsNyl Aug 17, 2024
6f0fe3b
Small fixes on UI for admissions (#1065)
MadsNyl Aug 18, 2024
b7c5cba
merge conflict
MadsNyl Aug 18, 2024
6566839
Fix permission for committee leaders for creating group form (#1067)
MadsNyl Aug 18, 2024
88fe5d6
added extra fields for submission (#1069)
MadsNyl Aug 18, 2024
d5efec5
Added allergies (#1071)
MindChirp Aug 29, 2024
748309e
added scrollarea to emoji showcase
MadsNyl Aug 29, 2024
0c665c6
fixed mobile layout hobpost
MadsNyl Aug 29, 2024
bb41393
update changelog
MadsNyl Aug 29, 2024
2c75abe
added discord invite link to footer and profile (#1077)
MadsNyl Sep 9, 2024
1890efd
Hotfix/bio character wrapping (#1075)
LeMiTam Sep 12, 2024
21ebb37
updated CHANGELOG.md
MadsNyl Sep 12, 2024
fd69854
fixed merge
MadsNyl Sep 12, 2024
c22ce25
Fixed the padding issue from frikk (#1083)
Embretr Sep 17, 2024
fb9eaab
added meta settings for reverting zoom on inputs (#1089)
MadsNyl Sep 18, 2024
ab30ef5
merge
MadsNyl Sep 18, 2024
179e1e1
added max width to events (#1097)
petrafh Sep 23, 2024
cf1f54d
Changed the on-cancel warning to more percise. (#1096)
MathiasStrom Sep 23, 2024
fcd8fcb
fixed overflow issue on badges leaderboard (#1098)
Alivki Sep 23, 2024
a636f1d
Changed "digsam" to "digtrans" (#1074)
antontveito Sep 23, 2024
c9dc081
Fixed has_attended filter: Filtering users will occur on the backend.…
yazanzarka1 Sep 30, 2024
6828b53
Fix(digsam)/rectify slug name (#1119)
antontveito Oct 1, 2024
03c755b
Group Form description (#1118)
MadsNyl Oct 1, 2024
c6fe2e4
chore(deps): bump lucide-react from 0.352.0 to 0.446.0 (#1108)
dependabot[bot] Oct 1, 2024
a97c606
chore(deps): bump vite-plugin-checker from 0.6.4 to 0.8.0 (#1110)
dependabot[bot] Oct 1, 2024
9ccea90
Refactor(event)/remove question button (#1131)
stormba Oct 7, 2024
76c6afb
Replaced slack with notion icon for footer (#1135)
lille-morille Oct 9, 2024
2422787
Fixed the re-rendering of UserFilter on admin page every 500ms (#1133)
AleksanderEvensen Oct 11, 2024
25f0e79
Updated CHANGELOG.md
MadsNyl Oct 11, 2024
e13575c
merge conflict
MadsNyl Oct 11, 2024
cfaa08f
Refactor(gallery)/fix description width (#1139)
Josefinegh Oct 15, 2024
d340e80
Fixed icon issue and turncated overflowed text (#1138)
Josefinegh Oct 15, 2024
6acc01e
Info about payment orders (#1140)
MadsNyl Oct 15, 2024
20eee85
updated changelog.md
MadsNyl Oct 15, 2024
05e9239
merge
MadsNyl Oct 15, 2024
e2ff2e9
Create new group (#1147)
MadsNyl Oct 22, 2024
8be00e3
Merge branch 'master' of https://github.com/TIHLDE/Kvark into dev
MadsNyl Oct 22, 2024
cd13d1b
Merge branch 'dev' of https://github.com/TIHLDE/Kvark into dev
MadsNyl Oct 22, 2024
c5418ab
updated changelog
MadsNyl Oct 22, 2024
f36e26d
Deleted unnecessary lines that caused the crash (#1151)
Alivki Oct 25, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
.env.development.local
.env.test.local
.env.production.local
a.json

*.log*
npm-debug.log*
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

## Neste versjon

## Versjon 2024.22.10

- ✨ **Gruppe**. HS kan nå opprette grupper.

## Versjon 2024.15.10

- ✨ **Betalinger**. Man kan nå se hvem på deltagerlisten som har betalt for arrangementet.
Expand Down
4 changes: 3 additions & 1 deletion src/AppRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const BadgesCategoryLeaderboard = lazy(() => import('pages/Badges/category/Badge
const Cheatsheet = lazy(() => import('pages/Cheatsheet'));
const EventAdministration = lazy(() => import('pages/EventAdministration'));
const EventRegistration = lazy(() => import('pages/EventRegistration'));
const NewGroupAdministration = lazy(() => import('pages/NewGroupAdministration'));
const ForgotPassword = lazy(() => import('pages/ForgotPassword'));
const Form = lazy(() => import('pages/Form'));
const FormAdmin = lazy(() => import('pages/Form/FormAdmin'));
Expand Down Expand Up @@ -154,10 +155,11 @@ const AppRoutes = () => {
<Route element={<AuthRoute element={<ShortLinks />} />} path={URLS.shortLinks} />
<Route element={<AuthRoute element={<QRCodes />} />} path={URLS.qrCodes} />
<Route element={<AuthRoute element={<Admissions />} />} path={URLS.admissions} />

<Route element={<AuthRoute apps={[PermissionApp.BANNERS]} element={<InfoBannerAdmin />} />} path={URLS.bannerAdmin}>
<Route element={<InfoBannerAdmin />} />
</Route>
<Route element={<AuthRoute apps={[PermissionApp.GROUP]} element={<NewGroupAdministration />} />} path={URLS.newGroupAdmin} />

<Route element={<AuthRoute apps={[PermissionApp.JOBPOST]} element={<JobPostAdministration />} />} path={URLS.jobpostsAdmin}>
<Route element={<JobPostAdministration />} path=':jobPostId/' />
</Route>
Expand Down
1 change: 1 addition & 0 deletions src/URLS.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const URLS = {
qrCodes: '/qr-koder/',
gallery: '/galleri/',
userAdmin: '/admin/brukere/',
newGroupAdmin: '/admin/ny-gruppe/',
strikeAdmin: '/admin/prikker/',
eventAdmin: '/admin/arrangementer/',
jobpostsAdmin: '/admin/karriere/',
Expand Down
1 change: 1 addition & 0 deletions src/api/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ export default {
getGroup: (slug: Group['slug']) => IFetch<Group>({ method: 'GET', url: `${GROUPS_ENDPOINT}/${slug}/` }),
getGroupStatistics: (slug: Group['slug']) => IFetch<GroupMemberStatistics>({ method: 'GET', url: `${GROUPS_ENDPOINT}/${slug}/statistics/` }),
updateGroup: (slug: Group['slug'], data: GroupMutate) => IFetch<Group>({ method: 'PUT', url: `${GROUPS_ENDPOINT}/${slug}/`, data }),
createGroup: (data: GroupMutate) => IFetch<Group>({ method: 'POST', url: `${GROUPS_ENDPOINT}/`, data }),

// Group laws
getGroupLaws: (groupSlug: Group['slug']) => IFetch<Array<GroupLaw>>({ method: 'GET', url: `${GROUPS_ENDPOINT}/${groupSlug}/${GROUP_LAWS_ENDPOINT}/` }),
Expand Down
12 changes: 12 additions & 0 deletions src/hooks/Group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { QueryKey, useInfiniteQuery, UseInfiniteQueryOptions, useMutation, UseMu

import {
Group,
GroupCreate,
GroupFine,
GroupFineBatchMutate,
GroupFineCreate,
Expand Down Expand Up @@ -224,3 +225,14 @@ export const useGroupForms = (groupSlug: string, enabled?: boolean) =>

export const useGroupStatistics = (groupSlug: string) =>
useQuery<GroupMemberStatistics, RequestResponse>(GROUPS_QUERY_KEYS.statistics(groupSlug), () => API.getGroupStatistics(groupSlug));

export const useCreateGroup = (): UseMutationResult<Group, RequestResponse, GroupCreate, unknown> => {
const queryClient = useQueryClient();

return useMutation((group) => API.createGroup(group), {
onSuccess: (data) => {
queryClient.invalidateQueries(GROUPS_QUERY_KEYS.all);
queryClient.setQueryData(GROUPS_QUERY_KEYS.detail(data.slug), data);
},
});
};
95 changes: 95 additions & 0 deletions src/pages/NewGroupAdministration/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import { zodResolver } from '@hookform/resolvers/zod';
import { useForm } from 'react-hook-form';
import { toast } from 'sonner';
import { z } from 'zod';

import { GroupCreate } from 'types';
import { GroupType } from 'types/Enums';

import { useCreateGroup } from 'hooks/Group';

import FormInput from 'components/inputs/Input';
import { FormSelect } from 'components/inputs/Select';
import { Button } from 'components/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from 'components/ui/card';
import { Form } from 'components/ui/form';

const schema = z.object({
name: z.string({ message: 'Gruppenavn er påkrevd' }),
slug: z.string({ message: 'Gruppeslug er påkrevd' }),
type: z.nativeEnum(GroupType, { message: 'Gruppetype er påkrevd' }),
});

export default function NewGroupAdministration() {
const createGroup = useCreateGroup();

const form = useForm<z.infer<typeof schema>>({
resolver: zodResolver(schema),
defaultValues: { name: '', slug: '', type: GroupType.BOARD },
});

const onSubmit = (values: z.infer<typeof schema>) => {
const data: GroupCreate = {
name: values.name,
slug: values.slug.toLowerCase(),
type: values.type,
};

createGroup.mutate(data, {
onSuccess: () => {
toast.success('Gruppen ble opprettet');
form.reset();
},
onError: (e) => {
Object.keys(e.detail).forEach((key: string) => {
if (key in data) {
const errorKey = key as keyof GroupCreate;
const errorMessage = (e.detail as unknown as Record<string, any>)[key];

Check warning on line 47 in src/pages/NewGroupAdministration/index.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected any. Specify a different type

Check warning on line 47 in src/pages/NewGroupAdministration/index.tsx

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected any. Specify a different type
form.setError(errorKey, { message: errorMessage });
}
});
toast.error('Det er en eller flere feil i skjemaet');
},
});
};

return (
<div className='max-w-5xl mx-auto pt-24 px-2'>
<Card>
<CardHeader>
<CardTitle>Opprett ny gruppe</CardTitle>
<CardDescription>Velg gruppetype og opprett en ny gruppe.</CardDescription>
</CardHeader>
<CardContent>
<Form {...form}>
<form className='space-y-4' onSubmit={form.handleSubmit(onSubmit)}>
<FormInput form={form} label='Gruppenavn' name='name' required />
<FormInput
description='En slug er en kort tekststreng som brukes i URL-adresser for å identifisere en spesifikk ressurs på en webside'
form={form}
label='Slug'
name='slug'
required
/>
<FormSelect
form={form}
label='Gruppetype'
name='type'
options={[
{ value: GroupType.BOARD, label: 'Styre' },
{ value: GroupType.SUBGROUP, label: 'Undergruppe' },
{ value: GroupType.COMMITTEE, label: 'Komité' },
{ value: GroupType.INTERESTGROUP, label: 'Interessegruppe' },
]}
required
/>
<Button type='submit' variant='default'>
Opprett Gruppe
</Button>
</form>
</Form>
</CardContent>
</Card>
</div>
);
}
9 changes: 8 additions & 1 deletion src/pages/Profile/components/ProfileAdmin.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Boxes, BriefcaseBusiness, Calendar, ChevronRightIcon, Grip, Info, LucideIcon, Newspaper, Users } from 'lucide-react';
import { Boxes, BriefcaseBusiness, Calendar, ChevronRightIcon, Grip, Info, LucideIcon, Newspaper, Plus, Users } from 'lucide-react';
import { Link } from 'react-router-dom';
import URLS from 'URLS';

Expand Down Expand Up @@ -86,6 +86,13 @@ const Admin = () => {
primary: 'Bannere',
secondary: 'Opprett, endre og slett bannere',
},
{
apps: [PermissionApp.GROUP],
icon: Plus,
to: URLS.newGroupAdmin,
primary: 'Ny gruppe',
secondary: 'Legg til en ny gruppe',
},
];

return (
Expand Down
6 changes: 6 additions & 0 deletions src/types/Group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ export type GroupMutate = Partial<Omit<Group, 'fines_admin' | 'permissions' | 't
fines_admin?: string | null;
};

export type GroupCreate = {
name: string;
slug: string;
type: GroupType;
};

export type Membership = {
user: UserBase | UserList;
membership_type: MembershipType;
Expand Down
Loading