-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[PE-68] fix: markdown transformation of mention and custom image components #5864
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
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
45 changes: 24 additions & 21 deletions
45
web/ce/components/pages/editor/embed/issue-embed-upgrade-card.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 |
|---|---|---|
| @@ -1,31 +1,34 @@ | ||
| // ui | ||
| import { Button } from "@plane/ui"; | ||
| // plane ui | ||
| import { getButtonStyling } from "@plane/ui"; | ||
| // components | ||
| import { ProIcon } from "@/components/common"; | ||
| // helpers | ||
| import { cn } from "@/helpers/common.helper"; | ||
|
|
||
| export const IssueEmbedUpgradeCard: React.FC<any> = (props) => ( | ||
aaryan610 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <div | ||
| className={`${ | ||
| props.selected ? "border-custom-primary-200 border-[2px]" : "" | ||
| } w-full h-[100px] cursor-pointer space-y-2 rounded-md border-[0.5px] border-custom-border-200 shadow-custom-shadow-2xs`} | ||
| className={cn( | ||
| "w-full h-20 bg-custom-background-80 rounded-md border-[0.5px] border-custom-border-200 shadow-custom-shadow-2xs", | ||
| { | ||
| "border-2": props.selected, | ||
| } | ||
| )} | ||
| > | ||
| <h5 className="h-[20%] text-xs text-custom-text-300 p-2"> | ||
| {props.node?.attrs?.project_identifier}-{props?.node?.attrs?.sequence_id} | ||
| </h5> | ||
| <div className="relative h-[71%]"> | ||
| <div className="h-full backdrop-filter backdrop-blur-[30px] bg-custom-background-80 bg-opacity-30 flex items-center w-full justify-between gap-5 mt-2.5 pl-4 pr-5 py-3 max-md:max-w-full max-md:flex-wrap relative"> | ||
| <div className="flex gap-2 items-center"> | ||
| <div className="rounded"> | ||
| <ProIcon className="m-2 w-4 h-4" /> | ||
| </div> | ||
| <div className="text-custom-text text-sm"> | ||
| Embed and access issues in pages seamlessly, upgrade to plane pro now. | ||
| </div> | ||
| </div> | ||
| <a href="https://plane.so/pricing" target="_blank" rel="noopener noreferrer"> | ||
| <Button>Upgrade</Button> | ||
| </a> | ||
| <div className="flex items-center justify-between gap-5 mt-2.5 pl-4 pr-5 py-3 w-full max-md:max-w-full max-md:flex-wrap rounded-md"> | ||
| <div className="flex items-center gap-4"> | ||
| <ProIcon className="flex-shrink-0 size-4" /> | ||
| <p className="text-custom-text !text-base"> | ||
| Embed and access issues in pages seamlessly, upgrade to Plane Pro now. | ||
| </p> | ||
| </div> | ||
| <a | ||
| href="https://plane.so/pro" | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| className={cn(getButtonStyling("primary", "md"), "no-underline")} | ||
| > | ||
| Upgrade | ||
| </a> | ||
| </div> | ||
| </div> | ||
| ); | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix invocation of
getImageSourcecommandThe current implementation doesn't address the issue raised in a previous review. The
getImageSourcecommand returns a function that needs to be invoked to get the actual image source. Currently, the function is not being called, which may result inimageSourcebeing assigned a function instead of the expected string.Apply the following diff to fix the issue:
📝 Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check this issue. getImageSource is returning a function here
plane/packages/editor/src/core/extensions/custom-image/read-only-custom-image.ts
Line 60 in 0f25f39
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SatishGandham, thank you for bringing this to my attention. You're correct; in
read-only-custom-image.ts, thegetImageSourcecommand returns a string directly, not a function. Therefore, the current implementation is correct, and my previous suggestion isn't necessary. I apologize for the oversight.(>_<) Sorry about that.
✏️ Learnings added