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,17 +398,10 @@ 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
html={getHtmlForNonAdminAction(Boolean(owner))}
isOwner={hasEditAccess()}
position="top">
<div className="tw-inline-block"> <div className="tw-inline-block">
<div <div
className="tw-cursor-pointer hover:tw-underline tw-flex" className="tw-cursor-pointer tw-flex"
data-testid="description" data-testid="description">
onClick={() =>
handleUpdateChart(chart, index)
}>
<div> <div>
{chart.description ? ( {chart.description ? (
<RichTextEditorPreviewer <RichTextEditorPreviewer
@ -420,7 +413,17 @@ const DashboardDetails = ({
</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"> <NonAdminAction
html={getHtmlForNonAdminAction(
Boolean(owner)
)}
isOwner={hasEditAccess()}
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"
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>
</div>
</NonAdminAction> </NonAdminAction>
</div>
</div>
</td> </td>
<td <td
className="tw-group tw-relative tableBody-cell" className="tw-group tw-relative tableBody-cell"

View File

@ -476,23 +476,11 @@ const EntityTable = ({
)} )}
{cell.column.id === 'description' && ( {cell.column.id === 'description' && (
<div> <div>
<NonAdminAction
html={getHtmlForNonAdminAction(Boolean(owner))}
isOwner={hasEditAccess}
position="top">
<div className="tw-inline-block"> <div className="tw-inline-block">
<div <div
className={classNames('tw-flex', { className="tw-flex"
'tw-cursor-pointer hover:tw-underline':
!isReadOnly,
})}
data-testid="description" data-testid="description"
id={`column-description-${index}`} id={`column-description-${index}`}>
onClick={() => {
if (!isReadOnly) {
handleEditColumn(row.original, row.id);
}
}}>
<div> <div>
{cell.value ? ( {cell.value ? (
<RichTextEditorPreviewer <RichTextEditorPreviewer
@ -505,7 +493,19 @@ const EntityTable = ({
)} )}
</div> </div>
{!isReadOnly ? ( {!isReadOnly ? (
<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"> <NonAdminAction
html={getHtmlForNonAdminAction(
Boolean(owner)
)}
isOwner={hasEditAccess}
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"
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>
</NonAdminAction>
) : null} ) : null}
</div> </div>
</div> </div>
</NonAdminAction>
{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,16 +366,8 @@ 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={() => {
setIsEditTag(true);
setEditTag(tag);
}}>
<NonAdminAction
position="left"
title={TITLE_FOR_NON_ADMIN_ACTION}>
<div className="tw-cursor-pointer hover:tw-underline tw-flex">
<div> <div>
{tag.description ? ( {tag.description ? (
<RichTextEditorPreviewer <RichTextEditorPreviewer
@ -387,7 +379,15 @@ const TagsPage = () => {
</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"> <NonAdminAction
position="left"
title={TITLE_FOR_NON_ADMIN_ACTION}>
<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={() => {
setIsEditTag(true);
setEditTag(tag);
}}>
<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: