ITI / searcch

SEARCCH Hub Frontend
https://searcch.cyberexperimentation.org/
BSD 3-Clause "New" or "Revised" License
3 stars 6 forks source link

Fixed the issue where the record always links to the latest version #160

Closed fallen-axe-shay closed 1 year ago

carboxylman commented 1 year ago

The problem with this is that we don't want users to copy full-version URLs and link to them in the default case. We only want to show them a version-specific URL when they are viewing/editing something other than the current published version.

This is a simple conditional -- so I would replace this inline URL with a generator function that takes as input an artifact dict, and does something like

getArtifactLink(artifact) {
if (artifact.artifact_group !== 'undefined' && artifact.artifact_group.publication !== 'undefined' && artifact.artifact_group.publication.artifact.id == artifact.id)
  return `/artifact/${artifact.artifact_group_id}`"
else
  return `/artifact/${artifact.artifact_group_id}/${artifact.id}`"
}
fallen-axe-shay commented 1 year ago

Addressed the issue where duplicates were found in "My Artifacts". I've also added chips to differentiate between the user roles for a specific artifact (draft, contributor, owner).

I've also attached 2 screenshots - one in My Artifacts, and one in Artifact Search.

My Artifacts

Artifact Search