-
Notifications
You must be signed in to change notification settings - Fork 18
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
Dataset Page: apply markdown transforming only to TEXTBOX type fields #588
Dataset Page: apply markdown transforming only to TEXTBOX type fields #588
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
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.
Good, approving
On this step I have come across an observation: On the edit page, the field should display exactly what you entered: test, not as the rendered bold text or plain text. When I enter my HTML description, it doesn't save the HTML tags when I go back to edit it: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML Elements Example</title>
</head>
<body>
<a href="https://www.example.com">This is a link</a><br>
<b>Bold text</b><br>
<blockquote>This is a blockquote.</blockquote>
<br> <!-- Line break -->
<code>console.log("Hello, World!");</code><br>
<del>Deleted text</del><br>
<dl>
<dt>Term 1</dt>
|
…tadata-values-to-markdown
@g-saracca Hi German, please help to re-review it, thank you! I forgot add transform function to subfields before, so I apply it to subfields. I didn't add tests because after merging with dev branch, the test coverage pass magically |
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.
All good!
Im still seeing the same issue - if i put in my HTML code as mentioned above, I come back to edit the Collections description, I am unable to see the input with the HTML tags. Screen.Recording.2025-02-21.at.11.20.47.AM.mov |
@ofahimIQSS Hi Omer, thanks for testing. This PR changes only work for Dataset related pages. The collection would be fixed #608 here |
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.
Hi @ChengShi-1, remember to install turndown library and don't use the js-dataverse peer dependency turndown library.
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.
Reapproving, thanks cheng!
testing passed- Merging PR |
What this PR does / why we need it:
Related issue: IQSS/dataverse-client-javascript#244
We would move html to markdown transformation from js-dataverse repo to this frontend repo in dataset pages. We assume we will get raw dataset summary and metadata info from js-dataverse, and then we'll deal with the format transformation issue. Only if the field is in textbox type, we'll transform html tags into markdown.
keepRawField = true
parameter so as to getDataset with raw dataJSMetadataBlockInfoMapper.ts
, gettype
of fieldstype == 'TEXTBOX'
Which issue(s) this PR closes:
Special notes for your reviewer:
Suggestions on how to test this:
npm i.& npm run build to update package.json
Check the HTML Tags
Overall, the Edit/Create dataset page should always give html tags and whatever is entered. Some TEXTBOX fields in Dataset (summary/citation metadata) page, should display in HTML format.
<b> description </b>
TEXTBOX fields, should display HTML include: Description, Related Publication, Notes (EDIT page: Related Material, Related Dataset, Data Source, Origin of Historical Sources, Characteristic of Sources, Documentation and Access to Sources) Other than these fields, should go with plain text .
<b>test</b>
should render correctly as test (bold). (see image below)<b>test</b>
included html tag if input tags, not as the rendered bold text or plain text.<b>test</b>
, always with html tags if they're put, not as the rendered bold text or plain text.Check the underscore escaping
refered to IQSS/dataverse-client-javascript#241
__description/title__
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?:
Additional documentation: