-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WEB-3096] feat: stickies page (#6380)
* feat: added independent stickies page * chore: randomized sticky color * chore: search in stickies * feat: dnd * fix: quick links * fix: stickies abrupt rendering * fix: handled edge cases for dnd * fix: empty states * fix: build and lint * fix: handled new sticky when last sticky is emoty * fix: new sticky condition * refactor: stickies empty states, store * chore: update stickies empty states * fix: random sticky color * fix: header * refactor: better error handling --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com> Co-authored-by: Aaryan Khandelwal <aaryankhandu123@gmail.com>
- Loading branch information
1 parent
d2c9b43
commit fd7eedc
Showing
56 changed files
with
1,347 additions
and
574 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 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 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.