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..58117804 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..9dec40c8 100644 --- a/components/EditChapterButton.tsx +++ b/components/EditChapterButton.tsx @@ -5,9 +5,9 @@ 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"; @@ -55,6 +55,7 @@ export default function EditChapterButton({ ); const [error, setError] = useState(null); + const sections = useMemo( () => dialogSections( @@ -63,6 +64,7 @@ export default function EditChapterButton({ ), [chapter.course] ); + const schema = useMemo( () => validationSchema(chapter.course.startDate, chapter.course.endDate), [chapter.course] diff --git a/components/EditContentModal.tsx b/components/EditContentModal.tsx index 7847f6d9..63c7e6a9 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 */}