Fix: issue-2151 Clicking links in column description open the edit panel and then navigates to the link (#2237)

This commit is contained in:
Shailesh Parmar 2022-01-17 12:42:36 +05:30 committed by GitHub
parent b4983764e5
commit 94cd991462
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 89 additions and 85 deletions

View File

@ -398,29 +398,32 @@ const DashboardDetails = ({
{chart.chartType} {chart.chartType}
</td> </td>
<td className="tw-group tableBody-cell tw-relative"> <td className="tw-group tableBody-cell tw-relative">
<NonAdminAction <div className="tw-inline-block">
html={getHtmlForNonAdminAction(Boolean(owner))} <div
isOwner={hasEditAccess()} className="tw-cursor-pointer tw-flex"
position="top"> data-testid="description">
<div className="tw-inline-block"> <div>
<div {chart.description ? (
className="tw-cursor-pointer hover:tw-underline tw-flex" <RichTextEditorPreviewer
data-testid="description" markdown={chart.description}
onClick={() => />
handleUpdateChart(chart, index) ) : (
}> <span className="tw-no-description">
<div> No description added
{chart.description ? ( </span>
<RichTextEditorPreviewer )}
markdown={chart.description} </div>
/> <NonAdminAction
) : ( html={getHtmlForNonAdminAction(
<span className="tw-no-description"> Boolean(owner)
No description added )}
</span> isOwner={hasEditAccess()}
)} position="top">
</div> <button
<button className="tw-self-start tw-w-8 tw-h-auto tw-opacity-0 tw-ml-1 group-hover:tw-opacity-100 focus:tw-outline-none"> className="tw-self-start tw-w-8 tw-h-auto tw-opacity-0 tw-ml-1 group-hover:tw-opacity-100 focus:tw-outline-none"
onClick={() =>
handleUpdateChart(chart, index)
}>
<SVGIcons <SVGIcons
alt="edit" alt="edit"
icon="icon-edit" icon="icon-edit"
@ -428,9 +431,9 @@ const DashboardDetails = ({
width="10px" width="10px"
/> />
</button> </button>
</div> </NonAdminAction>
</div> </div>
</NonAdminAction> </div>
</td> </td>
<td <td
className="tw-group tw-relative tableBody-cell" className="tw-group tw-relative tableBody-cell"

View File

@ -476,36 +476,36 @@ const EntityTable = ({
)} )}
{cell.column.id === 'description' && ( {cell.column.id === 'description' && (
<div> <div>
<NonAdminAction <div className="tw-inline-block">
html={getHtmlForNonAdminAction(Boolean(owner))} <div
isOwner={hasEditAccess} className="tw-flex"
position="top"> data-testid="description"
<div className="tw-inline-block"> id={`column-description-${index}`}>
<div <div>
className={classNames('tw-flex', { {cell.value ? (
'tw-cursor-pointer hover:tw-underline': <RichTextEditorPreviewer
!isReadOnly, markdown={cell.value}
})} />
data-testid="description" ) : (
id={`column-description-${index}`} <span className="tw-no-description">
onClick={() => { No description added
if (!isReadOnly) { </span>
handleEditColumn(row.original, row.id); )}
} </div>
}}> {!isReadOnly ? (
<div> <NonAdminAction
{cell.value ? ( html={getHtmlForNonAdminAction(
<RichTextEditorPreviewer Boolean(owner)
markdown={cell.value}
/>
) : (
<span className="tw-no-description">
No description added
</span>
)} )}
</div> isOwner={hasEditAccess}
{!isReadOnly ? ( position="top">
<button className="tw-self-start tw-w-8 tw-h-auto tw-opacity-0 tw-ml-1 group-hover:tw-opacity-100 focus:tw-outline-none"> <button
className="tw-self-start tw-w-8 tw-h-auto tw-opacity-0 tw-ml-1 group-hover:tw-opacity-100 focus:tw-outline-none"
onClick={() => {
if (!isReadOnly) {
handleEditColumn(row.original, row.id);
}
}}>
<SVGIcons <SVGIcons
alt="edit" alt="edit"
icon="icon-edit" icon="icon-edit"
@ -513,10 +513,10 @@ const EntityTable = ({
width="10px" width="10px"
/> />
</button> </button>
) : null} </NonAdminAction>
</div> ) : null}
</div> </div>
</NonAdminAction> </div>
{checkIfJoinsAvailable(row.original.name) && ( {checkIfJoinsAvailable(row.original.name) && (
<div <div
className="tw-mt-3" className="tw-mt-3"

View File

@ -350,9 +350,8 @@ const PipelineDetails = ({
</td> </td>
<td className="tw-group tableBody-cell tw-relative"> <td className="tw-group tableBody-cell tw-relative">
<div <div
className="tw-cursor-pointer hover:tw-underline tw-flex" className="tw-cursor-pointer tw-flex"
data-testid="description" data-testid="description">
onClick={() => handleUpdateTask(task, index)}>
<div> <div>
{task.description ? ( {task.description ? (
<RichTextEditorPreviewer <RichTextEditorPreviewer
@ -364,7 +363,9 @@ const PipelineDetails = ({
</span> </span>
)} )}
</div> </div>
<button className="tw-self-start tw-w-8 tw-h-auto tw-opacity-0 tw-ml-1 group-hover:tw-opacity-100 focus:tw-outline-none"> <button
className="tw-self-start tw-w-8 tw-h-auto tw-opacity-0 tw-ml-1 group-hover:tw-opacity-100 focus:tw-outline-none"
onClick={() => handleUpdateTask(task, index)}>
<SVGIcons <SVGIcons
alt="edit" alt="edit"
icon="icon-edit" icon="icon-edit"

View File

@ -366,28 +366,28 @@ const TagsPage = () => {
<td className="tableBody-cell"> <td className="tableBody-cell">
<p>{tag.name}</p> <p>{tag.name}</p>
</td> </td>
<td <td className="tw-group tableBody-cell">
className="tw-group tableBody-cell" <div className="tw-cursor-pointer tw-flex">
onClick={() => { <div>
setIsEditTag(true); {tag.description ? (
setEditTag(tag); <RichTextEditorPreviewer
}}> markdown={tag.description}
<NonAdminAction />
position="left" ) : (
title={TITLE_FOR_NON_ADMIN_ACTION}> <span className="tw-no-description">
<div className="tw-cursor-pointer hover:tw-underline tw-flex"> No description added
<div> </span>
{tag.description ? ( )}
<RichTextEditorPreviewer </div>
markdown={tag.description} <NonAdminAction
/> position="left"
) : ( title={TITLE_FOR_NON_ADMIN_ACTION}>
<span className="tw-no-description"> <button
No description added className="tw-self-start tw-w-8 tw-h-auto tw-opacity-0 tw-ml-1 group-hover:tw-opacity-100 focus:tw-outline-none"
</span> onClick={() => {
)} setIsEditTag(true);
</div> setEditTag(tag);
<button className="tw-self-start tw-w-8 tw-h-auto tw-opacity-0 tw-ml-1 group-hover:tw-opacity-100 focus:tw-outline-none"> }}>
<SVGIcons <SVGIcons
alt="edit" alt="edit"
data-testid="editTagDescription" data-testid="editTagDescription"
@ -396,8 +396,8 @@ const TagsPage = () => {
width="10px" width="10px"
/> />
</button> </button>
</div> </NonAdminAction>
</NonAdminAction> </div>
<div className="tw-mt-1"> <div className="tw-mt-1">
<span className="tw-text-grey-muted tw-mr-1"> <span className="tw-text-grey-muted tw-mr-1">
Usage: Usage: