[WEB-4172] feat: Crawl work item links for title and favicon (#7117)
* feat: added a python bg task to crawl work item links for title and description * fix: return meta_data in the response * fix: add validation for accessing IP ranges * fix: remove json.dumps * fix: handle exception by returning None * refactor: call find_favicon_url inside fetch_and_encode_favicon function * chore: type hints * fix: Handle None * fix: remove print statementsg * chore: added favicon and title of links * fix: return null if no title found * Update apiserver/plane/bgtasks/work_item_link_task.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: remove exception handling * fix: reduce timeout seconds * fix: handle timeout exception * fix: remove request timeout handling * feat: add Link icon to issue detail links and update rendering logic * fix: use logger for exception --------- Co-authored-by: sangeethailango <sangeethailango21@gmail.com> Co-authored-by: JayashTripathy <jayashtripathy371@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
parent
046a8a1bcf
commit
445c819fbd
3 changed files with 213 additions and 4 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import { FC } from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { Pencil, Trash2, Copy } from "lucide-react";
|
||||
import { Pencil, Trash2, Copy, Link } from "lucide-react";
|
||||
import { EIssueServiceType } from "@plane/constants";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { TIssueServiceType } from "@plane/types";
|
||||
|
|
@ -37,7 +37,9 @@ export const IssueLinkItem: FC<TIssueLinkItem> = observer((props) => {
|
|||
const linkDetail = getLinkById(linkId);
|
||||
if (!linkDetail) return <></>;
|
||||
|
||||
const Icon = getIconForLink(linkDetail.url);
|
||||
// const Icon = getIconForLink(linkDetail.url);
|
||||
const faviconUrl: string | undefined = linkDetail.metadata?.favicon;
|
||||
const linkTitle: string | undefined = linkDetail.metadata?.title;
|
||||
|
||||
const toggleIssueLinkModal = (modalToggle: boolean) => {
|
||||
toggleIssueLinkModalStore(modalToggle);
|
||||
|
|
@ -50,15 +52,21 @@ export const IssueLinkItem: FC<TIssueLinkItem> = observer((props) => {
|
|||
className="group col-span-12 lg:col-span-6 xl:col-span-4 2xl:col-span-3 3xl:col-span-2 flex items-center justify-between gap-3 h-10 flex-shrink-0 px-3 bg-custom-background-90 hover:bg-custom-background-80 border-[0.5px] border-custom-border-200 rounded"
|
||||
>
|
||||
<div className="flex items-center gap-2.5 truncate flex-grow">
|
||||
<Icon className="size-4 flex-shrink-0 stroke-2 text-custom-text-350 group-hover:text-custom-text-100" />
|
||||
{faviconUrl ? (
|
||||
<img src={faviconUrl} alt="favicon" className="size-4" />
|
||||
) : (
|
||||
<Link className="size-4 text-custom-text-350 group-hover:text-custom-text-100" />
|
||||
)}
|
||||
<Tooltip tooltipContent={linkDetail.url} isMobile={isMobile}>
|
||||
<a
|
||||
href={linkDetail.url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="truncate text-sm cursor-pointer flex-grow"
|
||||
className="truncate text-sm cursor-pointer flex-grow flex items-center gap-3"
|
||||
>
|
||||
{linkDetail.title && linkDetail.title !== "" ? linkDetail.title : linkDetail.url}
|
||||
|
||||
{linkTitle && linkTitle !== "" && <span className="text-custom-text-400 text-xs">{linkTitle}</span>}
|
||||
</a>
|
||||
</Tooltip>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue