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

New capture code route and view at /v2 #660

Merged
merged 1 commit into from
Jul 3, 2021

Conversation

waridrox
Copy link
Member

@waridrox waridrox commented Jun 20, 2021

Part of #645
Make sure these boxes are checked before your pull request is ready to be reviewed and merged. Thanks!

  • tests pass -- rake test
  • code is in uniquely-named feature branch, and has been rebased on top of latest master (especially if you've been asked to make additional changes)
  • pull request are descriptively named
  • if possible, multiple commits squashed if they're smaller changes
  • reviewed/confirmed/tested by another contributor or maintainer

Not sure if it is a great idea to create JS and CSS files in the assets folder...
So, this would probably require a lot of re-factoring but the integration works on both the old and the new url at /v2 on Chrome and Firefox. Safari is still out of luck :( Need some help there

CC: @jywarren @pydevsg

@gitpod-io
Copy link

gitpod-io bot commented Jun 20, 2021

@jywarren
Copy link
Member

jywarren commented Jun 20, 2021 via email

@waridrox
Copy link
Member Author

Sure @jywarren, but I was thinking if it is a good way to directly use the dependency files from the node_modules folder alone by configuring the assets path to something like

config.assets.paths << Rails.root.join("node_modules")

Or should I stick with installing the dependencies to the assets folder ?
Thanks

@jywarren
Copy link
Member

configuring the assets path

this sounds like a great idea! Sometimes, it's been nice to be able to directly link to a publicly readable file from our node_modules, like a stylesheet or something. So i've found it helpful for that folder to be placed within /public/ -- but see how it works, we can always adjust later!

@waridrox waridrox mentioned this pull request Jun 22, 2021
5 tasks
@jywarren
Copy link
Member

To speed up GitPod startup, why don't we add to the gitpod config -- i think we need to upgrade the bundler version?

bundle install --without production &&

@jywarren
Copy link
Member

Regarding Safari, why don't we open an issue for it for now and keep documenting. It could be related to Flot being so old (or a flot safari isssue? https://github.com/flot/flot/search?q=safari&type=issues), and it's possible the fix is really to upgrade to a newer graphing library. But let's not let it block other progress just yet! Notice the old version also doesn't work in Safari.

@@ -1,5 +1,15 @@
//= require graph.js
// window.webcam.getCameraList()
Copy link
Member

Choose a reason for hiding this comment

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

OK, so here, we shouldn't need to change this file at all - in fact, we should be able to point the new html file at the newly upgraded library from #668 -- and perhaps for the time being we should avoid any changes to application.js so as to not touch any existing working systems. By separating out the included JS and CSS files for the new interface, we keep the dependencies for each interface separate until we're sure it's all working. How does that sound?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought maybe the old capture interface could benefit from the new integration since that would also allow for cross browser support on the old interface along with the new one...

@@ -0,0 +1,363 @@
<%= stylesheet_link_tag "new-capture" %>

Copy link
Member

Choose a reason for hiding this comment

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

Here we can link directly to the relevant JS files from #668 to work outside of the asset pipeline until we get this page working. Can we try that?

@waridrox waridrox force-pushed the newCapture branch 3 times, most recently from fe52654 to c9bfc4b Compare July 2, 2021 13:55
@waridrox
Copy link
Member Author

waridrox commented Jul 2, 2021

Hi @jywarren 👋, just added a new route and view for the new capture interface at /v2. Capture code still remains untouched!!

@waridrox waridrox requested a review from jywarren July 2, 2021 13:57
@waridrox waridrox changed the title New capture code integration at /v2 New capture code route and view at /v2 Jul 2, 2021
@waridrox waridrox requested a review from pydevsg July 2, 2021 14:01
Copy link
Member

@pydevsg pydevsg left a comment

Choose a reason for hiding this comment

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

Good work @waridrox 🎉
Please add a screenshot of the UI change.
Rest code is fine :D

@waridrox
Copy link
Member Author

waridrox commented Jul 2, 2021

Sure, here's the view at /v2 URL:
Screenshot 2021-07-02 at 8 05 58 PM

The styling hasn't been added to the page yet 😅.

@pydevsg
Copy link
Member

pydevsg commented Jul 2, 2021

Ah, ok do create a separate PR for the same and style the page :p

Copy link
Member

@pydevsg pydevsg left a comment

Choose a reason for hiding this comment

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

Great work @waridrox 🎉

@jywarren
Copy link
Member

jywarren commented Jul 3, 2021

OK, i'm merging now after testing this out. I'd like to think a bit about how we can use system tests to better protect our core functions such as the capture, display, and upload functions. I think we have some test coverage but not sure how comprehensive it is.

Also, I noted that GitPod is having some trouble as our Gemfile.lock specifies an older version of bundler and so we need to install it with gem install bundle:1.17.3 or something like that before it runs smoothly. I think we could smooth the gitpod experience by maybe removing the bundler version requirement from the gemfile.lock file?

@jywarren
Copy link
Member

jywarren commented Jul 3, 2021

image

@jywarren jywarren merged commit 8f89e0f into publiclab:main Jul 3, 2021
@jywarren
Copy link
Member

jywarren commented Jul 3, 2021

Great work @waridrox!!!!

@jywarren
Copy link
Member

jywarren commented Jul 3, 2021

Let's at least ensure that the new capture page is built with good system test protection. If it's possible to write some basic system tests for other existing pages as well it may speed our work by reducing uncertainty whenever we merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants