-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[WEB-3096] feat: stickies page #6380
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
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
efcfd69
feat: added independent stickies page
gakshita 3e5e506
chore: randomized sticky color
gakshita 1c912f9
chore: search in stickies
NarayanBavisetti d28563e
Merge branch 'preview' of github.com:makeplane/plane into feat-sticki…
NarayanBavisetti 67de985
feat: dnd
gakshita aca7e0e
Merge branch 'feat-stickies-page' of https://github.com/makeplane/pla…
gakshita ed73865
fix: quick links
gakshita 1fe548a
fix: stickies abrupt rendering
gakshita 45c1099
fix: handled edge cases for dnd
gakshita f7c6b03
fix: empty states
gakshita 0b2987f
fix: build and lint
gakshita 4ea7f4d
fix: handled new sticky when last sticky is emoty
gakshita 323089c
Merge branch 'preview' of https://github.com/makeplane/plane into fea…
aaryan610 4177b84
fix: new sticky condition
gakshita 6336a8c
Merge branch 'feat-stickies-page' of https://github.com/makeplane/pla…
gakshita 5537d48
refactor: stickies empty states, store
aaryan610 91d3e5c
fix: merge conflicts resolved
aaryan610 842407b
Merge branch 'preview' of https://github.com/makeplane/plane into fea…
aaryan610 55e7c33
chore: update stickies empty states
aaryan610 1ce00d8
fix: random sticky color
aaryan610 8bde781
fix: header
aaryan610 6164f21
refactor: better error handling
aaryan610 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const STICKIES_PER_PAGE = 30; |
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,8 +1,16 @@ | ||
| import { TLogoProps } from "./common"; | ||
|
|
||
| export type TSticky = { | ||
| created_at?: string | undefined; | ||
| created_by?: string | undefined; | ||
| background_color?: string | null | undefined; | ||
| description?: object | undefined; | ||
| description_html?: string | undefined; | ||
| id: string; | ||
| logo_props: TLogoProps | undefined; | ||
| name?: string; | ||
| description_html?: string; | ||
| color?: string; | ||
| createdAt?: Date; | ||
| updatedAt?: Date; | ||
| sort_order: number | undefined; | ||
| updated_at?: string | undefined; | ||
| updated_by?: string | undefined; | ||
| workspace: string | undefined; | ||
| }; |
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,59 @@ | ||
| "use client"; | ||
|
|
||
| import { observer } from "mobx-react"; | ||
| // ui | ||
| import { useParams } from "next/navigation"; | ||
| import { Breadcrumbs, Button, Header, RecentStickyIcon } from "@plane/ui"; | ||
| // components | ||
| import { BreadcrumbLink } from "@/components/common"; | ||
|
|
||
| // hooks | ||
| import { StickySearch } from "@/components/stickies/modal/search"; | ||
| import { useStickyOperations } from "@/components/stickies/sticky/use-operations"; | ||
| // plane-web | ||
| import { useSticky } from "@/hooks/use-stickies"; | ||
|
|
||
| export const WorkspaceStickyHeader = observer(() => { | ||
| const { workspaceSlug } = useParams(); | ||
| // hooks | ||
| const { creatingSticky, toggleShowNewSticky } = useSticky(); | ||
| const { stickyOperations } = useStickyOperations({ workspaceSlug: workspaceSlug?.toString() }); | ||
|
|
||
| return ( | ||
| <> | ||
| <Header> | ||
| <Header.LeftItem> | ||
| <div className="flex items-center gap-2.5"> | ||
| <Breadcrumbs> | ||
| <Breadcrumbs.BreadcrumbItem | ||
| type="text" | ||
| link={ | ||
| <BreadcrumbLink | ||
| label={`Stickies`} | ||
| icon={<RecentStickyIcon className="size-5 rotate-90 text-custom-text-200" />} | ||
| /> | ||
| } | ||
| /> | ||
| </Breadcrumbs> | ||
| </div> | ||
| </Header.LeftItem> | ||
|
|
||
| <Header.RightItem> | ||
| <StickySearch /> | ||
| <Button | ||
| variant="primary" | ||
| size="sm" | ||
| className="items-center gap-1" | ||
| onClick={() => { | ||
| toggleShowNewSticky(true); | ||
| stickyOperations.create(); | ||
| }} | ||
| loading={creatingSticky} | ||
| > | ||
| Add sticky | ||
| </Button> | ||
| </Header.RightItem> | ||
| </Header> | ||
| </> | ||
| ); | ||
| }); | ||
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,13 @@ | ||
| "use client"; | ||
|
|
||
| import { AppHeader, ContentWrapper } from "@/components/core"; | ||
| import { WorkspaceStickyHeader } from "./header"; | ||
|
|
||
| export default function WorkspaceStickiesLayout({ children }: { children: React.ReactNode }) { | ||
| return ( | ||
| <> | ||
| <AppHeader header={<WorkspaceStickyHeader />} /> | ||
| <ContentWrapper>{children}</ContentWrapper> | ||
| </> | ||
| ); | ||
| } |
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,16 @@ | ||
| "use client"; | ||
|
|
||
| // components | ||
| import { PageHead } from "@/components/core"; | ||
| import { StickiesInfinite } from "@/components/stickies"; | ||
|
|
||
| export default function WorkspaceStickiesPage() { | ||
| return ( | ||
| <> | ||
| <PageHead title="Your stickies" /> | ||
| <div className="relative h-full w-full overflow-hidden overflow-y-auto"> | ||
| <StickiesInfinite /> | ||
| </div> | ||
| </> | ||
| ); | ||
| } |
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
78 changes: 78 additions & 0 deletions
78
web/core/components/editor/sticky-editor/color-palette.tsx
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,78 @@ | ||
| import { TSticky } from "@plane/types"; | ||
|
|
||
| export const STICKY_COLORS_LIST: { | ||
| key: string; | ||
| label: string; | ||
| backgroundColor: string; | ||
| }[] = [ | ||
| { | ||
| key: "gray", | ||
| label: "Gray", | ||
| backgroundColor: "var(--editor-colors-gray-background)", | ||
| }, | ||
| { | ||
| key: "peach", | ||
| label: "Peach", | ||
| backgroundColor: "var(--editor-colors-peach-background)", | ||
| }, | ||
| { | ||
| key: "pink", | ||
| label: "Pink", | ||
| backgroundColor: "var(--editor-colors-pink-background)", | ||
| }, | ||
| { | ||
| key: "orange", | ||
| label: "Orange", | ||
| backgroundColor: "var(--editor-colors-orange-background)", | ||
| }, | ||
| { | ||
| key: "green", | ||
| label: "Green", | ||
| backgroundColor: "var(--editor-colors-green-background)", | ||
| }, | ||
| { | ||
| key: "light-blue", | ||
| label: "Light blue", | ||
| backgroundColor: "var(--editor-colors-light-blue-background)", | ||
| }, | ||
| { | ||
| key: "dark-blue", | ||
| label: "Dark blue", | ||
| backgroundColor: "var(--editor-colors-dark-blue-background)", | ||
| }, | ||
| { | ||
| key: "purple", | ||
| label: "Purple", | ||
| backgroundColor: "var(--editor-colors-purple-background)", | ||
| }, | ||
| ]; | ||
|
|
||
| type TProps = { | ||
| handleUpdate: (data: Partial<TSticky>) => Promise<void>; | ||
| }; | ||
|
|
||
| export const ColorPalette = (props: TProps) => { | ||
| const { handleUpdate } = props; | ||
| return ( | ||
| <div className="absolute z-10 bottom-5 left-0 w-56 shadow p-2 rounded-md bg-custom-background-100 mb-2"> | ||
| <div className="text-sm font-semibold text-custom-text-400 mb-2">Background colors</div> | ||
| <div className="flex flex-wrap gap-2"> | ||
| {STICKY_COLORS_LIST.map((color) => ( | ||
| <button | ||
| key={color.key} | ||
| type="button" | ||
| onClick={() => { | ||
| handleUpdate({ | ||
| background_color: color.key, | ||
| }); | ||
| }} | ||
| className="h-6 w-6 rounded-md hover:ring-2 hover:ring-custom-primary focus:outline-none focus:ring-2 focus:ring-custom-primary transition-all" | ||
| style={{ | ||
| backgroundColor: color.backgroundColor, | ||
| }} | ||
| /> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; |
36 changes: 0 additions & 36 deletions
36
web/core/components/editor/sticky-editor/color-pallete.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.