diff --git a/frontend/src/components/CommitCard.tsx b/frontend/src/components/CommitCard.tsx
index ab2e2443..ef3dfe51 100644
--- a/frontend/src/components/CommitCard.tsx
+++ b/frontend/src/components/CommitCard.tsx
@@ -16,7 +16,7 @@ import { Card, CardProps } from "react-daisyui";
export type ICommitCardProps = CardProps & {
commit: ICommit;
onActivate?: (commit: ICommit) => void;
- onDeleteRequested?: (id: string) => void;
+ onDeleteRequested?: (section: ISection) => void;
};
export default (props: ICommitCardProps) => {
@@ -33,14 +33,17 @@ export default (props: ICommitCardProps) => {
onClick={(e) => {
e.stopPropagation();
if (props.onDeleteRequested)
- return props.onDeleteRequested(props.commit.id);
+ return props.onDeleteRequested(
+ props.commit.section
+ );
}}
className="px-1"
icon={faTrashCan}
/>
- {props.commit.packages.length} packages
+ {props.commit.packages.length} package
+ {props.commit.packages.length == 1 ? "" : "s"}
diff --git a/frontend/src/components/CommitDrawer.tsx b/frontend/src/components/CommitDrawer.tsx
new file mode 100644
index 00000000..3fb5040f
--- /dev/null
+++ b/frontend/src/components/CommitDrawer.tsx
@@ -0,0 +1,54 @@
+import { Button, Drawer, DrawerProps, Menu } from "react-daisyui";
+import CommitCard from "./CommitCard";
+
+type CommitDrawerProps = DrawerProps & {
+ isOpen: boolean;
+ commits: ICommit[];
+ onPush: (commits: ICommit[]) => void;
+ onCardActivate: (commit: ICommit) => void;
+ onCardDelete: (section: ISection) => void;
+};
+
+export default (props: CommitDrawerProps) => {
+ return (
+ 0 && props.isOpen}
+ contentClassName="fm-content h-full"
+ className="h-full"
+ side={
+
+
+
+
+ }
+ end={true}
+ />
+ );
+};
diff --git a/frontend/src/components/CommitModal.tsx b/frontend/src/components/CommitModal.tsx
index 5c5f573f..9ab654a0 100644
--- a/frontend/src/components/CommitModal.tsx
+++ b/frontend/src/components/CommitModal.tsx
@@ -13,34 +13,32 @@ import {
} from "@fortawesome/free-solid-svg-icons";
import { toast } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
-import * as uuid from "uuid";
import { forwardRef, useCallback, useEffect, useState } from "react";
import { createPortal } from "react-dom";
import SectionSelect from "./SectionSelect";
+import Dropzone from "react-dropzone";
export type CommitModalProps = ModalProps & {
isNew?: boolean;
commit?: ICommit;
sections?: ISection[];
onCommitSubmit?: (commit: ICommit) => void;
- onCommitDelete?: (id: string) => void;
+ onCommitDelete?: (section: ISection) => void;
+ onPackageDrop?: (files: File[]) => void;
};
export default forwardRef(
(props: CommitModalProps, ref) => {
const [commit, setCommit] = useState(
- props.commit || { id: uuid.v4(), section: {}, packages: [] }
+ props.commit || { section: {}, packages: [] }
);
useEffect(
- () =>
- setCommit(
- props.commit || { id: uuid.v4(), section: {}, packages: [] }
- ),
+ () => setCommit(props.commit || { section: {}, packages: [] }),
[props.commit]
);
- const { id, section, packages } = commit;
+ const { section, packages } = commit;
const { branch, repository, architecture } = section;
@@ -55,57 +53,66 @@ export default forwardRef(
Commit
-
-
- {
- setCommit({ ...commit, section: section });
- }}
- />
-
+
+ {({ getRootProps, getInputProps }) => (
+
+
+
+ {
+ setCommit({
+ ...commit,
+ section: section
+ });
+ }}
+ />
+
-
-
- Name
-
-
-
- {props.commit?.packages.map((value) => {
- return (
-
-
-
- {value.signatureFile !==
- undefined && (
-
- )}
-
- {value.name}
-
-
-
- );
- })}
-
-
-
-
+
+
+ Name
+
+
+
+ {props.commit?.packages.map((value) => {
+ return (
+
+
+
+ {value.signatureFile !==
+ undefined && (
+
+ )}
+ {value.name}
+
+
+
+ );
+ })}
+
+
+
+
+ )}
+