-
Notifications
You must be signed in to change notification settings - Fork 16
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
261 - Add File Citation to File Page #269
Conversation
…m/IQSS/dataverse-frontend into feature/261-file-citation-ui
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.
...props | ||
}) | ||
} | ||
} | ||
|
||
export class FileCitationMother { | ||
static create(fileName: string): string { |
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.
I think here is where the string is composed incorrectly. (${fileName} [fileName]`)
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 is how I see the files in JSF, with the [fileName] part. If you look at the DataCitation.java in the dataverse repo, that part is added if there is no global identifier
In any case, I was assuming that the citation was coming from the API, as in the Dataset page. So this (${fileName} [fileName]
)` logic only applies to the Stoybook, then I can change it to a different string if we don't like the one with the [fileName]
Please, let me know if my assumption was correct and the citation is coming in the API payload as it does in the dataset payload, otherwise I have to apply that logic to the SPA
citation={version.citation} | ||
tooltip={<DatasetCitationTooltip status={version.publishingStatus} />} | ||
/> | ||
<CitationLearnAbout /> |
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.
Nice extraction
@GPortas, about the composition of the file citation block text, could you see what the citation looks like when the file is given a persistent ID? All files in Demo Dataverse, including the file in your "JSF" screenshot, are given a persistent ID. But for files that aren't given persistent IDs, such as https://dataverse.harvard.edu/file.xhtml?fileId=8079268&version=1.0, it looks like the file's citation block text composition is the same as your first screenshot with the red circle. This difference is citation composition is discussed in IQSS/dataverse#4777 and it was done intentionally. The conversation in the GitHub issue is a bit long but it ends with Phil's comment at IQSS/dataverse#4777 (comment). |
Thank you @jggautier, Then we have to compose the citation text by choosing one of the two composing options depending on whether the file has a persistent ID or not. @MellyGray I think we should add this distinction in the logic in this PR. |
@MellyGray is right. The citation string must come from the js-dataverse package, as for datasets, so the way it is composed must be opaque to the SPA. This is something to address in the upcoming API and js-dataverse issues and not here. |
@MellyGray can you resolve the conflicts in this PR? |
…m/IQSS/dataverse-frontend into feature/261-file-citation-ui
looks good! |
261 - Add File Citation to File Page
What this PR does / why we need it:
This PR adds the File Citation section to the UI of the File Page.
Which issue(s) this PR closes:
Special notes for your reviewer:
I refactored some components related to the citation to rehuse them in the FileCitation component
The citation boxes won't look as in the mock, with the coloured background because in the SPA the dataset citation box only has the border coloured, so I did the same with the File Citation box.
Suggestions on how to test this:
npm install
.cd packages/design-system && npm run build
.cd ../../
.npm run storybook
.Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?:
No