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

Enable hyperlinks in dataset description #1591

Merged
merged 2 commits into from
Oct 1, 2024

Conversation

rbernotas
Copy link
Contributor

@rbernotas rbernotas commented Sep 27, 2024

Feature or Bugfix

  • Feature

Detail

  • Enables conversion of hyperlinks in dataset description text.

Relates

Security

Please answer the questions below briefly where applicable, or write N/A. Based on
OWASP 10.

  • Does this PR introduce or modify any input fields or queries - this includes
    fetching data from storage outside the application (e.g. a database, an S3 bucket)? Dataset description field is parsed for hyperlinks
    • Is the input sanitized? Yes, and additional sanitization can take place in linkMarkup.js
    • What precautions are you taking before deserializing the data you consume? N/A
    • Is injection prevented by parametrizing queries? N/A
    • Have you ensured no eval or similar functions are used? Yes
  • Does this PR introduce any functionality or component that requires authorization? No
    • How have you ensured it respects the existing AuthN/AuthZ mechanisms? N/A
    • Are you logging failed auth attempts? N/A
  • Are you using or adding any cryptographic features? N/A
    • Do you use a standard proven implementations? N/A
    • Are the used keys controlled by the customer? Where are they stored? N/A
  • Are you introducing any new policies/roles/users? N/A
    • Have you used the least-privilege principle? How? N/A

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dlpzx dlpzx self-requested a review September 30, 2024 07:13
@@ -0,0 +1,33 @@
export const createLinkMarkup = (text, color) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Is the color ever going to change? If not, could we get it from the theme directly in the linkMarkup util?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did look into this. The color does need to change when you swap from light to dark theme in the settings. But eslint doesn't like it when the useTheme hook is called within linkMarkup as createLinkMarkup isn't a React component or custom hook. I looked into wrapping the function in a component, but then calling that started to get a little hacky just for the purpose of avoiding the param.

Copy link
Contributor

Choose a reason for hiding this comment

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

Understood, seems like the solution is more complex than the problem itself. I think we can leave it as is.

Copy link
Contributor

@dlpzx dlpzx left a comment

Choose a reason for hiding this comment

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

Hi @rbernotas, left some minor comments, but the functionality looks good. Thanks for the PR

@rbernotas
Copy link
Contributor Author

integration tests had a failure in test_submit_share_extension_request_with_auto_approval. The error doesn't look related to this code change... is this a known issue?

@dlpzx
Copy link
Contributor

dlpzx commented Oct 1, 2024

integration tests had a failure in test_submit_share_extension_request_with_auto_approval. The error doesn't look related to this code change... is this a known issue?

Yes, there was a small issue on the expiration date calculation for the last day of a month. The fix is in this PR. I re-run the failed job for this PR because today, 1st of October, we don't run into the issue

@dlpzx dlpzx merged commit 698d5ec into data-dot-all:main Oct 1, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants