-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show canonical dataset in MetadataView #2546
Conversation
- Add a new view, CanonicalDatasetHandlerView, to handle identifying and displaying the canonical dataset for a given dataset - The view removes the annotations that identify the canonical dataset from the metadata view and adds a field to display the canonical dataset url - The view has shell methods to fill in that will make further modifications to the metadata view Issue #2541
- Deprecate the template that rendered the icons previously - Add new methods to MetadataView to render the icons - Call new methods to render the duplicate icon with the CanonicalDatasetHandlerView Issue #2541
922c13b
to
6741949
Compare
The metadata view re-renders when a users' logged in status changes. Depending on the timing of this change, re-rendering may occur in the middle of a previous render. This causes elements of the view to break, especially the new CanonicalDatasetHandlerView. This commit fixes the issue by adding a check to see if the view is already rendering before re-rendering. Issue #2541
And show the citation modal when the "duplicate" info icon is clicked. Issue #2541
and add rendering of issue & volume for journal articles in the citation APA template Issue #2541
using the new CrossRef model Issue #2541
63195fd
to
5c124bd
Compare
Changes to do based on feedback from @mbjones:
|
Canonical dataset citation is now before the "this version" citation in the citation modal on dataset landing pages. Issue #2541
Also fix a problem found in testing:
|
In the MetadataView. This ensures that if the logged in status changes, the view will re-render to show the correct information. Issue #2541
029f128
to
ded5b86
Compare
Remove the Canonical Dataset field in the General section of dataset landing pages, and instead show a more prominent blue info box at the top of the page with the citation. Issue #2541
Even if we can't fetch DOI info Issue #2541
* @returns {string} Returns the main identifier for the citation or an | ||
* empty string. | ||
* @since 2.23.0 | ||
*/ | ||
getID() { | ||
const idSources = ["pid", "seriesId", "source_url"]; | ||
const idSources = ["pid", "seriesId", "source_url", "doi", "DOI"]; | ||
for (let i = 0; i < idSources.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [eslint] <no-plusplus> reported by reviewdog 🐶
Unary operator '++' used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR introduces a feature that a visually identifies a dataset as essentially a duplicate of another in the
MetadataView
. It does this by adding and modifying some components of the view.New
CanonicalDatasetHandlerView
Added a new view,
CanonicalDatasetHandlerView
that handles identifying and displaying the canonical dataset within a Metadata view.This new view is a "scoped subview", a self-contained view that is responsible for managing a specific part of UI within a larger parent view. In this case, the
CanonicalDatasetHandlerView
handles inspecting and modifying specific parts of the already-rendered DOM within theMetadataView
. Creating a new view for this purpose avoids adding more complexity to the already very largeMetadataView
.The
CanonicalDatasetHandlerView
is responsible for the following tasks:MetadataView
to identify a canonical dataset.schema.org:sameAs
andprov:derivedFrom
annotations that have the value, this is assumed to be a reference the DOI of the canonical dataset.MetadataView
when a canonical dataset is detected, by:New
CrossRef
modelChanges to other components
Citation Model
issue
and methods to extractvolume
andissue
from the source model. UpdatedgetJournalFromSourceModel
andgetPidFromSourceModel
to handle getting these values from aCrossRefModel
.Citation View
issue
and adjust the formatting of the journal, volume, and page information.Metadata View
CanonicalDatasetHandlerView