Skip to content
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

fix: update keepRawFields to prevent markdown #588

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

ChengShi-1
Copy link
Contributor

@ChengShi-1 ChengShi-1 commented Jan 24, 2025

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.

  • Update keepRawField parameter so as to getDataset with raw data
  • Update markdown component, allow transforming HTML to markdown
  • Update JSMetadataBlockInfoMapper.ts, get type of fields
  • Apply markdown component if type == 'TEXTBOX'

Which issue(s) this PR closes:

Special notes for your reviewer:

Suggestions on how to test this:

Check the HTML Tags

  1. Create a Dataset
  • Fill out the form, and give some html tags to fields (especially description field). such as <b> description </b>
  1. Check Dataset Summary and MetadataDisplay
  • On the dataset page, if it's description (TEXTBOX type), it should shown with the HTML styles and without HTML tags. For instance, test` should render correctly as test (bold).
  • If the field is not in TEXTBOX fields, such as subtitle and keywords, should <b>test</b>, not as the rendered bold text or plain text.
  1. Edit the Dataset Metadata
  • Verify that when the dataset metadata opens for editing, the pre-filled text in fields matches exactly what was entered during creation with html tags.
  • On the edit page, the field should display exactly what you entered: <b>test</b>, not as the rendered bold text or plain text.
  1. Save Changes and Confirm Updates
  • After saving the edited metadata, verify that all changes successfully update on the dataset display page.

Check the underscore escaping
refered to IQSS/dataverse-client-javascript#241

  1. Create a Dataset
  • Fill out the form, and give some underscores and other symbols to fields. such as __description/title__
  1. Check Dataset Summary and MetadataDisplay
  • On the dataset page, check if the underscore work well without extra characters or symbols.
  1. Edit the Dataset Metadata
  • Verify that when the dataset metadata opens for editing, the pre-filled text in fields matches exactly what was entered during creation.
  1. Save Changes and Confirm Updates
  • After saving the edited metadata, verify that all changes successfully update on the dataset display page.

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:

@ChengShi-1 ChengShi-1 linked an issue Jan 24, 2025 that may be closed by this pull request
@ChengShi-1 ChengShi-1 added bug Something isn't working SPA: Dataset page (View) SPA: Edit Dataset Page GREI Re-arch GREI re-architecture-related SPA.Q1 Not related to any specific Q1 feature FY25 Sprint 15 FY25 Sprint 15 (2025-01-15 - 2025-01-29) labels Jan 24, 2025
@coveralls
Copy link

coveralls commented Jan 24, 2025

Coverage Status

coverage: 97.629% (+0.3%) from 97.282%
when pulling 86bfeb0 on 587-edit-dataset-page-do-not-transform-metadata-values-to-markdown
into dcdb033 on develop.

@ChengShi-1 ChengShi-1 added Size: 3 A percentage of a sprint. 2.1 hours. Original size: 3 labels Jan 24, 2025
@ekraffmiller ekraffmiller self-assigned this Jan 24, 2025
@ekraffmiller

This comment was marked as outdated.

@ekraffmiller

This comment was marked as outdated.

@cmbz cmbz added the FY25 Sprint 16 FY25 Sprint 16 (2025-01-29 - 2025-02-12) label Jan 30, 2025
@ChengShi-1 ChengShi-1 self-assigned this Feb 3, 2025
@ChengShi-1 ChengShi-1 marked this pull request as ready for review February 5, 2025 18:30
@ChengShi-1 ChengShi-1 removed their assignment Feb 5, 2025
@g-saracca g-saracca self-assigned this Feb 6, 2025
Copy link
Contributor

@g-saracca g-saracca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good! Good job 🚀 , just some minor suggestions.
Also take a look if this solves the underscores email issue and add it to the steps to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working FY25 Sprint 15 FY25 Sprint 15 (2025-01-15 - 2025-01-29) FY25 Sprint 16 FY25 Sprint 16 (2025-01-29 - 2025-02-12) GREI Re-arch GREI re-architecture-related Original size: 3 Size: 3 A percentage of a sprint. 2.1 hours. SPA: Dataset page (View) SPA: Edit Dataset Page SPA.Q1 Not related to any specific Q1 feature
Projects
Status: In Review 🔎
Development

Successfully merging this pull request may close these issues.

Edit Dataset Page: do not transform metadata values to markdown
5 participants