bcgov / MFIN-Data-Catalogue

The Finance Data Catalogue enables users to discover data holdings at the BC Ministry of Finance and offers information and functionality that benefits consumers of data for business purposes. The product is built using Drupal and adheres to the Government of BC's Core Administrative and Descriptive etadata Standard.
Other
6 stars 0 forks source link

Use HTML tags in the data dictionary #434

Closed Rafael-hk closed 7 months ago

Rafael-hk commented 7 months ago

OP timer

https://openplus.monday.com/boards/4092908516/pulses/6459581885


The data dictionary has several columns in it where a user can create rich text using CKEditor. When a data dictionary is exported, it correctly exports the html.

The issue is that when you import the html, it is not rendering correctly.

For example, this is the value for column_allowed_values in the excel/csv file:

<p>One</p><p>Two</p><p>These are in a list</p><ul><li>one</li><li>two</li><li>three</li></ul>

Once you import it, and look a the source HTML, it renders as:

<p>&lt;p&gt;One&lt;/p&gt;&lt;p&gt;Two&lt;/p&gt;&lt;p&gt;These are in a list&lt;/p&gt;&lt;ul&gt;&lt;li&gt;one&lt;/li&gt;&lt;li&gt;two&lt;/li&gt;&lt;li&gt;three&lt;/li&gt;&lt;/ul&gt;</p>

To duplicate

  1. Create a record of type data
  2. in the columns section on the build page, add a column.
  3. in one of the text areas, add some content using CKEditor
  4. save
  5. export the columns as csv or excel
  6. import the file you exported in step 5
  7. See that html is not rendering correctly

Expectation

I tested this on https://dv14.openplus.ca/node/68

Original authors post

User story

When an entry in a data dictionary is inserted/edit, there are html tags that are added. Under "view draft", when visualizing the data dictionary, the tags are being displayed instead of being rendered (not sure this is the correct word). This can be confusing and make it for a worse UX.

Here is an example: When editing: image

When viewing: image

Idea: render the html tags.

CraigClark commented 7 months ago

Thank for for posting this @Rafael-hk. Could you please post a link to whee this is happening? I tested in our dev environment and I was not able to duplicate this.

Also, did this happen when you edited manually, or were you importing a file. If importing, could you please attach the file you are using?

CraigClark commented 7 months ago

relabelling as bug. This should not be happening

Rafael-hk commented 7 months ago

I have only seem this error when importing a data dictionary with the html tags.

Here is a way to replicate the issue:

image

image

Here is the file used: log-release_ID_81.xlsx

CraigClark commented 7 months ago

Thank you @Rafael-hk I was able to duplicate this in our dev environment with the additional info you provided.

CraigClark commented 7 months ago

Tested and passed on dv14