From 79b7e20230f9c7d546af6fd4de66587dbcb3b9ce Mon Sep 17 00:00:00 2001 From: Bilal ABBAD Date: Fri, 20 Sep 2024 16:28:48 +0200 Subject: [PATCH] Add cancel button in repository form (#4403) --- changelog/4402.fixed.md | 1 + .../screens/repository/repository-form.tsx | 22 ++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 changelog/4402.fixed.md diff --git a/changelog/4402.fixed.md b/changelog/4402.fixed.md new file mode 100644 index 0000000000..a630f1cf65 --- /dev/null +++ b/changelog/4402.fixed.md @@ -0,0 +1 @@ +Added cancel button in repository form diff --git a/frontend/app/src/screens/repository/repository-form.tsx b/frontend/app/src/screens/repository/repository-form.tsx index d111ebb47d..4406d7c6ec 100644 --- a/frontend/app/src/screens/repository/repository-form.tsx +++ b/frontend/app/src/screens/repository/repository-form.tsx @@ -14,8 +14,16 @@ import { DynamicInput } from "@/components/form/dynamic-form"; import { NodeFormProps } from "@/components/form/node-form"; import { createObject } from "@/graphql/mutations/objects/createObject"; import RelationshipField from "@/components/form/fields/relationship.field"; - -const RepositoryForm = ({ onSuccess, schema, currentObject, onSubmit }: NodeFormProps) => { +import { Button } from "@/components/buttons/button-primitive"; +import React from "react"; + +const RepositoryForm = ({ + onSuccess, + schema, + currentObject, + onSubmit, + onCancel, +}: NodeFormProps) => { const branch = useAtomValue(currentBranchAtom); const date = useAtomValue(datetimeAtom); const auth = useAuth(); @@ -95,7 +103,15 @@ const RepositoryForm = ({ onSuccess, schema, currentObject, onSubmit }: NodeForm )} - Save +
+ {onCancel && ( + + )} + + Save +
); };