-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Folder updates #2942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Folder updates #2942
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f6068f9
WIP folder updates
TWilson023 052f140
More folder updates
TWilson023 9c861d6
Merge branch 'main' into folder-updates
TWilson023 9a3df65
Quick fixes
TWilson023 d2810f8
Quick fixes
TWilson023 3927e3a
Update add-folder-form.tsx
TWilson023 4ff2279
Fix build
TWilson023 894e8f2
Merge branch 'main' into folder-updates
steven-tey f54b0e9
change description to @db.Text instead of varchar
steven-tey 43d9a0e
update folder tests
steven-tey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,5 @@ | ||
| import { FolderDropdown } from "@/ui/folders/folder-dropdown"; | ||
| import { PageContent } from "@/ui/layout/page-content"; | ||
| import WorkspaceLinksClient, { | ||
| WorkspaceLinksPageControls, | ||
| } from "./page-client"; | ||
| import WorkspaceLinksClient from "./page-client"; | ||
|
|
||
| export default function WorkspaceLinks() { | ||
| return ( | ||
| <PageContent | ||
| title={ | ||
| <div className="-ml-2"> | ||
| <FolderDropdown hideFolderIcon={true} /> | ||
| </div> | ||
| } | ||
| controls={<WorkspaceLinksPageControls />} | ||
| > | ||
| <WorkspaceLinksClient /> | ||
| </PageContent> | ||
| ); | ||
| return <WorkspaceLinksClient />; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| import { FolderUser } from "@/lib/types"; | ||
| import { fetcher } from "@dub/utils"; | ||
| import useSWR, { SWRConfiguration } from "swr"; | ||
| import { getPlanCapabilities } from "../plan-capabilities"; | ||
| import useWorkspace from "./use-workspace"; | ||
|
|
||
| export function useFolderUsers( | ||
| { | ||
| folderId, | ||
| enabled = true, | ||
| }: { | ||
| folderId?: string | null; | ||
| enabled?: boolean; | ||
| }, | ||
| swrOpts?: SWRConfiguration, | ||
| ) { | ||
| const { id: workspaceId, plan } = useWorkspace(); | ||
| const { canManageFolderPermissions } = getPlanCapabilities(plan); | ||
|
|
||
| const { | ||
| data: users, | ||
| isValidating, | ||
| isLoading, | ||
| } = useSWR<FolderUser[]>( | ||
| enabled && | ||
| workspaceId && | ||
| canManageFolderPermissions && | ||
| folderId && | ||
| folderId !== "unsorted" | ||
| ? `/api/folders/${folderId}/users?workspaceId=${workspaceId}` | ||
| : undefined, | ||
| fetcher, | ||
| { | ||
| revalidateOnFocus: false, | ||
| keepPreviousData: true, | ||
| ...swrOpts, | ||
| }, | ||
| ); | ||
|
|
||
| return { | ||
| users, | ||
| isValidating, | ||
| isLoading, | ||
| }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.