-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Selection scraper created and integrated to project #6732
Conversation
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.
Looks solid! Just a few formatting comments
src/libs/SelectionScraper/index.js
Outdated
const tagAttribute = 'data-testid'; | ||
|
||
/** | ||
* Reads html of selection. If there is no Selection API returns empty string. |
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.
If there is no selection, the API
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.
I meant if browser doesn't support Selection API, Is it OK if I update it like that?
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.
Hi @thienlnam, I've updated all comments, can you recheck, if they are OK?
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.
Yes that update is good 👍 (just missing one more comment I left unresolved)
} else { | ||
node = range.commonAncestorContainer.parentNode.closest(`[${tagAttribute}]`); | ||
} |
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.
When is this the case? / What does this else indicate
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.
Still looking for this comment, on why the parentNode would have the closest tag attribute instead of the current node
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.
Comments look good, missing one comment and also looks like you have a large change with your package-lock.json that should be removed
} else { | ||
node = range.commonAncestorContainer.parentNode.closest(`[${tagAttribute}]`); | ||
} |
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.
Still looking for this comment, on why the parentNode would have the closest tag attribute instead of the current node
Hey @thienlnam, sorry for the package-lock.json file, I removed it but now all tests are failing. Is this normal? Also added the comment you requested along with a bugfix for Chrome. |
Sorry I should have clarified, package-lock.json file should be included but for some reason your package-lock.json diff seemed to be way too large to just include the new changes for packages you installed. The tests are failing since you added new packages in package.json but the package-lock.json doesn't have them. Could you try doing an npm install and then adding those changes again? |
@thienlnam, I updated package-lock.json file. Can you check please? It looks like using newer version of node.js or npm causes big changes on package-lock.json file. kursat@kursat-laptop:~$ node -v
v14.18.1
kursat@kursat-laptop:~$ npm -v
8.2.0
kursat@kursat-laptop:~/WebstormProjects/upwork/ExpensifyApp$ npm i
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient... Can we add an engines section to package.json file to prevent other contributors to face the same problem? |
Yup that looks much better, thanks!
This is definitely something we can explore - feel free to propose the issue in the #expensify-open-source slack channel and then we can get the ball rolling from there |
🚀 Deployed to staging by @thienlnam in version: 1.1.24-19 🚀
|
🚀 Deployed to production by @francoisl in version: 1.1.24-19 🚀
|
A check contributed to the creation of invalid HTML tags when |
Details
Fixed Issues
$ #5142
Tests & QA Steps
Android / IOS
Web / Mobile Web / Desktop
Markdowns to Test
Test String I've Used
Tested On
Screenshots
I'll upload IOS and Desktop videos ASAP.
Web
5142-web.mp4
Mobile Web
5142-mobile-web.mp4
Desktop
5142-desktop.mp4
iOS
5142-ios.mp4
Android
5142-android.mp4