From 132829f14f3ec23a0e5c7ecc323e911a5589fb29 Mon Sep 17 00:00:00 2001 From: Chris Amico Date: Tue, 2 Apr 2024 14:22:07 -0400 Subject: [PATCH] Update imports --- .../components/forms/DocumentUpload.svelte | 19 +++--- .../{common => forms}/Dropzone.svelte | 0 .../stories/Dropzone.stories.svelte | 2 +- src/routes/app/upload/+page.svelte | 65 +------------------ 4 files changed, 14 insertions(+), 72 deletions(-) rename src/lib/components/{common => forms}/Dropzone.svelte (100%) rename src/lib/components/{common => forms}/stories/Dropzone.stories.svelte (96%) diff --git a/src/lib/components/forms/DocumentUpload.svelte b/src/lib/components/forms/DocumentUpload.svelte index 00c11425e..e3e41d4e6 100644 --- a/src/lib/components/forms/DocumentUpload.svelte +++ b/src/lib/components/forms/DocumentUpload.svelte @@ -2,17 +2,18 @@ import { filesize } from "filesize"; import { _ } from "svelte-i18n"; import { File16, File24, Upload16, XCircleFill24 } from "svelte-octicons"; - import Dropzone from "../common/Dropzone.svelte"; - import Flex from "../common/Flex.svelte"; - import Field from "../common/Field.svelte"; - import FieldLabel from "../common/FieldLabel.svelte"; - import InputSelect from "../common/InputSelect.svelte"; - import Switch from "../common/Switch.svelte"; - import Premium from "../common/Premium.svelte"; + import Button from "../common/Button.svelte"; + import Dropzone from "./Dropzone.svelte"; import Empty from "../common/Empty.svelte"; - import InputText from "../common/InputText.svelte"; - import InputFile from "../common/InputFile.svelte"; + import Field from "./Field.svelte"; + import FieldLabel from "./FieldLabel.svelte"; + import Flex from "$lib/components/common/Flex.svelte"; + import InputFile from "./InputFile.svelte"; + import InputSelect from "./InputSelect.svelte"; + import InputText from "./InputText.svelte"; + import Premium from "../common/Premium.svelte"; + import Switch from "$lib/components/common/Switch.svelte"; import { removeUnsupportedTypes } from "@/lib/utils/validateFiles"; import AccessLevel from "../documents/AccessLevel.svelte"; diff --git a/src/lib/components/common/Dropzone.svelte b/src/lib/components/forms/Dropzone.svelte similarity index 100% rename from src/lib/components/common/Dropzone.svelte rename to src/lib/components/forms/Dropzone.svelte diff --git a/src/lib/components/common/stories/Dropzone.stories.svelte b/src/lib/components/forms/stories/Dropzone.stories.svelte similarity index 96% rename from src/lib/components/common/stories/Dropzone.stories.svelte rename to src/lib/components/forms/stories/Dropzone.stories.svelte index 429483cb2..5e179678c 100644 --- a/src/lib/components/common/stories/Dropzone.stories.svelte +++ b/src/lib/components/forms/stories/Dropzone.stories.svelte @@ -10,7 +10,7 @@ }; export const meta = { - title: "Components / Common / Dropzone", + title: "Components / Forms / Dropzone", component: Dropzone, tags: ["autodocs"], parameters: { layout: "centered" }, diff --git a/src/routes/app/upload/+page.svelte b/src/routes/app/upload/+page.svelte index f5aa19655..106a0862c 100644 --- a/src/routes/app/upload/+page.svelte +++ b/src/routes/app/upload/+page.svelte @@ -5,7 +5,8 @@ import { getContext } from "svelte"; - import { DOCUMENT_TYPES } from "@/config/config.js"; + import DocumentUpload from "$lib/components/forms/DocumentUpload.svelte"; + import { create, upload, process } from "$lib/api/documents"; const me: Writable = getContext("me"); @@ -14,16 +15,9 @@ $: documents = Array.from(files || []).map((file) => { return { - id: null, title: file.name, description: "", access: "private", - asset_url: "", - canonical_url: "", - created_at: new Date(), - edit_access: true, - data: {}, - user: $me, } as Document; }); @@ -32,57 +26,4 @@ Upload | DocumentCloud -
-

Upload

- -
-
- -
- -
- {#each documents || [] as doc, i} - {@const file = files[i]} -

{file.name}

- - - - {/each} -
- -
- -
-
-
- - +