diff --git a/src/lib/components/layouts/DocumentLayout.svelte b/src/lib/components/layouts/DocumentLayout.svelte index 1c02925bb..b3724dfab 100644 --- a/src/lib/components/layouts/DocumentLayout.svelte +++ b/src/lib/components/layouts/DocumentLayout.svelte @@ -12,7 +12,7 @@ Assumes it's a child of a ViewerContext import { _ } from "svelte-i18n"; import Actions from "../documents/Actions.svelte"; - import AddOns from "$lib/components/common/AddOns.svelte"; + import AddOns from "@/lib/components/sidebar/AddOns.svelte"; import Avatar from "../accounts/Avatar.svelte"; import Data from "../documents/Data.svelte"; import DocumentHeader from "../documents/Header.svelte"; diff --git a/src/lib/components/layouts/Project.svelte b/src/lib/components/layouts/Project.svelte index 478139530..467fcaff0 100644 --- a/src/lib/components/layouts/Project.svelte +++ b/src/lib/components/layouts/Project.svelte @@ -9,7 +9,7 @@ Project, ProjectUser, } from "$lib/api/types"; - import AddOns from "$lib/components/common/AddOns.svelte"; + import AddOns from "@/lib/components/sidebar/AddOns.svelte"; import Collaborators from "$lib/components/projects/Collaborators.svelte"; import ProjectActions from "$lib/components/projects/ProjectActions.svelte"; import ProjectHeader from "$lib/components/projects/ProjectHeader.svelte"; diff --git a/src/lib/components/layouts/stories/AppLayout.stories.svelte b/src/lib/components/layouts/stories/AppLayout.stories.svelte index 090437329..445a5ad7c 100644 --- a/src/lib/components/layouts/stories/AppLayout.stories.svelte +++ b/src/lib/components/layouts/stories/AppLayout.stories.svelte @@ -6,12 +6,12 @@ import DocumentBrowser from "../DocumentBrowser.svelte"; import SidebarLayout from "../SidebarLayout.svelte"; - import Documents from "@/routes/(app)/documents/sidebar/Documents.svelte"; - import Projects from "@/routes/(app)/documents/sidebar/Projects.svelte"; + import Documents from "@/lib/components/sidebar/Documents.svelte"; + import Projects from "@/lib/components/sidebar/Projects.svelte"; import Button from "../../common/Button.svelte"; import { PlusCircle16 } from "svelte-octicons"; import BulkActions from "$lib/components/documents/BulkActions.svelte"; - import AddOns from "$lib/components/common/AddOns.svelte"; + import AddOns from "@/lib/components/sidebar/AddOns.svelte"; import { documentsList } from "@/test/fixtures/documents"; import { addons } from "@/test/handlers/addons"; diff --git a/src/lib/components/layouts/stories/SidebarLayout.stories.svelte b/src/lib/components/layouts/stories/SidebarLayout.stories.svelte index cfbe4faf5..aa5afb59e 100644 --- a/src/lib/components/layouts/stories/SidebarLayout.stories.svelte +++ b/src/lib/components/layouts/stories/SidebarLayout.stories.svelte @@ -6,12 +6,11 @@ import SidebarLayout from "../SidebarLayout.svelte"; import DocumentBrowser from "../DocumentBrowser.svelte"; + import AddOns from "@/lib/components/sidebar/AddOns.svelte"; import Button from "$lib/components/common/Button.svelte"; - import BulkActions from "$lib/components/documents/BulkActions.svelte"; - import AddOns from "@/lib/components/common/AddOns.svelte"; - import Documents from "@/routes/(app)/documents/sidebar/Documents.svelte"; - import Projects from "@/routes/(app)/documents/sidebar/Projects.svelte"; + import Documents from "$lib/components/sidebar/Documents.svelte"; + import Projects from "$lib/components/sidebar/Projects.svelte"; import { documentsList } from "@/test/fixtures/documents"; import { activeAddons } from "@/test/fixtures/addons"; diff --git a/src/lib/components/projects/ProjectActions.svelte b/src/lib/components/projects/ProjectActions.svelte index b92545f61..be1c36e02 100644 --- a/src/lib/components/projects/ProjectActions.svelte +++ b/src/lib/components/projects/ProjectActions.svelte @@ -48,20 +48,9 @@ function hide() { show = null; } - - function onUploadClick() { - $uploadToProject = project; - goto("/upload/"); - }
- {#if isSignedIn($me) && canUploadFiles($me) && project.edit_access} - - {/if} - {#if project.edit_access || project.add_remove_access}
@@ -86,10 +75,6 @@ - -
diff --git a/src/lib/components/common/AddOns.svelte b/src/lib/components/sidebar/AddOns.svelte similarity index 98% rename from src/lib/components/common/AddOns.svelte rename to src/lib/components/sidebar/AddOns.svelte index 4363eecae..83bf6cf13 100644 --- a/src/lib/components/common/AddOns.svelte +++ b/src/lib/components/sidebar/AddOns.svelte @@ -19,7 +19,7 @@ import SidebarGroup from "$lib/components/sidebar/SidebarGroup.svelte"; import Pin from "$lib/components/common/Pin.svelte"; import Tooltip from "$lib/components/common/Tooltip.svelte"; - import Error from "./Error.svelte"; + import Error from "../common/Error.svelte"; export let pinnedAddOns: Promise>>; export let query: string = ""; diff --git a/src/routes/(app)/documents/sidebar/Documents.svelte b/src/lib/components/sidebar/Documents.svelte similarity index 84% rename from src/routes/(app)/documents/sidebar/Documents.svelte rename to src/lib/components/sidebar/Documents.svelte index fb74e5771..34fe97d6a 100644 --- a/src/routes/(app)/documents/sidebar/Documents.svelte +++ b/src/lib/components/sidebar/Documents.svelte @@ -5,6 +5,7 @@ import { getContext } from "svelte"; import { _ } from "svelte-i18n"; import { + Search16, File16, Globe16, Infinity16, @@ -21,6 +22,9 @@ import { slugify } from "$lib/utils/slugify"; import { userDocs } from "$lib/utils/search"; import { getCurrentUser } from "@/lib/utils/permissions"; + import SidebarGroup from "@/lib/components/sidebar/SidebarGroup.svelte"; + import { size } from "lodash-es"; + import Button from "@/lib/components/common/Button.svelte"; const me = getCurrentUser(); const org: Writable = getContext("org"); @@ -43,7 +47,14 @@ } - + + + Documents + + {$_("documents.allDocuments", { @@ -86,4 +97,4 @@ {/if} - + diff --git a/src/routes/(app)/documents/sidebar/Projects.svelte b/src/lib/components/sidebar/Projects.svelte similarity index 100% rename from src/routes/(app)/documents/sidebar/Projects.svelte rename to src/lib/components/sidebar/Projects.svelte diff --git a/src/lib/components/common/stories/AddOns.stories.svelte b/src/lib/components/sidebar/stories/AddOns.stories.svelte similarity index 100% rename from src/lib/components/common/stories/AddOns.stories.svelte rename to src/lib/components/sidebar/stories/AddOns.stories.svelte diff --git a/src/routes/(app)/documents/+page.svelte b/src/routes/(app)/documents/+page.svelte index 943cde5f1..531180248 100644 --- a/src/routes/(app)/documents/+page.svelte +++ b/src/routes/(app)/documents/+page.svelte @@ -3,14 +3,14 @@ import { _ } from "svelte-i18n"; import { PlusCircle16 } from "svelte-octicons"; - import AddOns from "$lib/components/common/AddOns.svelte"; + import AddOns from "@/lib/components/sidebar/AddOns.svelte"; import Button from "$lib/components/common/Button.svelte"; import SignedIn from "$lib/components/common/SignedIn.svelte"; import SidebarLayout from "$lib/components/layouts/SidebarLayout.svelte"; import BulkActions from "@/lib/components/documents/BulkActions.svelte"; - import Documents from "../documents/sidebar/Documents.svelte"; - import Projects from "../documents/sidebar/Projects.svelte"; + import Documents from "$lib/components/sidebar/Documents.svelte"; + import Projects from "$lib/components/sidebar/Projects.svelte"; import DocumentBrowser from "$lib/components/layouts/DocumentBrowser.svelte"; import GuidedTour from "$lib/components/onboarding/GuidedTour.svelte"; diff --git a/src/routes/(app)/upload/+page.svelte b/src/routes/(app)/upload/+page.svelte index 04a73abe2..f699eece1 100644 --- a/src/routes/(app)/upload/+page.svelte +++ b/src/routes/(app)/upload/+page.svelte @@ -1,14 +1,11 @@