From c89d4eb87f220524737df39775f08d7ec6be2aa2 Mon Sep 17 00:00:00 2001 From: Marvin Fischer Date: Sat, 13 Sep 2025 15:38:47 +0200 Subject: [PATCH 1/6] set dialog size to fixed size, add helper makefile (linux), add helper css class, removed the scrolling bar from the edit content dialog sub-actions --- Makefile | 31 + components/DialogBase.tsx | 8 +- components/EditChapterButton.tsx | 3 +- components/EditContentModal.tsx | 4 +- components/EditCourseModal.tsx | 2 + components/Form.tsx | 2 +- components/dialogs/chapterDialog.ts | 1 + package-lock.json | 12340 ++++++++++++++++++++++++++ src/schema.graphql | 68 +- styles/globals.css | 3 + 10 files changed, 12412 insertions(+), 50 deletions(-) create mode 100644 Makefile create mode 100644 package-lock.json diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..dcc2ce85 --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +ProjectName := gits +ComposeFile := docker-compose.yml +KeycloakContainer := keycloak +FrontendContainer := frontend + +start-docker: + docker compose -f $(ComposeFile) --project-name $(ProjectName) up -d +build-docker: + docker compose -f $(ComposeFile) --project-name $(ProjectName) build +stop-docker: + docker compose -f $(ComposeFile) --project-name $(ProjectName) down +status-docker: + docker compose -f $(ComposeFile) --project-name $(ProjectName) ps +keycloak-start: + docker compose -f $(ComposeFile) --project-name $(ProjectName) up -d $(KeycloakContainer) +keycloak-build: + docker compose -f $(ComposeFile) --project-name $(ProjectName) build $(KeycloakContainer) +keycloak-stop: + docker compose -f $(ComposeFile) --project-name $(ProjectName) stop $(KeycloakContainer) +frontend-start: + docker compose -f $(ComposeFile) --project-name $(ProjectName) up -d $(FrontendContainer) +frontend-build: + docker compose -f $(ComposeFile) --project-name $(ProjectName) build $(FrontendContainer) +frontend-stop: + docker compose -f $(ComposeFile) --project-name $(ProjectName) stop $(FrontendContainer) +frontend-dev: + npm run dev +frontend-prepare: + npm install + npm run relay + npm run update-schema diff --git a/components/DialogBase.tsx b/components/DialogBase.tsx index 87ca9397..34f14dfc 100644 --- a/components/DialogBase.tsx +++ b/components/DialogBase.tsx @@ -10,7 +10,6 @@ import { import { DatePicker } from "@mui/x-date-pickers/DatePicker"; import { Dayjs } from "dayjs"; import { FormikProps, useFormik } from "formik"; -import { useEffect, useState } from "react"; import { ObjectSchema } from "yup"; import { Form, FormSection } from "./Form"; import { FormErrors } from "./FormErrors"; @@ -22,6 +21,7 @@ export type FieldOptions = { } & ( | { type: "text"; + fullWidth?: boolean; multiline?: boolean; } | { @@ -73,9 +73,9 @@ export function DialogBase({ }); return ( - + {title} - +
{sections.map((section) => ( @@ -147,7 +147,7 @@ function Field({ helperText={errorText} required={field.required} multiline={field.multiline} - fullWidth={field.multiline} + fullWidth={field.fullWidth ? field.fullWidth : field.multiline} /> ); case "date": diff --git a/components/EditChapterButton.tsx b/components/EditChapterButton.tsx index dfe82718..8b7c3f78 100644 --- a/components/EditChapterButton.tsx +++ b/components/EditChapterButton.tsx @@ -5,12 +5,13 @@ import { useMemo, useState } from "react"; import { useFragment, useMutation } from "react-relay"; import { graphql } from "relay-runtime"; -import { EditChapterButtonMutation } from "@/__generated__/EditChapterButtonMutation.graphql"; import { EditChapterButtonDeleteMutation } from "@/__generated__/EditChapterButtonDeleteMutation.graphql"; import { EditChapterButtonFragment$key } from "@/__generated__/EditChapterButtonFragment.graphql"; +import { EditChapterButtonMutation } from "@/__generated__/EditChapterButtonMutation.graphql"; import { DialogBase } from "./DialogBase"; import { dialogSections, validationSchema } from "./dialogs/chapterDialog"; + export default function EditChapterButton({ courseId, _chapter, diff --git a/components/EditContentModal.tsx b/components/EditContentModal.tsx index 7847f6d9..31ddecce 100644 --- a/components/EditContentModal.tsx +++ b/components/EditContentModal.tsx @@ -313,8 +313,8 @@ export function EditContentModal({ })} - - + + { /* Add flex with 0 base to avoid a scrollbar at the Add content elements */} {/* add flashcard button */}