frontend icon indicating copy to clipboard operation
frontend copied to clipboard

feat: templated external links (draft)

Open GBirkel opened this issue 6 months ago • 4 comments

Description

Add a field for generating dataset links based on admin-configured templates.

See https://github.com/SciCatProject/scicat-backend-next/issues/689 for details.

This has a companion PR for the back end: https://github.com/SciCatProject/scicat-backend-next/pull/2194 .

Motivation

We get a lot of requests from users and researchers to provide a variety of different types of web-based tools that related directly to datasets. These can be pages that display visualization, pages that provide analysis tools (including AI/ML) and jupyter notebooks on particular JupyterHub instance. In all cases, we would want to take the user to the page with the dataset in context.

Fixes:

Please provide a list of the fixes implemented in this PR

  • Items added

Changes:

Please provide a list of the changes implemented by this PR

  • changes made

Tests included

  • [ ] Included for each change/fix?
  • [ ] Passing? (Merge will not be approved unless this is checked)

Documentation

  • [ ] swagger documentation updated [required]
  • [ ] official documentation updated [nice-to-have]

official documentation info

If you have updated the official documentation, please provide PR # and URL of the pages where the updates are included

Backend version

  • [ ] Does it require a specific version of the backend
  • which version of the backend is required:

Summary by Sourcery

Add a new “Links” section to dataset detail and unify header styling across various components by renaming CSS classes and updating theme color mappings

New Features:

  • Add a “Links” card to the dataset detail view listing proposal, sample, instrument, creation location, techniques, and input datasets with clickable links

Enhancements:

  • Rename header classes for dataset-detail, publisheddata-details, and reduce components to a consistent naming scheme
  • Update SCSS theme files and global styles to reflect renamed header classes and correct header-3 color assignments in theme.ts

GBirkel avatar Jun 24 '25 22:06 GBirkel

Hi I see you have changed some theme colors, could you provide screenshots and explain why the theme color change is needed

Junjiequan avatar Jun 27 '25 08:06 Junjiequan

Hi I see you have changed some theme colors, could you provide screenshots and explain why the theme color change is needed

Certainly!

Currently, SciCat's styling is configured to define four header styles, 1 through 4, except style 3 and 4 are mapped to the same thing:

https://github.com/SciCatProject/frontend/blob/5f56da2d2a8f1b981ecbe1fa875971af64a58194/src/styles.scss#L213

This change was introduced about four years ago during what appears to be an unrelated refactor:

https://github.com/SciCatProject/frontend/commit/0e4720b7c60fbd9c18908cea2671ae646232a23d#diff-23fad3928bf3e71585eb4a6e3b2ff72dae02c3ed5a44d2f0deb1d49f0cb3b1a3R207

If anyone has insight into why, I'd be very interested to know. Right now it just looks like a copy-paste error.

Anyway, as a result of that, for four years we've had two header subsections with the same color. Check out "File Information" and "Derived Data":

current

When I changed header 3 to actually point to header style 3, the color that appeared had a luminance value that was quite different from the other header colors. It was much brighter. I also noticed that the current ordering of the header colors went across the spectrum out-of-order, instead of consistently from one end of the spectrum to the other. So I dialed down the luminance of the newly revealed color and changed the order:

new

We still don't have enough colors to make every subsection different, but there's one more to work with at least. This is important because I'm adding another section: "Links", visible (with junk content) in the above screenshot.

GBirkel avatar Jul 17 '25 21:07 GBirkel

@GBirkel is this a draft PR or is it ready to be reviewed? If it is a draft, as it is mentioned in the title, can we change the status to draft, pretty please?

nitrosx avatar Aug 08 '25 11:08 nitrosx

@GBirkel is this a draft PR or is it ready to be reviewed? If it is a draft, as it is mentioned in the title, can we change the status to draft, pretty please?

Ah, yes, this is a draft. Sorry for the confusion.

GBirkel avatar Aug 08 '25 18:08 GBirkel