Skip to content

KPMP 6704 add icon to metaspace links#320

Merged
HaneenT merged 4 commits into
developfrom
KPMP-6704_add-icon-to-metaspace-links
Jun 1, 2026
Merged

KPMP 6704 add icon to metaspace links#320
HaneenT merged 4 commits into
developfrom
KPMP-6704_add-icon-to-metaspace-links

Conversation

@Dert1129

@Dert1129 Dert1129 commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Style
    • Updated the dataset view button with a new label and external link icon. The button now displays "Open in Metaspace" instead of "View dataset" and includes a visual indicator to help users understand that the action navigates to an external resource.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Walkthrough

The PR updates the dataset table's external link button in ImageDatasetList.js. A FontAwesome arrow-up-right icon is imported and appended to the "Open in Metaspace" button label, replacing the previous "View dataset" text. The change affects only the rendering of external links in the spectracksampleid column.

Changes

Spatial Viewer Dataset List Button

Layer / File(s) Summary
External link button update
src/components/SpatialViewer/ImageDatasetList.js
FontAwesome icon import adds faArrowUpRightFromSquare. The external_link case in the spectracksampleid column is updated to render "Open in Metaspace" with the arrow-up-right icon appended to the button label.

Possibly related PRs

  • KPMP/hubble-web#319: Also modifies the spectracksampleid cell rendering and external link button behavior in the same component.
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch KPMP-6704_add-icon-to-metaspace-links

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fbe9fa12-d9c7-43fc-9324-e9c659193512

📥 Commits

Reviewing files that changed from the base of the PR and between e3d2388 and d5c4d0a.

📒 Files selected for processing (1)
  • src/components/SpatialViewer/ImageDatasetList.js


}else {
return <button onClick={() => setSelectedImageDataset(row)} type='button' data-toggle="tooltip" data-placement="top" title="View dataset" className='table-column btn btn-link text-start p-0 text-decoration-none'>{row["spectracksampleid"]}</button>
return <button onClick={() => setSelectedImageDataset(row)} type='button' data-toggle="tooltip" data-placement="top" title="Open in Metaspace" className='table-column btn btn-link text-start p-0 text-decoration-none'>{row["spectracksampleid"]} <FontAwesomeIcon icon={faArrowUpRightFromSquare} /></button>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Locate ImageDatasetListContainer.js =="
ls -R src/components/SpatialViewer | head

echo "== Search for window.open in SpatialViewer =="
rg -n "window\.open\(" src/components/SpatialViewer || true

echo "== Show ImageDatasetListContainer.js (around window.open call if present) =="
FILE="src/components/SpatialViewer/ImageDatasetListContainer.js"
if [ -f "$FILE" ]; then
  nl -ba "$FILE" | sed -n '1,220p' | sed -n '1,220p'
fi

echo "== Inspect ImageDatasetList.js around line ~115 =="
FILE2="src/components/SpatialViewer/ImageDatasetList.js"
if [ -f "$FILE2" ]; then
  nl -ba "$FILE2" | sed -n '80,160p'
fi

echo "== Search for externallink usage wiring =="
rg -n "externallink" src/components/SpatialViewer/ImageDatasetList*.js || true

Repository: KPMP/hubble-web

Length of output: 656


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="src/components/SpatialViewer/ImageDatasetListContainer.js"
echo "== Dump ImageDatasetListContainer.js (lines 1-120) =="
if [ -f "$FILE" ]; then
  awk 'NR>=1 && NR<=120 {printf "%5d\t%s\n", NR, $0}' "$FILE"
fi

FILE2="src/components/SpatialViewer/ImageDatasetList.js"
echo "== Dump ImageDatasetList.js (lines 80-160) =="
if [ -f "$FILE2" ]; then
  awk 'NR>=80 && NR<=160 {printf "%5d\t%s\n", NR, $0}' "$FILE2"
fi

echo "== Search externallink wiring across SpatialViewer subcomponents =="
rg -n "externallink" src/components/SpatialViewer/ImageDatasetList*.js

Repository: KPMP/hubble-web

Length of output: 6571


Harden external-link window.open against reverse-tabnabbing

For configtype === 'external_link', setSelectedImageDataset calls window.open(selectedImageDataset['externallink'], '_blank') without noopener/noreferrer, leaving a reverse-tabnabbing surface from the opened page. Add safe window features in src/components/SpatialViewer/ImageDatasetListContainer.js.

🔧 Proposed fix
- window.open(selectedImageDataset['externallink'], '_blank')
+ window.open(selectedImageDataset['externallink'], '_blank', 'noopener,noreferrer')

@HaneenT HaneenT merged commit d32525a into develop Jun 1, 2026
1 check passed
@HaneenT HaneenT deleted the KPMP-6704_add-icon-to-metaspace-links branch June 1, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants