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

Setting Action Cable #956

Merged
merged 222 commits into from
Aug 30, 2019
Merged
Show file tree
Hide file tree
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 May 5, 2019
d4131fd
ruby prof required as a dependency
cesswairimu May 5, 2019
9c21952
Configurations update for rails 4.0
cesswairimu May 5, 2019
c4a3cba
disable rubocop on bin folder
cesswairimu May 5, 2019
58b80a1
http patch
cesswairimu May 5, 2019
76d6e33
Comment out to allow testing
cesswairimu May 5, 2019
3d7d8ba
no longer supports plugin loading
cesswairimu May 5, 2019
8b2eaaf
lock to sprockets 2.12
cesswairimu May 5, 2019
ddb6d7c
Active record patches
cesswairimu May 5, 2019
a79930a
remove deprecated test syntax
cesswairimu May 6, 2019
a1d0aaf
fix failing tests
cesswairimu May 7, 2019
7cb7a4d
change new super class
cesswairimu May 7, 2019
2ef8715
replace right_aws with right_aws_api
cesswairimu May 9, 2019
fc838a8
lock to rails 4.2.11.1
cesswairimu May 14, 2019
b5b6340
change rails version in install script
cesswairimu May 14, 2019
6dc3a69
remove deprecation warnings
cesswairimu May 14, 2019
06f4d00
make app work
cesswairimu May 14, 2019
4db8646
Change test lib to minitest, add minitest reporters
cesswairimu May 11, 2019
6ddb5bc
active record find patches
cesswairimu May 15, 2019
4f31616
root_in_json include defaulted to false
cesswairimu May 16, 2019
76e078a
confirm option removed in link helper
cesswairimu May 16, 2019
5d613e8
cookies serializer changed to hybrid
cesswairimu May 16, 2019
80e12b7
Change render :text to :plain
cesswairimu May 16, 2019
01d86fa
console for dev web
cesswairimu May 16, 2019
db6c5fa
Check and fix interface functionality
cesswairimu May 18, 2019
290273f
fix export functionality
cesswairimu May 21, 2019
36c9208
add protected attributes for the warpable model
cesswairimu May 28, 2019
c53bf27
fix image upload
cesswairimu May 31, 2019
2f23252
Fix comments and images failing tests
cesswairimu Jun 1, 2019
0f76698
include mass assignment security in annotations
cesswairimu Jun 4, 2019
de27727
render html for update images
cesswairimu Jun 4, 2019
685143c
clear mail array before every test
cesswairimu Jun 4, 2019
74a9ecb
Fix codeclimate issues
cesswairimu Jun 5, 2019
daac614
skip failing test
cesswairimu Jun 7, 2019
528ec09
replace unprotected redirects
cesswairimu Jun 7, 2019
1d220ec
Fix codeclimate issues
cesswairimu Jun 5, 2019
5bb19c2
Autofixing rubocop offenses and Problematic test for #578 (#667)
alaxalves Jun 6, 2019
11dd71f
change post test to create since action new is a get action
cesswairimu Jun 7, 2019
fbb29ba
remove unprotected redirects
cesswairimu Jun 7, 2019
bba8fad
Fix codeclimate issues
cesswairimu Jun 7, 2019
6bc9a8c
Add yarn
kaustubh-nair Jun 10, 2019
116f385
Remove error log
kaustubh-nair Jun 10, 2019
75c2fef
Fix oauth icons
kaustubh-nair Jun 10, 2019
1f1dedd
Modify package.json
kaustubh-nair Jun 10, 2019
f7f526f
Add yarn install to start.sh
kaustubh-nair Jun 10, 2019
68385c3
Add leaflet google
kaustubh-nair Jun 10, 2019
ae88815
Remove leaflet-google from package json
kaustubh-nair Jun 10, 2019
49af138
remove passenger error logs
kaustubh-nair Jun 10, 2019
b34dd84
Fix install script
kaustubh-nair Jun 10, 2019
5c0c7c7
Remove flag
kaustubh-nair Jun 11, 2019
22e5312
Fix gemfile.lock
kaustubh-nair Jun 11, 2019
5da06ce
Fix gemfile.lock
kaustubh-nair Jun 11, 2019
2ecc4be
Merge branch 'yarn-bower' into development
kaustubh-nair Jun 11, 2019
d71d9ad
Fix login
kaustubh-nair Jun 11, 2019
1d1211f
Upgrade Gemfile to Rails 5.0
kaustubh-nair Jun 12, 2019
13cdef5
require rake'
kaustubh-nair Jun 12, 2019
c20a903
Change config files
kaustubh-nair Jun 12, 2019
5a28772
Add application record
kaustubh-nair Jun 12, 2019
df7b02f
Bump mysql
kaustubh-nair Jun 12, 2019
1c1e2c2
Local builds for Travis runners (#672)
alaxalves Jun 13, 2019
3385812
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves Jun 13, 2019
4cd47a4
Test yarn for travis
kaustubh-nair Jun 13, 2019
f0297dd
Conditionalize rake db:setup for travis
kaustubh-nair Jun 13, 2019
40ad993
Add semicolon
kaustubh-nair Jun 13, 2019
91d082f
Remove comment
kaustubh-nair Jun 13, 2019
0607a4f
modify database.yml
kaustubh-nair Jun 13, 2019
a3e7ff8
Migrate seperately
kaustubh-nair Jun 13, 2019
525eb1a
Run create only for production
kaustubh-nair Jun 13, 2019
4fb5be3
Locking newer Rails v
alaxalves Jun 13, 2019
d058ce3
Running update task
alaxalves Jun 13, 2019
d90db0e
Adding missing bootsnap gem
alaxalves Jun 13, 2019
6e28143
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves Jun 13, 2019
6545537
Fixing missing database
alaxalves Jun 13, 2019
24bd1f7
Adding missing listen gem
alaxalves Jun 13, 2019
e60bb83
Fixing schema example version
alaxalves Jun 13, 2019
6bedcc1
Fixing migration versions
alaxalves Jun 13, 2019
642beb4
Fix conflicts
kaustubh-nair Jun 16, 2019
2c746c1
Updating dependencies for Rails 5
alaxalves Jun 19, 2019
88b3c8a
Adding ApplicationMailer abstraction
alaxalves Jun 19, 2019
17f8e88
Adding required initializers
alaxalves Jun 19, 2019
463fd8d
Prefer require_relative instead of full path
alaxalves Jun 19, 2019
154f8b5
Making associations not required by default
alaxalves Jun 19, 2019
c9e8b1b
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves Jun 19, 2019
bccec1b
Regenerating schema file
alaxalves Jun 19, 2019
f678d95
Hotfixing MassAssigment
alaxalves Jun 19, 2019
f39d468
Upgrade web-console, remove mysql adapter override
kaustubh-nair Jun 20, 2019
c1837f1
Remove attr_accessible
kaustubh-nair Jun 20, 2019
cfca3ce
Add rails-controller-testing gem
kaustubh-nair Jun 20, 2019
47ce35a
Follow new syntax for tests
kaustubh-nair Jun 20, 2019
10cec89
Fix conflicts
kaustubh-nair Jun 20, 2019
ca9a118
Remove extra web-console from gemfile
kaustubh-nair Jun 20, 2019
d86282c
Regenerating lock file
alaxalves Jun 21, 2019
616f1fe
Fixing rubocop offenses and bundler version
alaxalves Jun 21, 2019
2495a8a
Using correct Paperclip class as in https://github.com/rails/rails/is…
alaxalves Jun 21, 2019
b2fdaea
Fix images functional tests
kaustubh-nair Jun 25, 2019
03bcfd3
images controller test typecast to string
kaustubh-nair Jun 25, 2019
672fabd
Fix rails logger
kaustubh-nair Jun 25, 2019
a146edb
Fix map tests
kaustubh-nair Jun 25, 2019
3a10c73
Bumping rubocop version
alaxalves Jun 27, 2019
e2e17e5
Autofixing rubocop offenses
alaxalves Jun 27, 2019
1340e4d
Including performance cop to rubocop
alaxalves Jun 27, 2019
37efb69
Refactoring deprecated routing and secret_token
alaxalves Jun 27, 2019
d81e8e0
Fixing routes for feed controller
alaxalves Jun 27, 2019
87bb313
Using correct routes for RSS builder
alaxalves Jun 27, 2019
a5726c7
Fixing missing routes
alaxalves Jun 28, 2019
b0b1dc0
Fixing travis bundler and yarn cache
alaxalves Jun 28, 2019
6cfd543
Fixing bundle path
alaxalves Jun 28, 2019
4fa14f2
Splitting bundle and yarn verifications
alaxalves Jun 29, 2019
b40bebd
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves Jul 2, 2019
d5ed24a
Autofixing rubocop offenses
alaxalves Jul 2, 2019
5db0ac9
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves Jul 2, 2019
6cf32f7
Fixing prod host for travis, private class usage and rubocop offenses
alaxalves Jul 3, 2019
8512b65
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves Jul 3, 2019
18436ae
Upgrade to Rails 5.2 (#685)
kaustubh-nair Jul 3, 2019
3f12c76
Merge branch 'rails-5' of https://github.com/publiclab/mapknitter int…
alaxalves Jul 3, 2019
e67ed3b
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves Jul 3, 2019
297bcb0
Enforcing params usage on get method
alaxalves Jul 3, 2019
e3f3c9d
Using correct folder names to Rails >5 conventions
alaxalves Jul 3, 2019
3291e16
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves Jul 6, 2019
553d8ea
Enforcing params wrapping and adding missing front_ui route
alaxalves Jul 6, 2019
85f54a5
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves Jul 10, 2019
3b1f578
Precompiling assets before serving
alaxalves Jul 11, 2019
b57356d
Improving Jenkins startup script
alaxalves Jul 12, 2019
9b0487e
WIP action cable setup
ViditChitkara Jul 4, 2019
3b7b2bf
basic action cable setup complete
ViditChitkara Jul 6, 2019
10d42f4
minor change
ViditChitkara Jul 6, 2019
c7af515
minor changes
ViditChitkara Jul 10, 2019
826745f
few changes
ViditChitkara Jul 14, 2019
63b0a89
Using supported docker yaml version by Jenkins
alaxalves Jul 15, 2019
5678f71
Adding task to check database existance
alaxalves Jul 15, 2019
43d86e1
Improving start script
alaxalves Jul 15, 2019
658d4ea
Improving Makefile's recipes and target
alaxalves Jul 15, 2019
0c685d1
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves Jul 15, 2019
1c61d3a
Adding task to check database existance
alaxalves Jul 15, 2019
381704c
Improving start script
alaxalves Jul 15, 2019
85bb1eb
Improving Makefile's recipes and target
alaxalves Jul 15, 2019
431164d
Improving Makefile's recipes and target
alaxalves Jul 15, 2019
63c6a59
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves Jul 15, 2019
2abced6
Merge branch 'fix-missing-steps-jenkins' of https://github.com/public…
alaxalves Jul 15, 2019
8d85686
Patching https://github.com/publiclab/mapknitter/pull/803
alaxalves Jul 16, 2019
d91554e
Improving Jenkins setup
alaxalves Jul 16, 2019
6e8e33b
initial working functionality complete
ViditChitkara Jul 18, 2019
f4005d0
Fix map loading
kaustubh-nair Jul 20, 2019
9d7267d
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves Jul 22, 2019
58bc692
h
sashadev-sky Jul 25, 2019
f8d2b8d
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves Jul 26, 2019
bf66f69
Fixing Leaflet-Environmental-Layers map loading
alaxalves Jul 26, 2019
997a6fa
h
sashadev-sky Jul 25, 2019
ab615b5
leaflet
sashadev-sky Jul 26, 2019
3dd385a
fix
sashadev-sky Jul 26, 2019
c785c63
change
sashadev-sky Jul 26, 2019
cc22333
updates
sashadev-sky Jul 26, 2019
81d496f
stop precompiling assets
sashadev-sky Jul 26, 2019
4cb16b0
precompile
sashadev-sky Jul 26, 2019
1fbba3a
Merge branch 'lfix' of https://github.com/sashadev-sky/mapknitter int…
alaxalves Jul 26, 2019
ccafe26
Using correct Yarn, NPM and Node version, avoiding mismatch
alaxalves Jul 26, 2019
b80b315
Removing unwanted tags.js invocation
alaxalves Jul 29, 2019
85f1b3c
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves Jul 29, 2019
2d12491
Improving Makefile recipe
alaxalves Jul 30, 2019
906beb3
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves Jul 30, 2019
552fc70
Using node_modules/ as dependencies folder, since https://github.com/…
alaxalves Jul 30, 2019
2773d0e
Upgrading Yarn dependencies
alaxalves Jul 30, 2019
15369b4
Removing duplicate rubocop directive
alaxalves Jul 30, 2019
41a0c3e
Removing test/ from codeclimate checks
alaxalves Jul 30, 2019
4d2c947
Removing fixed FIXME comments
alaxalves Jul 30, 2019
0970e84
Removing fixed FIXME comments
alaxalves Jul 30, 2019
de5774b
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves Jul 30, 2019
2211dc4
Updating docs in README
alaxalves Jul 30, 2019
53d8aad
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves Jul 30, 2019
193f553
Refactoring code
alaxalves Jul 30, 2019
ca0c2fc
Bumping recaptcha and include methods
alaxalves Aug 2, 2019
454cf2f
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves Aug 4, 2019
852d5f9
Adding Foreman gem
alaxalves Aug 4, 2019
8fd235d
Scheduling Puma and Passenger servers
alaxalves Aug 4, 2019
a158e77
WIP action cable setup
ViditChitkara Jul 4, 2019
35aa34f
basic action cable setup complete
ViditChitkara Jul 6, 2019
2610522
minor change
ViditChitkara Jul 6, 2019
4040bc3
minor changes
ViditChitkara Jul 10, 2019
e231418
few changes
ViditChitkara Jul 14, 2019
55baec4
initial working functionality complete
ViditChitkara Jul 18, 2019
4904217
Refactoring code
alaxalves Jul 30, 2019
53084a1
Adding Foreman gem
alaxalves Aug 4, 2019
add9f16
Scheduling Puma and Passenger servers
alaxalves Aug 4, 2019
87deccd
few minor fix
ViditChitkara Aug 4, 2019
2432805
added a few tests
ViditChitkara Aug 6, 2019
98a6ca7
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves Aug 6, 2019
2f9f6eb
Merge branch 'action-cable-integration' of https://github.com/publicl…
alaxalves Aug 6, 2019
a389a97
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves Aug 6, 2019
54b5ef7
Refactoring connection module
alaxalves Aug 6, 2019
74b75ca
Fixing migration version
alaxalves Aug 6, 2019
fdcd38a
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves Aug 6, 2019
9191cf6
Using strong params in requests
alaxalves Aug 6, 2019
d0bdd43
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves Aug 6, 2019
0148e7a
Using strong params in requests
alaxalves Aug 6, 2019
855089a
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves Aug 6, 2019
df2f8f1
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
kaustubh-nair Aug 10, 2019
6b59103
Use Rack::Test::UploadedFile instead of ActionDispatch::Http::Uploade…
kaustubh-nair Aug 10, 2019
d07cd13
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves Aug 14, 2019
f271a84
added documentation
ViditChitkara Aug 14, 2019
fe95fc8
added more docs
ViditChitkara Aug 14, 2019
53bd5ab
added tests
ViditChitkara Aug 14, 2019
3f09e8d
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
kaustubh-nair Aug 15, 2019
a1fe6ad
Fix minor asset issue
kaustubh-nair Aug 15, 2019
a900b99
Remove manual asset references and add them to application js
kaustubh-nair Aug 15, 2019
0a18f29
Fix asset ordering in application.js
kaustubh-nair Aug 15, 2019
ad142c5
Configure System tests (#936)
kaustubh-nair Aug 15, 2019
cacf26d
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves Aug 16, 2019
a522eaa
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves Aug 16, 2019
3b2274a
Merge branch 'action-cable-integration' of https://github.com/publicl…
alaxalves Aug 16, 2019
ac8e40c
Using puma as dependency and correct image controller
alaxalves Aug 16, 2019
f002ad0
added a few tests
ViditChitkara Aug 18, 2019
1464157
a few changes
ViditChitkara Aug 18, 2019
b033cc5
remove unnecessary render
ViditChitkara Aug 19, 2019
e568fbe
few test fixes
ViditChitkara Aug 20, 2019
87e18ee
Merge branch 'main' of https://github.com/publiclab/mapknitter into d…
alaxalves Aug 20, 2019
7779a96
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves Aug 20, 2019
843a719
action cable setup (#805)
ViditChitkara Aug 21, 2019
f78cbc9
Fixing CodeClimate issues
alaxalves Aug 21, 2019
1627b96
Synch editing add ons (#957)
ViditChitkara Aug 23, 2019
6823601
Merge branch 'main' of https://github.com/publiclab/mapknitter into a…
alaxalves Aug 27, 2019
d14c56b
Merge branch 'development' of https://github.com/publiclab/mapknitter…
alaxalves Aug 30, 2019
6c4a998
Undoing unwanted pattern set by Rubocop
alaxalves Aug 30, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ group :dependencies do
gem 'bootsnap', '~> 1.4.4'
gem 'turbolinks', '~> 5'
gem 'mini_magick', '~> 4.8'
gem 'puma', '~> 4.1.0'

# if you use amazon s3 for warpable image storage
gem 'aws-sdk', '~> 1.5.7'
Expand All @@ -37,12 +38,15 @@ group :dependencies do
# compiling markdown to html
gem 'rdiscount', '2.2.0.1'

# Process manager for applications with multiple components
gem 'foreman', '~> 0.85.0'

# asset pipelining
gem 'bootstrap-sass'
gem 'sassc-rails'
gem 'jquery-rails'
gem 'sprockets', '3.7.2'
gem "sprockets-rails"
gem 'sprockets-rails'
gem 'sass', require: 'sass'
gem 'autoprefixer-rails', '~> 9.6.1'
gem 'uglifier', '~> 4.1.20'
Expand All @@ -65,11 +69,11 @@ end

group :development, :test do
gem 'capybara'
gem 'puma'
gem 'selenium-webdriver'
gem 'byebug', '~> 11.0.1', platforms: [:mri, :mingw, :x64_mingw]
gem 'faker', '~> 2.1.2'
gem 'pry-rails', '~> 0.3.9'
gem 'action-cable-testing'
end

group :development do
Expand Down
17 changes: 11 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ GEM
RubyInline (3.12.4)
ZenTest (~> 4.3)
ZenTest (4.11.2)
action-cable-testing (0.6.0)
actioncable (>= 5.0)
actioncable (5.2.3)
actionpack (= 5.2.3)
nio4r (~> 2.0)
Expand Down Expand Up @@ -89,6 +91,8 @@ GEM
faker (2.1.2)
i18n (>= 0.8)
ffi (1.11.1)
foreman (0.85.0)
thor (~> 0.19.1)
friendly_id (5.2.5)
activerecord (>= 4.0.0)
geokit (1.13.1)
Expand Down Expand Up @@ -210,7 +214,7 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.1.0)
rails-html-sanitizer (1.2.0)
loofah (~> 2.2, >= 2.2.2)
rails-perftest (0.0.7)
railties (5.2.3)
Expand Down Expand Up @@ -261,9 +265,8 @@ GEM
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sassc (2.0.1)
sassc (2.1.0)
ffi (~> 1.9)
rake
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
Expand Down Expand Up @@ -296,7 +299,7 @@ GEM
sqlite3 (1.4.1)
terrapin (0.6.0)
climate_control (>= 0.0.3, < 1.0)
thor (0.20.3)
thor (0.19.4)
thread_safe (0.3.6)
tilt (2.0.9)
turbolinks (5.2.0)
Expand Down Expand Up @@ -330,14 +333,16 @@ PLATFORMS

DEPENDENCIES
RubyInline (~> 3.12.4)
autoprefixer-rails (~> 9.6.1)
action-cable-testing
autoprefixer-rails (~> 9.5.1.1)
aws-sdk (~> 1.5.7)
bootsnap (~> 1.4.4)
bootstrap-sass
byebug (~> 11.0.1)
capybara
codecov
faker (~> 2.1.2)
foreman (~> 0.85.0)
friendly_id
geokit-rails (= 1.1.4)
httparty
Expand All @@ -357,7 +362,7 @@ DEPENDENCIES
passenger
popper_js (~> 1.11, >= 1.11.1)
pry-rails (~> 0.3.9)
puma
puma (~> 4.1.0)
rack_session_access
rails (~> 5.2.3)
rails-controller-testing
Expand Down
2 changes: 2 additions & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
passenger: passenger start
puma: puma -C config/puma.rb
30 changes: 30 additions & 0 deletions SYNCHRONOUS_EDITING.md
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
67 changes: 34 additions & 33 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,42 @@
//


//= require leaflet/dist/leaflet-src.js
// = require leaflet/dist/leaflet-src.js
Copy link
Member

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!!! 👍

Copy link
Member Author

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!

Copy link
Member Author

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?

Copy link
Member

Choose a reason for hiding this comment

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

aha! Rubocop! 😄 Thank you!


//= require jquery
//= require jquery-ujs
//= require jquery/dist/jquery.js
//= require jquery-ujs/src/rails.js
//= require jquery-ui/jquery-ui.min.js
// = require jquery
// = require jquery-ujs
// = require jquery/dist/jquery.js
// = require jquery-ujs/src/rails.js
// = require jquery-ui/jquery-ui.min.js

//= require blueimp-tmpl/js/tmpl.js
//= require blueimp-file-upload/js/vendor/jquery.ui.widget
//= require blueimp-file-upload/js/jquery.fileupload
//= require blueimp-file-upload/js/jquery.fileupload-process
//= require blueimp-file-upload/js/jquery.fileupload-ui
// = require blueimp-tmpl/js/tmpl.js
// = require blueimp-file-upload/js/vendor/jquery.ui.widget
// = require blueimp-file-upload/js/jquery.fileupload
// = require blueimp-file-upload/js/jquery.fileupload-process
// = require blueimp-file-upload/js/jquery.fileupload-ui

//= require bootstrap/dist/js/bootstrap.js
// = require bootstrap/dist/js/bootstrap.js

//= require leaflet-fullHash.js
//= require leaflet-providers/leaflet-providers.js
//= require leaflet-environmental-layers/dist/LeafletEnvironmentalLayers.js
//= require leaflet-environmental-layers/src/windRoseLayer.js
//= require leaflet-easybutton/src/easy-button.js
//= require sparklines/source/sparkline.js
//= require glfx-js/dist/glfx.js
//= require ion-rangeslider/js/ion.rangeSlider.js
//= require exif-js/exif.js
//= require webgl-distort/dist/webgl-distort.js
//= require mapknitter/core/Class.js
//= require leaflet-spin/example/spin/dist/spin.min.js
//= require leaflet-spin/example/leaflet.spin.min.js
//= require image-sequencer/dist/image-sequencer.js
//= require leaflet-toolbar/dist/leaflet.toolbar.js
//= require leaflet-draw/dist/leaflet.draw-src.js
//= require leaflet-distortableimage/dist/leaflet.distortableimage.js
//= require leaflet-illustrate/dist/Leaflet.Illustrate.js
//= require leaflet-distortableimage/src/edit/tools/EditAction.js
//= require mapknitter/Map.js
// = require leaflet-fullHash.js
// = require leaflet-providers/leaflet-providers.js
// = require leaflet-environmental-layers/dist/LeafletEnvironmentalLayers.js
// = require leaflet-environmental-layers/src/windRoseLayer.js
// = require leaflet-easybutton/src/easy-button.js
// = require sparklines/source/sparkline.js
// = require glfx-js/dist/glfx.js
// = require ion-rangeslider/js/ion.rangeSlider.js
// = require exif-js/exif.js
// = require webgl-distort/dist/webgl-distort.js
// = require mapknitter/core/Class.js
// = require leaflet-spin/example/spin/dist/spin.min.js
// = require leaflet-spin/example/leaflet.spin.min.js
// = require image-sequencer/dist/image-sequencer.js
// = require leaflet-toolbar/dist/leaflet.toolbar.js
// = require leaflet-draw/dist/leaflet.draw-src.js
// = require leaflet-illustrate/dist/Leaflet.Illustrate.js
// = require leaflet-distortableimage/dist/leaflet.distortableimage.js
// = require leaflet-distortableimage/src/edit/tools/EditAction.js
// = require mapknitter/Map.js
// = require cable.js

//= require_tree .
// = require_tree .
11 changes: 11 additions & 0 deletions app/assets/javascripts/cable.js
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);
31 changes: 31 additions & 0 deletions app/assets/javascripts/channels/concurrent_editing.js
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()
});
}
});
Loading