Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

fix: LEAP-388: Simplify SVG data URL generation #1715

Closed
wants to merge 1 commit into from

Conversation

hlomzik
Copy link
Collaborator

@hlomzik hlomzik commented Mar 18, 2024

encodeSVG() is too complex for expected outcome, so it was simplified.

  • No quotes management
  • No namespace control (we build that SVG, so have full control already)
  • No other unnecessary code we don't need, because SVG is generated by us
  • Comments
  • Simple unit tests for couple of cases

PR fulfills these requirements

  • Tests for the changes have been added/updated
  • Docs have been added/updated
  • Best efforts were made to ensure docs/code are concise and coherent (checked for spelling/grammatical errors, commented out code, debug logs etc.)
  • Self-reviewed and ran all changes on a local instance

Describe the reason for change

https://github.com/HumanSignal/label-studio-frontend/security/code-scanning/10
Initial idea was to use SVG parser to parse+generate SVG again, but it turned out as a simplier problem

What feature flags were used to cover this change?

None

This change affects (describe how if yes)

  • Performance
  • Security
  • UX

Does this PR introduce a breaking change?

  • Yes, and covered entirely by feature flag(s)
  • Yes, and covered partially by feature flag(s)
  • No
  • Not sure (briefly explain the situation below)

What level of testing was included in the change?

  • e2e (codecept)
  • integration (cypress)
  • unit (jest)

`encodeSVG()` is too complex for expected outcome, so it was simplified.
- No quotes management
- No namespace control (we build that SVG, so have full control already)
- No other unnecessary code we don't need, because SVG is generated by us
- Comments
- Simple unit tests for couple of cases
@hlomzik
Copy link
Collaborator Author

hlomzik commented Mar 19, 2024

Close this PR in favor of monorepo HumanSignal/label-studio#5595

@hlomzik hlomzik closed this Mar 19, 2024
@hlomzik hlomzik deleted the fb-leap-388/svg-xmlns branch March 27, 2024 14:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant