-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[WEB-3088] fix: home edits #6357
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
10 commits
Select commit
Hold shift + click to select a range
6050eea
fix: added delete sticky confirmation modal
gakshita de9d05a
fix: prevented quick links reordering
gakshita d172482
fix: quick links css
gakshita f6dfabb
fix: minor css
gakshita 96795fc
fix: empty states
gakshita 57ac82b
Filter quick_tutorial and new_at_plane
sangeethailango 5bafee2
fix: stickies search backend change
gakshita 84ac678
Merge branch 'fix-home-edits' of https://github.com/makeplane/plane i…
gakshita 831662f
fix: stickies editor enhanced
gakshita 756fe85
fix: sticky delete function
gakshita 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| import { ReactNode, useEffect, useRef, useState } from "react"; | ||
| import { observer } from "mobx-react"; | ||
| import { cn } from "@plane/utils"; | ||
|
|
||
| interface IContentOverflowWrapper { | ||
| children: ReactNode; | ||
| maxHeight?: number; | ||
| gradientColor?: string; | ||
| buttonClassName?: string; | ||
| containerClassName?: string; | ||
| fallback?: ReactNode; | ||
| } | ||
|
|
||
| export const ContentOverflowWrapper = observer((props: IContentOverflowWrapper) => { | ||
| const { | ||
| children, | ||
| maxHeight = 625, | ||
| buttonClassName = "text-sm font-medium text-custom-primary-100", | ||
| containerClassName, | ||
| fallback = null, | ||
| } = props; | ||
|
|
||
| // states | ||
| const [containerHeight, setContainerHeight] = useState(0); | ||
| const [showAll, setShowAll] = useState(false); | ||
|
|
||
| // refs | ||
| const contentRef = useRef<HTMLDivElement>(null); | ||
|
|
||
| useEffect(() => { | ||
| if (!contentRef?.current) return; | ||
|
|
||
| const updateHeight = () => { | ||
| if (contentRef.current) { | ||
| const height = contentRef.current.getBoundingClientRect().height; | ||
| setContainerHeight(height); | ||
| } | ||
| }; | ||
|
|
||
| // Initial height measurement | ||
| updateHeight(); | ||
|
|
||
| // Create ResizeObserver for size changes | ||
| const resizeObserver = new ResizeObserver(updateHeight); | ||
| resizeObserver.observe(contentRef.current); | ||
|
|
||
| // Create MutationObserver for content changes | ||
| const mutationObserver = new MutationObserver((mutations) => { | ||
| const shouldUpdate = mutations.some( | ||
| (mutation) => | ||
| mutation.type === "childList" || | ||
| (mutation.type === "attributes" && (mutation.attributeName === "style" || mutation.attributeName === "class")) | ||
| ); | ||
|
|
||
| if (shouldUpdate) { | ||
| updateHeight(); | ||
| } | ||
| }); | ||
|
|
||
| mutationObserver.observe(contentRef.current, { | ||
| childList: true, | ||
| subtree: true, | ||
| attributes: true, | ||
| attributeFilter: ["style", "class"], | ||
| }); | ||
|
|
||
| return () => { | ||
| resizeObserver.disconnect(); | ||
| mutationObserver.disconnect(); | ||
| }; | ||
| }, [contentRef?.current]); | ||
|
|
||
| if (!children) return fallback; | ||
|
|
||
| return ( | ||
| <div | ||
| className={cn( | ||
| "relative", | ||
| { | ||
| [`overflow-hidden`]: !showAll, | ||
| "overflow-visible": showAll, | ||
| }, | ||
| containerClassName | ||
| )} | ||
| style={{ maxHeight: showAll ? "100%" : `${maxHeight}px` }} | ||
| > | ||
| <div ref={contentRef}>{children}</div> | ||
|
|
||
| {containerHeight > maxHeight && ( | ||
| <div | ||
| className={cn( | ||
| "bottom-0 left-0 w-full", | ||
| `bg-gradient-to-t from-custom-background-100 to-transparent flex flex-col items-center justify-end`, | ||
| "text-center", | ||
| { | ||
| "absolute h-[100px]": !showAll, | ||
| "h-[30px]": showAll, | ||
| } | ||
| )} | ||
| > | ||
| <button | ||
| className={cn("gap-1 w-full text-custom-primary-100 text-sm font-medium", buttonClassName)} | ||
| onClick={() => setShowAll((prev) => !prev)} | ||
| > | ||
| {showAll ? "Show less" : "Show all"} | ||
| </button> | ||
| </div> | ||
| )} | ||
| </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
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
| import { Link2, Plus } from "lucide-react"; | ||
| import { Button } from "@plane/ui"; | ||
|
|
||
| type TProps = { | ||
| handleCreate: () => void; | ||
| }; | ||
| export const LinksEmptyState = (props: TProps) => { | ||
| const { handleCreate } = props; | ||
| return ( | ||
| <div className="min-h-[200px] flex w-full justify-center py-6 border-[1.5px] border-custom-border-100 rounded"> | ||
| <div className="m-auto"> | ||
| <div | ||
| className={`mb-2 rounded-full mx-auto last:rounded-full w-[50px] h-[50px] flex items-center justify-center bg-custom-background-80/40 transition-transform duration-300`} | ||
| > | ||
| <Link2 size={30} className="text-custom-text-400 -rotate-45" /> | ||
| </div> | ||
| <div className="text-custom-text-100 font-medium text-base text-center mb-1">No quick links yet</div> | ||
| <div className="text-custom-text-300 text-sm text-center mb-2"> | ||
| Add any links you need for quick access to your work.{" "} | ||
| </div> | ||
| <Button variant="accent-primary" size="sm" onClick={handleCreate} className="mx-auto"> | ||
| <Plus className="size-4 my-auto" /> <span>Add quick link</span> | ||
| </Button> | ||
| </div> | ||
| </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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import { History } from "lucide-react"; | ||
|
|
||
| export const RecentsEmptyState = () => ( | ||
| <div className="h-[200px] flex w-full justify-center py-6 border-[1.5px] border-custom-border-100 rounded"> | ||
| <div className="m-auto"> | ||
| <div | ||
| className={`mb-2 rounded-full mx-auto last:rounded-full w-[50px] h-[50px] flex items-center justify-center bg-custom-background-80/40 transition-transform duration-300`} | ||
| > | ||
| <History size={30} className="text-custom-text-400 -rotate-45" /> | ||
| </div> | ||
| <div className="text-custom-text-100 font-medium text-base text-center mb-1">No recent items yet</div> | ||
| <div className="text-custom-text-300 text-sm text-center mb-2">You don’t have any recent items yet. </div> | ||
| </div> | ||
| </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
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.
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.