-
-
Notifications
You must be signed in to change notification settings - Fork 918
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
Add clipboard feature to web app #3887
Conversation
✅ Deploy Preview for origin-betaflight-app ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
This comment has been minimized.
This comment has been minimized.
Thanks for the suggestions @chmelevskij , applied! EDIT: It seems something is wrong, I will check it! |
Co-authored-by: Tomas Chmelevskij <[email protected]>
7469ef1
to
d350d62
Compare
This comment has been minimized.
This comment has been minimized.
how to test? |
Load JSON using VTX tab to test as CLI is WIP. |
I will try tomorrow again. It worked for me yesterday, maybe some change in the code. |
In my first tests today, I had the next error:
It needs to have the focus on the DOM. Looking at google this usually happens if I had the developers tools open. One workaroud is to add a simply The curious is that I've removed this alert and now it works too. The error has disappeared. @nerdCopter did you open the developers tools? If not, open them "after" pressing the paste to see if you get the same error than I posted here. The code of the clipboard seems to be working (so this PR is ok), the only problem is that maybe we need to add some workaround to the place where it's used. |
@nerdCopter if the clipboard works, then it fails later here:
this happens when validating the content of the clipboard with a json schema, to see if it's right. It cannot read the schema file. |
I've fixed the reading of the VTX Json Schema for PWA. Now it must work. |
This comment has been minimized.
This comment has been minimized.
I tried with you JSON and worked for me, maybe some problem under Linux. I will try to test it again. |
I think I know what is failing, I will push a fix this afternoon... |
just in case you need: BTFL_vtxtable_20240412_080648_FOXEERF405.json |
I've pushed a commit, but it does not fix the issue... I think this is where I need help from @chmelevskij ... The problem is loading the VTX JSON Schema, in local it works perfectly, but deployed to netlify not. I suspect that the "relative" url that I've used is not the correct way to do this. I'm a little lost with all this Vite stuff ;) Some suggestion? |
This comment has been minimized.
This comment has been minimized.
41a9655
to
c6fac9b
Compare
This comment has been minimized.
This comment has been minimized.
c6fac9b
to
0fa12c3
Compare
This comment has been minimized.
This comment has been minimized.
Finally working! It was missing an entry in the VITE config, to copy the JSON Schema. Maybe someday I will learn how to work with this vite thing ;) |
I'd rather say it is living in the wrong folder 📁😆 |
0fa12c3
to
d6e28fb
Compare
Quality Gate passedIssues Measures |
Moved the VTX schema to the "other" resource folder. I keep thinking that the resources and locales folder must be inside the src one, but this is for another PR. The locales was not done because the way than the original Chrome APP needed to load the translations, but now I think we can move it if we want. |
Do you want to test this code? Here you have an automated build: |
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.
- it worked! (
d6e28fbb
)
@McGiverGim I'd rather keep it separately. Those files don't need any extra processing from vite and are never really imported/referenced other than urls in the code. So vite wouldn't know where to pick them from. They are essentially what vite refers to as assets/public files. They need to keep the file names, paths and have no hashing. I'd rather move them to |
The problem like it is now, is that the developer must "search" for them in the tree. But if there is a "standard" folder for vite, it's ok for me to move them there. But as I said, that for a future PR. |
@chmelevskij any objections for merging this? |
Simply adds the clipboard option when is being executed with PWA. Until now, it was deactivated.