Skip to content

Commit

Permalink
bugfixes for user edit modal (#342)
Browse files Browse the repository at this point in the history
* bugfixes for  user edit modal

* open url in new window, get absolute url

* fixed tests

* added rel to href for artifact link

* updated tests
  • Loading branch information
sdstolworthy authored Oct 6, 2020
1 parent 33aebdd commit 01d7821
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -173,6 +175,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -242,6 +246,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -311,6 +317,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -380,6 +388,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -449,6 +459,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -518,6 +530,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -587,6 +601,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -656,6 +672,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -725,6 +743,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -794,6 +814,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -863,6 +885,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -932,6 +956,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -1001,6 +1027,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -1070,6 +1098,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -1139,6 +1169,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -1208,6 +1240,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -1277,6 +1311,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -1346,6 +1382,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -1415,6 +1453,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -1572,6 +1612,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -1641,6 +1683,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -1710,6 +1754,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -1779,6 +1825,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -1848,6 +1896,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -1917,6 +1967,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -1986,6 +2038,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -2055,6 +2109,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -2124,6 +2180,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -2193,6 +2251,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -2262,6 +2322,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -2331,6 +2393,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -2400,6 +2464,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -2469,6 +2535,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -2538,6 +2606,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -2607,6 +2677,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -2676,6 +2748,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -2745,6 +2819,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -2814,6 +2890,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down Expand Up @@ -2883,6 +2961,8 @@ Object {
>
<a
href="https://example.com"
rel="noopener noreferrer"
target="_blank"
>
An engagement artifact
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ function EngagementTimelineCardBody(
{ title: 'Description', transforms: [cellWidth('max')] },
{ title: 'Actions' },
];
function getAbsoluteUrl(url: string): string {
if (url.includes('://')) {
return url;
} else {
return `//${url}`;
}
}
const actionItems = [
<DropdownItem key="edit">
<span data-testid="artifact-edit-button">Edit</span>
Expand All @@ -118,7 +125,11 @@ function EngagementTimelineCardBody(
const rows = props.artifacts.map((artifact, idx) => [
artifact.type,
{
title: <a href={artifact.linkAddress}>{artifact.title}</a>,
title: (
<a target="_blank" rel="noopener noreferrer" href={getAbsoluteUrl(artifact.linkAddress)}>
{artifact.title}
</a>
),
},
artifact.description,
{
Expand Down
Loading

0 comments on commit 01d7821

Please sign in to comment.