-
Notifications
You must be signed in to change notification settings - Fork 207
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
Setting Action Cable #956
Merged
Merged
Setting Action Cable #956
Changes from 221 commits
Commits
Show all changes
222 commits
Select commit
Hold shift + click to select a range
20c81a2
ActiveSupport::Testing::Performance extracted to a gem
cesswairimu d4131fd
ruby prof required as a dependency
cesswairimu 9c21952
Configurations update for rails 4.0
cesswairimu c4a3cba
disable rubocop on bin folder
cesswairimu 58b80a1
http patch
cesswairimu 76d6e33
Comment out to allow testing
cesswairimu 3d7d8ba
no longer supports plugin loading
cesswairimu 8b2eaaf
lock to sprockets 2.12
cesswairimu ddb6d7c
Active record patches
cesswairimu a79930a
remove deprecated test syntax
cesswairimu a1d0aaf
fix failing tests
cesswairimu 7cb7a4d
change new super class
cesswairimu 2ef8715
replace right_aws with right_aws_api
cesswairimu fc838a8
lock to rails 4.2.11.1
cesswairimu b5b6340
change rails version in install script
cesswairimu 6dc3a69
remove deprecation warnings
cesswairimu 06f4d00
make app work
cesswairimu 4db8646
Change test lib to minitest, add minitest reporters
cesswairimu 6ddb5bc
active record find patches
cesswairimu 4f31616
root_in_json include defaulted to false
cesswairimu 76e078a
confirm option removed in link helper
cesswairimu 5d613e8
cookies serializer changed to hybrid
cesswairimu 80e12b7
Change render :text to :plain
cesswairimu 01d86fa
console for dev web
cesswairimu db6c5fa
Check and fix interface functionality
cesswairimu 290273f
fix export functionality
cesswairimu 36c9208
add protected attributes for the warpable model
cesswairimu c53bf27
fix image upload
cesswairimu 2f23252
Fix comments and images failing tests
cesswairimu 0f76698
include mass assignment security in annotations
cesswairimu de27727
render html for update images
cesswairimu 685143c
clear mail array before every test
cesswairimu 74a9ecb
Fix codeclimate issues
cesswairimu daac614
skip failing test
cesswairimu 528ec09
replace unprotected redirects
cesswairimu 1d220ec
Fix codeclimate issues
cesswairimu 5bb19c2
Autofixing rubocop offenses and Problematic test for #578 (#667)
alaxalves 11dd71f
change post test to create since action new is a get action
cesswairimu fbb29ba
remove unprotected redirects
cesswairimu bba8fad
Fix codeclimate issues
cesswairimu 6bc9a8c
Add yarn
kaustubh-nair 116f385
Remove error log
kaustubh-nair 75c2fef
Fix oauth icons
kaustubh-nair 1f1dedd
Modify package.json
kaustubh-nair f7f526f
Add yarn install to start.sh
kaustubh-nair 68385c3
Add leaflet google
kaustubh-nair ae88815
Remove leaflet-google from package json
kaustubh-nair 49af138
remove passenger error logs
kaustubh-nair b34dd84
Fix install script
kaustubh-nair 5c0c7c7
Remove flag
kaustubh-nair 22e5312
Fix gemfile.lock
kaustubh-nair 5da06ce
Fix gemfile.lock
kaustubh-nair 2ecc4be
Merge branch 'yarn-bower' into development
kaustubh-nair d71d9ad
Fix login
kaustubh-nair 1d1211f
Upgrade Gemfile to Rails 5.0
kaustubh-nair 13cdef5
require rake'
kaustubh-nair c20a903
Change config files
kaustubh-nair 5a28772
Add application record
kaustubh-nair df7b02f
Bump mysql
kaustubh-nair 1c1e2c2
Local builds for Travis runners (#672)
alaxalves 3385812
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves 4cd47a4
Test yarn for travis
kaustubh-nair f0297dd
Conditionalize rake db:setup for travis
kaustubh-nair 40ad993
Add semicolon
kaustubh-nair 91d082f
Remove comment
kaustubh-nair 0607a4f
modify database.yml
kaustubh-nair a3e7ff8
Migrate seperately
kaustubh-nair 525eb1a
Run create only for production
kaustubh-nair 4fb5be3
Locking newer Rails v
alaxalves d058ce3
Running update task
alaxalves d90db0e
Adding missing bootsnap gem
alaxalves 6e28143
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves 6545537
Fixing missing database
alaxalves 24bd1f7
Adding missing listen gem
alaxalves e60bb83
Fixing schema example version
alaxalves 6bedcc1
Fixing migration versions
alaxalves 642beb4
Fix conflicts
kaustubh-nair 2c746c1
Updating dependencies for Rails 5
alaxalves 88b3c8a
Adding ApplicationMailer abstraction
alaxalves 17f8e88
Adding required initializers
alaxalves 463fd8d
Prefer require_relative instead of full path
alaxalves 154f8b5
Making associations not required by default
alaxalves c9e8b1b
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves bccec1b
Regenerating schema file
alaxalves f678d95
Hotfixing MassAssigment
alaxalves f39d468
Upgrade web-console, remove mysql adapter override
kaustubh-nair c1837f1
Remove attr_accessible
kaustubh-nair cfca3ce
Add rails-controller-testing gem
kaustubh-nair 47ce35a
Follow new syntax for tests
kaustubh-nair 10cec89
Fix conflicts
kaustubh-nair ca9a118
Remove extra web-console from gemfile
kaustubh-nair d86282c
Regenerating lock file
alaxalves 616f1fe
Fixing rubocop offenses and bundler version
alaxalves 2495a8a
Using correct Paperclip class as in https://github.com/rails/rails/is…
alaxalves b2fdaea
Fix images functional tests
kaustubh-nair 03bcfd3
images controller test typecast to string
kaustubh-nair 672fabd
Fix rails logger
kaustubh-nair a146edb
Fix map tests
kaustubh-nair 3a10c73
Bumping rubocop version
alaxalves e2e17e5
Autofixing rubocop offenses
alaxalves 1340e4d
Including performance cop to rubocop
alaxalves 37efb69
Refactoring deprecated routing and secret_token
alaxalves d81e8e0
Fixing routes for feed controller
alaxalves 87bb313
Using correct routes for RSS builder
alaxalves a5726c7
Fixing missing routes
alaxalves b0b1dc0
Fixing travis bundler and yarn cache
alaxalves 6cfd543
Fixing bundle path
alaxalves 4fa14f2
Splitting bundle and yarn verifications
alaxalves b40bebd
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves d5ed24a
Autofixing rubocop offenses
alaxalves 5db0ac9
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves 6cf32f7
Fixing prod host for travis, private class usage and rubocop offenses
alaxalves 8512b65
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves 18436ae
Upgrade to Rails 5.2 (#685)
kaustubh-nair 3f12c76
Merge branch 'rails-5' of https://github.com/publiclab/mapknitter int…
alaxalves e67ed3b
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves 297bcb0
Enforcing params usage on get method
alaxalves e3f3c9d
Using correct folder names to Rails >5 conventions
alaxalves 3291e16
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves 553d8ea
Enforcing params wrapping and adding missing front_ui route
alaxalves 85f54a5
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves 3b1f578
Precompiling assets before serving
alaxalves b57356d
Improving Jenkins startup script
alaxalves 9b0487e
WIP action cable setup
ViditChitkara 3b7b2bf
basic action cable setup complete
ViditChitkara 10d42f4
minor change
ViditChitkara c7af515
minor changes
ViditChitkara 826745f
few changes
ViditChitkara 63b0a89
Using supported docker yaml version by Jenkins
alaxalves 5678f71
Adding task to check database existance
alaxalves 43d86e1
Improving start script
alaxalves 658d4ea
Improving Makefile's recipes and target
alaxalves 0c685d1
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves 1c61d3a
Adding task to check database existance
alaxalves 381704c
Improving start script
alaxalves 85bb1eb
Improving Makefile's recipes and target
alaxalves 431164d
Improving Makefile's recipes and target
alaxalves 63c6a59
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves 2abced6
Merge branch 'fix-missing-steps-jenkins' of https://github.com/public…
alaxalves 8d85686
Patching https://github.com/publiclab/mapknitter/pull/803
alaxalves d91554e
Improving Jenkins setup
alaxalves 6e8e33b
initial working functionality complete
ViditChitkara f4005d0
Fix map loading
kaustubh-nair 9d7267d
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves 58bc692
h
sashadev-sky f8d2b8d
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves bf66f69
Fixing Leaflet-Environmental-Layers map loading
alaxalves 997a6fa
h
sashadev-sky ab615b5
leaflet
sashadev-sky 3dd385a
fix
sashadev-sky c785c63
change
sashadev-sky cc22333
updates
sashadev-sky 81d496f
stop precompiling assets
sashadev-sky 4cb16b0
precompile
sashadev-sky 1fbba3a
Merge branch 'lfix' of https://github.com/sashadev-sky/mapknitter int…
alaxalves ccafe26
Using correct Yarn, NPM and Node version, avoiding mismatch
alaxalves b80b315
Removing unwanted tags.js invocation
alaxalves 85f1b3c
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves 2d12491
Improving Makefile recipe
alaxalves 906beb3
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves 552fc70
Using node_modules/ as dependencies folder, since https://github.com/…
alaxalves 2773d0e
Upgrading Yarn dependencies
alaxalves 15369b4
Removing duplicate rubocop directive
alaxalves 41a0c3e
Removing test/ from codeclimate checks
alaxalves 4d2c947
Removing fixed FIXME comments
alaxalves 0970e84
Removing fixed FIXME comments
alaxalves de5774b
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves 2211dc4
Updating docs in README
alaxalves 53d8aad
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves 193f553
Refactoring code
alaxalves ca0c2fc
Bumping recaptcha and include methods
alaxalves 454cf2f
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves 852d5f9
Adding Foreman gem
alaxalves 8fd235d
Scheduling Puma and Passenger servers
alaxalves a158e77
WIP action cable setup
ViditChitkara 35aa34f
basic action cable setup complete
ViditChitkara 2610522
minor change
ViditChitkara 4040bc3
minor changes
ViditChitkara e231418
few changes
ViditChitkara 55baec4
initial working functionality complete
ViditChitkara 4904217
Refactoring code
alaxalves 53084a1
Adding Foreman gem
alaxalves add9f16
Scheduling Puma and Passenger servers
alaxalves 87deccd
few minor fix
ViditChitkara 2432805
added a few tests
ViditChitkara 98a6ca7
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves 2f9f6eb
Merge branch 'action-cable-integration' of https://github.com/publicl…
alaxalves a389a97
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves 54b5ef7
Refactoring connection module
alaxalves 74b75ca
Fixing migration version
alaxalves fdcd38a
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves 9191cf6
Using strong params in requests
alaxalves d0bdd43
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves 0148e7a
Using strong params in requests
alaxalves 855089a
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves df2f8f1
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
kaustubh-nair 6b59103
Use Rack::Test::UploadedFile instead of ActionDispatch::Http::Uploade…
kaustubh-nair d07cd13
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves f271a84
added documentation
ViditChitkara fe95fc8
added more docs
ViditChitkara 53bd5ab
added tests
ViditChitkara 3f09e8d
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
kaustubh-nair a1fe6ad
Fix minor asset issue
kaustubh-nair a900b99
Remove manual asset references and add them to application js
kaustubh-nair 0a18f29
Fix asset ordering in application.js
kaustubh-nair ad142c5
Configure System tests (#936)
kaustubh-nair cacf26d
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves a522eaa
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves 3b2274a
Merge branch 'action-cable-integration' of https://github.com/publicl…
alaxalves ac8e40c
Using puma as dependency and correct image controller
alaxalves f002ad0
added a few tests
ViditChitkara 1464157
a few changes
ViditChitkara b033cc5
remove unnecessary render
ViditChitkara e568fbe
few test fixes
ViditChitkara 87e18ee
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves 7779a96
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves 843a719
action cable setup (#805)
ViditChitkara f78cbc9
Fixing CodeClimate issues
alaxalves 1627b96
Synch editing add ons (#957)
ViditChitkara 6823601
Merge branch 'main' of https://github.com/publiclab/mapknitter into a…
alaxalves d14c56b
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves 6c4a998
Undoing unwanted pattern set by Rubocop
alaxalves File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
passenger: passenger start | ||
puma: puma -C config/puma.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
The new synchronous editing feature | ||
=================================== | ||
|
||
With the introduction of ActionCable to our system, it has been possible | ||
to do perform real-time tasks quite easily. We have used rail's default | ||
action cable to make a _concurrent_editing_channel.rb_ in the _app/channels_ folder, | ||
to handle all the incoming requests and consists of all the business | ||
logic as well. At the frontend we have, _app/javascripts/channels/concurrent_editing.js_ which | ||
handles the logic at the browser or the frontend. | ||
|
||
## Flow of the feature: | ||
|
||
1. When the map is updated, the _speak_ method of _concurrent_editing.js_ is called which requests | ||
the _sync_ method of _concurrent_editing_channel.rb_ to broadcast the updated data to | ||
the connected users. | ||
|
||
2. The broadcasted data is finally caught by the _received_ function of _app/javascripts/channels/concurrent_editing.js_ | ||
|
||
3. Finally the _received_ function calls the _synchronizeData_ function to update | ||
all the fresh data on the map. | ||
|
||
|
||
## Testing: | ||
|
||
1. The _action-cable-testing_ gem is used for the feature's testing. It has some really | ||
cool testing functionality which was required for our use case. | ||
|
||
2. Currently we have separate tests written for connection related features and channel | ||
specific features. The relevant files are test/channels/concurrent_editing_channel_test.rb and | ||
test/channels/connection_test.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// | ||
//= require action_cable | ||
//= require_self | ||
//= require_tree ./channels | ||
|
||
(function() { | ||
this.App || (this.App = {}); | ||
|
||
App.cable = ActionCable.createConsumer(); | ||
|
||
}).call(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* Handles all the frontend interactions with action cable and the server. */ | ||
|
||
App.concurrent_editing = App.cable.subscriptions.create( | ||
{ | ||
channel: "ConcurrentEditingChannel", | ||
mapSlug: window.location.href.split("/").pop() | ||
}, { | ||
connected: function() { | ||
// Called when the subscription is ready for use on the server | ||
}, | ||
|
||
disconnected: function() { | ||
// Called when the subscription has been terminated by the server | ||
}, | ||
|
||
received: function(data) { | ||
// Called when there's incoming data on the websocket for this channel | ||
window.mapknitter.synchronizeData(data.changes); | ||
}, | ||
|
||
speak: function(changes) { | ||
/* Called when an image is updated from Map.js ('saveImage' function). | ||
* This function calls concurrent_editing_channel.rb's 'sync' method | ||
* which is responsible for broadcasting the updated warpables | ||
* to all the user's connected to the concurrent_editing channel. */ | ||
return this.perform("sync", { | ||
changes: changes, | ||
map_slug: window.location.href.split("/").pop() | ||
}); | ||
} | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 @alaxalves this is re-introducing these spaces which cause these JS assets not to be compiled in. If this is intended, could you explain why? Just seeing this was recently undone by @kaustubh-nair and I feel like we may be crossing wires communication-wise here. Thanks!!! 👍
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.
Actually it was Rubocop's
rubocop --auto-fix
task. I will undo this. Thx for pointing it out!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.
@jywarren Just fixed this! Could you check it out again please?
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.
aha! Rubocop! 😄 Thank you!