-
Notifications
You must be signed in to change notification settings - Fork 114
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
Switch to use Web API in Slidedown and Tagging Container #681
Conversation
f2301f0
to
342adb7
Compare
New CSS class constants: - 'slide-up' - 'slide-down' - close-slidedown' Refactoring - Switched to all caps constant typescript convention
After shifting from hard-coded HTML approach to Web API approach, the function returns a web Element so we are renaming it here to be more clear.
342adb7
to
1485574
Compare
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.
You noted you tested on this on your machine, can you explain in more detail what was tested to confirm we covered everything that could be effected?
Some things I recommend testing:
- Visually normal slidedown.
- Visually category slidedown.
- Saving categories saves correct values
- Visually category slidedown when updating.
TestEnvironment: - Need to mock the Dom environment for tests to pass now that we are using the WebApi to create elements TaggingContainer: - switched to use `value` instead of `defaultValue` which is actually what we want
Previously, the span and indicator holder elements would not display the pointer as the cursor which was inconsistent with the parent Button element.
It's bad practice to set `innerHTML` as this has a high performance cost. Instead of using `innerHTML` we switch to use `textContent` when the only thing being replaced is the text. When we insert multiple children nodes to the element (button), we now use the helper functions `getIndicatorHolder` and `getTextSpan` to separately generate the HTML Elements needed to insert as a child element to the button by using `insertAdjacentElement`.
1485574
to
468243d
Compare
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.
Changes all look good now, however please confirm what was tested before mering in
#681 (review)
|
Description
This change includes a transition from using hard-coded HTML strings to using the W3C Web API to create DOM elements programmatically. The main reason for this is for security purposes since this approach is an easy way to avoid injection vulnerabilities.
This PR also includes other tweaks like the addition of CSS and Element ID constants, 1 file rename, and other minor nits.
Systems Affected
WebSDK only
Validation
Tests
Test coverage for these changes are not needed since the only change was a switch to how DOM elements are created.
Screenshots
Nothing has visually changed in this PR.
This change is