Merging develop branch updated
This commit is contained in:
commit
0ac3c5fc86
44 changed files with 876 additions and 407 deletions
1
Gemfile
1
Gemfile
|
@ -62,6 +62,7 @@ gem 'fog'
|
||||||
gem 'fog-openstack'
|
gem 'fog-openstack'
|
||||||
|
|
||||||
gem 'pg'
|
gem 'pg'
|
||||||
|
gem 'scenic'
|
||||||
|
|
||||||
gem 'rgeo-geojson'
|
gem 'rgeo-geojson'
|
||||||
gem 'leaflet-rails'
|
gem 'leaflet-rails'
|
||||||
|
|
367
Gemfile.lock
367
Gemfile.lock
|
@ -1,15 +1,15 @@
|
||||||
GIT
|
GIT
|
||||||
remote: https://github.com/mina-deploy/mina.git
|
remote: https://github.com/mina-deploy/mina.git
|
||||||
revision: a66b55a72833b19ac0ffb240afb37c86c0227582
|
revision: 5f407b28be1cf05cdfaab0558285aa031c445491
|
||||||
specs:
|
specs:
|
||||||
mina (0.3.7)
|
mina (1.0.3)
|
||||||
open4 (~> 1.3.4)
|
open4 (~> 1.3.4)
|
||||||
rake
|
rake
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
CFPropertyList (2.3.2)
|
CFPropertyList (2.3.3)
|
||||||
actionmailer (4.2.7.1)
|
actionmailer (4.2.7.1)
|
||||||
actionpack (= 4.2.7.1)
|
actionpack (= 4.2.7.1)
|
||||||
actionview (= 4.2.7.1)
|
actionview (= 4.2.7.1)
|
||||||
|
@ -29,8 +29,11 @@ GEM
|
||||||
erubis (~> 2.7.0)
|
erubis (~> 2.7.0)
|
||||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||||
active_model_serializers (0.8.3)
|
active_model_serializers (0.10.2)
|
||||||
activemodel (>= 3.0)
|
actionpack (>= 4.1, < 6)
|
||||||
|
activemodel (>= 4.1, < 6)
|
||||||
|
jsonapi (~> 0.1.1.beta2)
|
||||||
|
railties (>= 4.1, < 6)
|
||||||
activejob (4.2.7.1)
|
activejob (4.2.7.1)
|
||||||
activesupport (= 4.2.7.1)
|
activesupport (= 4.2.7.1)
|
||||||
globalid (>= 0.3.0)
|
globalid (>= 0.3.0)
|
||||||
|
@ -47,7 +50,8 @@ GEM
|
||||||
minitest (~> 5.1)
|
minitest (~> 5.1)
|
||||||
thread_safe (~> 0.3, >= 0.3.4)
|
thread_safe (~> 0.3, >= 0.3.4)
|
||||||
tzinfo (~> 1.1)
|
tzinfo (~> 1.1)
|
||||||
addressable (2.3.8)
|
addressable (2.5.0)
|
||||||
|
public_suffix (~> 2.0, >= 2.0.2)
|
||||||
apipie-rails (0.3.1)
|
apipie-rails (0.3.1)
|
||||||
json
|
json
|
||||||
arel (6.0.3)
|
arel (6.0.3)
|
||||||
|
@ -55,74 +59,61 @@ GEM
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
activemodel (>= 3.0)
|
activemodel (>= 3.0)
|
||||||
responders
|
responders
|
||||||
ast (2.0.0)
|
ast (2.3.0)
|
||||||
astrolabe (1.3.0)
|
attr_required (1.0.1)
|
||||||
parser (>= 2.2.0.pre.3, < 3.0)
|
autoprefixer-rails (6.5.3)
|
||||||
attr_required (1.0.0)
|
|
||||||
autoprefixer-rails (5.2.1)
|
|
||||||
execjs
|
execjs
|
||||||
json
|
|
||||||
axlsx (2.0.1)
|
axlsx (2.0.1)
|
||||||
htmlentities (~> 4.3.1)
|
htmlentities (~> 4.3.1)
|
||||||
nokogiri (>= 1.4.1)
|
nokogiri (>= 1.4.1)
|
||||||
rubyzip (~> 1.0.0)
|
rubyzip (~> 1.0.0)
|
||||||
bcrypt (3.1.11)
|
bcrypt (3.1.11)
|
||||||
bindata (2.1.0)
|
bindata (2.3.4)
|
||||||
binding_of_caller (0.7.2)
|
binding_of_caller (0.7.2)
|
||||||
debug_inspector (>= 0.0.1)
|
debug_inspector (>= 0.0.1)
|
||||||
bootstrap-datepicker-rails (1.4.0)
|
bootstrap-datepicker-rails (1.6.4.1)
|
||||||
railties (>= 3.0)
|
railties (>= 3.0)
|
||||||
bootstrap-sass (3.3.5)
|
bootstrap-sass (3.3.7)
|
||||||
autoprefixer-rails (>= 5.0.0.1)
|
autoprefixer-rails (>= 5.2.1)
|
||||||
sass (>= 3.2.19)
|
sass (>= 3.3.4)
|
||||||
bootstrap-wysihtml5-rails (0.3.3.8)
|
bootstrap-wysihtml5-rails (0.3.3.8)
|
||||||
railties (>= 3.0)
|
railties (>= 3.0)
|
||||||
brakeman (3.1.1)
|
brakeman (3.4.1)
|
||||||
erubis (~> 2.6)
|
browser (2.3.0)
|
||||||
fastercsv (~> 1.5)
|
|
||||||
haml (>= 3.0, < 5.0)
|
|
||||||
highline (~> 1.6)
|
|
||||||
multi_json (~> 1.2)
|
|
||||||
ruby2ruby (>= 2.1.1, < 2.3.0)
|
|
||||||
ruby_parser (~> 3.7.0)
|
|
||||||
sass (~> 3.0)
|
|
||||||
slim (>= 1.3.6, < 4.0)
|
|
||||||
terminal-table (~> 1.4)
|
|
||||||
browser (2.2.0)
|
|
||||||
builder (3.2.2)
|
builder (3.2.2)
|
||||||
byebug (5.0.0)
|
byebug (9.0.6)
|
||||||
columnize (= 0.9.0)
|
capybara (2.10.1)
|
||||||
capybara (2.4.4)
|
addressable
|
||||||
mime-types (>= 1.16)
|
mime-types (>= 1.16)
|
||||||
nokogiri (>= 1.3.3)
|
nokogiri (>= 1.3.3)
|
||||||
rack (>= 1.0.0)
|
rack (>= 1.0.0)
|
||||||
rack-test (>= 0.5.4)
|
rack-test (>= 0.5.4)
|
||||||
xpath (~> 2.0)
|
xpath (~> 2.0)
|
||||||
carrierwave (0.10.0)
|
carrierwave (0.11.2)
|
||||||
activemodel (>= 3.2.0)
|
activemodel (>= 3.2.0)
|
||||||
activesupport (>= 3.2.0)
|
activesupport (>= 3.2.0)
|
||||||
json (>= 1.7)
|
json (>= 1.7)
|
||||||
mime-types (>= 1.16)
|
mime-types (>= 1.16)
|
||||||
chartkick (1.3.2)
|
mimemagic (>= 0.3.0)
|
||||||
childprocess (0.5.5)
|
chartkick (2.1.1)
|
||||||
|
childprocess (0.5.9)
|
||||||
ffi (~> 1.0, >= 1.0.11)
|
ffi (~> 1.0, >= 1.0.11)
|
||||||
clamav-client (3.0.0)
|
clamav-client (3.1.0)
|
||||||
cliver (0.3.2)
|
cliver (0.3.2)
|
||||||
coderay (1.1.0)
|
coderay (1.1.1)
|
||||||
coffee-rails (4.1.0)
|
coffee-rails (4.1.1)
|
||||||
coffee-script (>= 2.2.0)
|
coffee-script (>= 2.2.0)
|
||||||
railties (>= 4.0.0, < 5.0)
|
railties (>= 4.0.0, < 5.1.x)
|
||||||
coffee-script (2.4.1)
|
coffee-script (2.4.1)
|
||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.9.1.1)
|
coffee-script-source (1.10.0)
|
||||||
columnize (0.9.0)
|
|
||||||
concurrent-ruby (1.0.2)
|
concurrent-ruby (1.0.2)
|
||||||
crack (0.4.2)
|
crack (0.4.3)
|
||||||
safe_yaml (~> 1.0.0)
|
safe_yaml (~> 1.0.0)
|
||||||
database_cleaner (1.4.1)
|
database_cleaner (1.5.3)
|
||||||
debug_inspector (0.0.2)
|
debug_inspector (0.0.2)
|
||||||
deep_cloneable (2.2.1)
|
deep_cloneable (2.2.2)
|
||||||
activerecord (>= 3.1.0, < 5.2.0)
|
activerecord (>= 3.1.0, < 5.2.0)
|
||||||
devise (3.5.10)
|
devise (3.5.10)
|
||||||
bcrypt (~> 3.0)
|
bcrypt (~> 3.0)
|
||||||
|
@ -133,7 +124,7 @@ GEM
|
||||||
warden (~> 1.2.3)
|
warden (~> 1.2.3)
|
||||||
diff-lcs (1.2.5)
|
diff-lcs (1.2.5)
|
||||||
docile (1.1.5)
|
docile (1.1.5)
|
||||||
domain_name (0.5.24)
|
domain_name (0.5.20161021)
|
||||||
unf (>= 0.0.5, < 1.0.0)
|
unf (>= 0.0.5, < 1.0.0)
|
||||||
draper (2.1.0)
|
draper (2.1.0)
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
|
@ -141,14 +132,13 @@ GEM
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
request_store (~> 1.0)
|
request_store (~> 1.0)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
excon (0.49.0)
|
excon (0.54.0)
|
||||||
execjs (2.7.0)
|
execjs (2.7.0)
|
||||||
factory_girl (4.5.0)
|
factory_girl (4.7.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
faraday (0.9.1)
|
faraday (0.9.2)
|
||||||
multipart-post (>= 1.2, < 3)
|
multipart-post (>= 1.2, < 3)
|
||||||
fastercsv (1.5.5)
|
ffi (1.9.14)
|
||||||
ffi (1.9.6)
|
|
||||||
fission (0.5.0)
|
fission (0.5.0)
|
||||||
CFPropertyList (~> 2.2)
|
CFPropertyList (~> 2.2)
|
||||||
fog (1.38.0)
|
fog (1.38.0)
|
||||||
|
@ -188,12 +178,12 @@ GEM
|
||||||
fog-atmos (0.1.0)
|
fog-atmos (0.1.0)
|
||||||
fog-core
|
fog-core
|
||||||
fog-xml
|
fog-xml
|
||||||
fog-aws (0.9.2)
|
fog-aws (0.12.0)
|
||||||
fog-core (~> 1.27)
|
fog-core (~> 1.38)
|
||||||
fog-json (~> 1.0)
|
fog-json (~> 1.0)
|
||||||
fog-xml (~> 0.1)
|
fog-xml (~> 0.1)
|
||||||
ipaddress (~> 0.8)
|
ipaddress (~> 0.8)
|
||||||
fog-brightbox (0.10.1)
|
fog-brightbox (0.11.0)
|
||||||
fog-core (~> 1.22)
|
fog-core (~> 1.22)
|
||||||
fog-json
|
fog-json
|
||||||
inflecto (~> 0.0.2)
|
inflecto (~> 0.0.2)
|
||||||
|
@ -202,7 +192,7 @@ GEM
|
||||||
fog-json (~> 1.0)
|
fog-json (~> 1.0)
|
||||||
fog-xml (~> 0.1)
|
fog-xml (~> 0.1)
|
||||||
ipaddress (~> 0.8)
|
ipaddress (~> 0.8)
|
||||||
fog-core (1.38.0)
|
fog-core (1.43.0)
|
||||||
builder
|
builder
|
||||||
excon (~> 0.49)
|
excon (~> 0.49)
|
||||||
formatador (~> 0.2)
|
formatador (~> 0.2)
|
||||||
|
@ -220,22 +210,20 @@ GEM
|
||||||
fog-json (1.0.2)
|
fog-json (1.0.2)
|
||||||
fog-core (~> 1.0)
|
fog-core (~> 1.0)
|
||||||
multi_json (~> 1.10)
|
multi_json (~> 1.10)
|
||||||
fog-local (0.3.0)
|
fog-local (0.3.1)
|
||||||
fog-core (~> 1.27)
|
fog-core (~> 1.27)
|
||||||
fog-openstack (0.1.5)
|
fog-openstack (0.1.17)
|
||||||
fog-core (>= 1.38)
|
fog-core (>= 1.40)
|
||||||
fog-json (>= 1.0)
|
fog-json (>= 1.0)
|
||||||
fog-xml (>= 0.1)
|
|
||||||
ipaddress (>= 0.8)
|
ipaddress (>= 0.8)
|
||||||
fog-powerdns (0.1.1)
|
fog-powerdns (0.1.1)
|
||||||
fog-core (~> 1.27)
|
fog-core (~> 1.27)
|
||||||
fog-json (~> 1.0)
|
fog-json (~> 1.0)
|
||||||
fog-xml (~> 0.1)
|
fog-xml (~> 0.1)
|
||||||
fog-profitbricks (0.0.5)
|
fog-profitbricks (3.0.0)
|
||||||
fog-core
|
fog-core (~> 1.42)
|
||||||
fog-xml
|
fog-json (~> 1.0)
|
||||||
nokogiri
|
fog-rackspace (0.1.2)
|
||||||
fog-rackspace (0.1.1)
|
|
||||||
fog-core (>= 1.35)
|
fog-core (>= 1.35)
|
||||||
fog-json (>= 1.0)
|
fog-json (>= 1.0)
|
||||||
fog-xml (>= 0.1)
|
fog-xml (>= 0.1)
|
||||||
|
@ -254,7 +242,7 @@ GEM
|
||||||
fog-serverlove (0.1.2)
|
fog-serverlove (0.1.2)
|
||||||
fog-core
|
fog-core
|
||||||
fog-json
|
fog-json
|
||||||
fog-softlayer (1.1.1)
|
fog-softlayer (1.1.4)
|
||||||
fog-core
|
fog-core
|
||||||
fog-json
|
fog-json
|
||||||
fog-storm_on_demand (0.1.1)
|
fog-storm_on_demand (0.1.1)
|
||||||
|
@ -269,21 +257,21 @@ GEM
|
||||||
fog-voxel (0.1.0)
|
fog-voxel (0.1.0)
|
||||||
fog-core
|
fog-core
|
||||||
fog-xml
|
fog-xml
|
||||||
fog-vsphere (0.6.4)
|
fog-vsphere (1.5.1)
|
||||||
fog-core
|
fog-core
|
||||||
rbvmomi (~> 1.8)
|
rbvmomi (~> 1.9)
|
||||||
fog-xenserver (0.2.3)
|
fog-xenserver (0.2.3)
|
||||||
fog-core
|
fog-core
|
||||||
fog-xml
|
fog-xml
|
||||||
fog-xml (0.1.2)
|
fog-xml (0.1.2)
|
||||||
fog-core
|
fog-core
|
||||||
nokogiri (~> 1.5, >= 1.5.11)
|
nokogiri (~> 1.5, >= 1.5.11)
|
||||||
font-awesome-rails (4.4.0.0)
|
font-awesome-rails (4.7.0.0)
|
||||||
railties (>= 3.2, < 5.0)
|
railties (>= 3.2, < 5.1)
|
||||||
formatador (0.2.5)
|
formatador (0.2.5)
|
||||||
globalid (0.3.7)
|
globalid (0.3.7)
|
||||||
activesupport (>= 4.1.0)
|
activesupport (>= 4.1.0)
|
||||||
haml (4.0.6)
|
haml (4.0.7)
|
||||||
tilt
|
tilt
|
||||||
haml-rails (0.9.0)
|
haml-rails (0.9.0)
|
||||||
actionpack (>= 4.0.1)
|
actionpack (>= 4.0.1)
|
||||||
|
@ -291,103 +279,113 @@ GEM
|
||||||
haml (>= 4.0.6, < 5.0)
|
haml (>= 4.0.6, < 5.0)
|
||||||
html2haml (>= 1.0.1)
|
html2haml (>= 1.0.1)
|
||||||
railties (>= 4.0.1)
|
railties (>= 4.0.1)
|
||||||
hashie (3.4.1)
|
hashdiff (0.3.0)
|
||||||
highline (1.7.8)
|
hashie (3.4.6)
|
||||||
html2haml (2.0.0)
|
html2haml (2.0.0)
|
||||||
erubis (~> 2.7.0)
|
erubis (~> 2.7.0)
|
||||||
haml (~> 4.0.0)
|
haml (~> 4.0.0)
|
||||||
nokogiri (~> 1.6.0)
|
nokogiri (~> 1.6.0)
|
||||||
ruby_parser (~> 3.5)
|
ruby_parser (~> 3.5)
|
||||||
htmlentities (4.3.4)
|
htmlentities (4.3.4)
|
||||||
http-cookie (1.0.2)
|
http-cookie (1.0.3)
|
||||||
domain_name (~> 0.5)
|
domain_name (~> 0.5)
|
||||||
httpclient (2.6.0.1)
|
httpclient (2.8.2.4)
|
||||||
i18n (0.7.0)
|
i18n (0.7.0)
|
||||||
inflecto (0.0.2)
|
inflecto (0.0.2)
|
||||||
ipaddress (0.8.3)
|
ipaddress (0.8.3)
|
||||||
jbuilder (2.3.1)
|
jbuilder (2.6.0)
|
||||||
activesupport (>= 3.0.0, < 5)
|
activesupport (>= 3.0.0, < 5.1)
|
||||||
multi_json (~> 1.2)
|
multi_json (~> 1.2)
|
||||||
jquery-rails (4.0.4)
|
jquery-rails (4.2.1)
|
||||||
rails-dom-testing (~> 1.0)
|
rails-dom-testing (>= 1, < 3)
|
||||||
railties (>= 4.2.0)
|
railties (>= 4.2.0)
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
json (1.8.3)
|
json (1.8.3)
|
||||||
json-jwt (1.5.1)
|
json-jwt (1.6.5)
|
||||||
activesupport
|
activesupport
|
||||||
bindata
|
bindata
|
||||||
multi_json (>= 1.3)
|
multi_json (>= 1.3)
|
||||||
securecompare
|
securecompare
|
||||||
url_safe_base64
|
url_safe_base64
|
||||||
kaminari (0.16.3)
|
jsonapi (0.1.1.beta6)
|
||||||
|
jsonapi-parser (= 0.1.1.beta3)
|
||||||
|
jsonapi-renderer (= 0.1.1.beta1)
|
||||||
|
jsonapi-parser (0.1.1.beta3)
|
||||||
|
jsonapi-renderer (0.1.1.beta1)
|
||||||
|
kaminari (0.17.0)
|
||||||
actionpack (>= 3.0.0)
|
actionpack (>= 3.0.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
kgio (2.9.3)
|
kgio (2.10.0)
|
||||||
leaflet-draw-rails (0.1.0)
|
leaflet-draw-rails (0.1.0)
|
||||||
leaflet-markercluster-rails (0.7.0)
|
leaflet-markercluster-rails (0.7.0)
|
||||||
railties (>= 3.1)
|
railties (>= 3.1)
|
||||||
leaflet-rails (0.7.4)
|
leaflet-rails (0.7.7)
|
||||||
libv8 (3.16.14.7)
|
libv8 (3.16.14.15)
|
||||||
logstash-event (1.2.02)
|
logstash-event (1.2.02)
|
||||||
logstasher (0.6.5)
|
logstasher (1.0.1)
|
||||||
|
activerecord (>= 4.0)
|
||||||
|
activesupport (>= 4.0)
|
||||||
logstash-event (~> 1.2.0)
|
logstash-event (~> 1.2.0)
|
||||||
request_store
|
request_store
|
||||||
loofah (2.0.3)
|
loofah (2.0.3)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
mail (2.6.4)
|
mail (2.6.4)
|
||||||
mime-types (>= 1.16, < 4)
|
mime-types (>= 1.16, < 4)
|
||||||
mailjet (1.1.0)
|
mailjet (1.4.10)
|
||||||
activesupport (>= 3.1.0)
|
activesupport (>= 3.1.0)
|
||||||
rack (>= 1.4.0)
|
rack (>= 1.4.0)
|
||||||
rest-client
|
rest-client
|
||||||
maruku (0.7.2)
|
maruku (0.7.2)
|
||||||
method_source (0.8.2)
|
method_source (0.8.2)
|
||||||
mime-types (2.99.2)
|
mime-types (3.1)
|
||||||
|
mime-types-data (~> 3.2015)
|
||||||
|
mime-types-data (3.2016.0521)
|
||||||
|
mimemagic (0.3.2)
|
||||||
mini_portile2 (2.1.0)
|
mini_portile2 (2.1.0)
|
||||||
minitest (5.9.1)
|
minitest (5.9.1)
|
||||||
multi_json (1.11.2)
|
multi_json (1.12.1)
|
||||||
multipart-post (2.0.0)
|
multipart-post (2.0.0)
|
||||||
netrc (0.10.3)
|
netrc (0.11.0)
|
||||||
nokogiri (1.6.8.1)
|
nokogiri (1.6.8.1)
|
||||||
mini_portile2 (~> 2.1.0)
|
mini_portile2 (~> 2.1.0)
|
||||||
nyan-cat-formatter (0.11)
|
nyan-cat-formatter (0.11)
|
||||||
rspec (>= 2.99, >= 2.14.2, < 4)
|
rspec (>= 2.99, >= 2.14.2, < 4)
|
||||||
open4 (1.3.4)
|
open4 (1.3.4)
|
||||||
openid_connect (0.9.2)
|
openid_connect (0.12.0)
|
||||||
activemodel
|
activemodel
|
||||||
attr_required (>= 1.0.0)
|
attr_required (>= 1.0.0)
|
||||||
json (>= 1.4.3)
|
json (>= 1.4.3)
|
||||||
json-jwt (>= 1.5.0)
|
json-jwt (>= 1.5.0)
|
||||||
rack-oauth2 (>= 1.2.1)
|
rack-oauth2 (>= 1.3.1)
|
||||||
swd (>= 1.0.0)
|
swd (>= 1.0.0)
|
||||||
tzinfo
|
tzinfo
|
||||||
validate_email
|
validate_email
|
||||||
validate_url
|
validate_url
|
||||||
webfinger (>= 1.0.1)
|
webfinger (>= 1.0.1)
|
||||||
openstack (2.0.2)
|
openstack (3.3.3)
|
||||||
json
|
json
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
parallel (1.9.0)
|
parallel (1.9.0)
|
||||||
parallel_tests (1.9.0)
|
parallel_tests (1.9.0)
|
||||||
parallel
|
parallel
|
||||||
parser (2.2.2.2)
|
parser (2.3.1.4)
|
||||||
ast (>= 1.1, < 3.0)
|
ast (~> 2.2)
|
||||||
pg (0.18.2)
|
pg (0.19.0)
|
||||||
poltergeist (1.6.0)
|
poltergeist (1.11.0)
|
||||||
capybara (~> 2.1)
|
capybara (~> 2.1)
|
||||||
cliver (~> 0.3.1)
|
cliver (~> 0.3.1)
|
||||||
multi_json (~> 1.0)
|
|
||||||
websocket-driver (>= 0.2.0)
|
websocket-driver (>= 0.2.0)
|
||||||
powerpack (0.1.0)
|
powerpack (0.1.1)
|
||||||
pry (0.10.1)
|
pry (0.10.4)
|
||||||
coderay (~> 1.1.0)
|
coderay (~> 1.1.0)
|
||||||
method_source (~> 0.8.1)
|
method_source (~> 0.8.1)
|
||||||
slop (~> 3.4)
|
slop (~> 3.4)
|
||||||
pry-byebug (3.2.0)
|
pry-byebug (3.4.0)
|
||||||
byebug (~> 5.0)
|
byebug (~> 9.0)
|
||||||
pry (~> 0.10)
|
pry (~> 0.10)
|
||||||
rack (1.6.4)
|
public_suffix (2.0.4)
|
||||||
rack-oauth2 (1.2.1)
|
rack (1.6.5)
|
||||||
|
rack-oauth2 (1.4.0)
|
||||||
activesupport (>= 2.3)
|
activesupport (>= 2.3)
|
||||||
attr_required (>= 0.0.5)
|
attr_required (>= 0.0.5)
|
||||||
httpclient (>= 2.4)
|
httpclient (>= 2.4)
|
||||||
|
@ -395,7 +393,7 @@ GEM
|
||||||
rack (>= 1.1)
|
rack (>= 1.1)
|
||||||
rack-test (0.6.3)
|
rack-test (0.6.3)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
railroady (1.3.0)
|
railroady (1.5.2)
|
||||||
rails (4.2.7.1)
|
rails (4.2.7.1)
|
||||||
actionmailer (= 4.2.7.1)
|
actionmailer (= 4.2.7.1)
|
||||||
actionpack (= 4.2.7.1)
|
actionpack (= 4.2.7.1)
|
||||||
|
@ -420,65 +418,63 @@ GEM
|
||||||
activesupport (= 4.2.7.1)
|
activesupport (= 4.2.7.1)
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.18.1, < 2.0)
|
thor (>= 0.18.1, < 2.0)
|
||||||
rainbow (2.0.0)
|
rainbow (2.1.0)
|
||||||
raindrops (0.13.0)
|
raindrops (0.17.0)
|
||||||
rake (11.2.2)
|
rake (11.3.0)
|
||||||
rbvmomi (1.8.2)
|
rbvmomi (1.9.4)
|
||||||
builder
|
builder (~> 3.2)
|
||||||
nokogiri (>= 1.4.1)
|
json (>= 1.8)
|
||||||
trollop
|
nokogiri (~> 1.5)
|
||||||
rdoc (4.2.0)
|
trollop (~> 2.1)
|
||||||
json (~> 1.4)
|
rdoc (4.3.0)
|
||||||
ref (2.0.0)
|
ref (2.0.0)
|
||||||
request_store (1.1.0)
|
request_store (1.3.1)
|
||||||
responders (2.3.0)
|
responders (2.3.0)
|
||||||
railties (>= 4.2.0, < 5.1)
|
railties (>= 4.2.0, < 5.1)
|
||||||
rest-client (1.8.0)
|
rest-client (2.0.0)
|
||||||
http-cookie (>= 1.0.2, < 2.0)
|
http-cookie (>= 1.0.2, < 2.0)
|
||||||
mime-types (>= 1.16, < 3.0)
|
mime-types (>= 1.16, < 4.0)
|
||||||
netrc (~> 0.7)
|
netrc (~> 0.8)
|
||||||
rgeo (0.3.20)
|
rgeo (0.5.3)
|
||||||
rgeo-geojson (0.3.1)
|
rgeo-geojson (0.4.3)
|
||||||
rgeo (~> 0.3)
|
rgeo (~> 0.5)
|
||||||
rodf (0.3.7)
|
rodf (0.3.7)
|
||||||
activesupport (>= 3.0, < 6.0)
|
activesupport (>= 3.0, < 6.0)
|
||||||
builder (~> 3.0)
|
builder (~> 3.0)
|
||||||
rubyzip (~> 1.0)
|
rubyzip (~> 1.0)
|
||||||
rspec (3.2.0)
|
rspec (3.5.0)
|
||||||
rspec-core (~> 3.2.0)
|
rspec-core (~> 3.5.0)
|
||||||
rspec-expectations (~> 3.2.0)
|
rspec-expectations (~> 3.5.0)
|
||||||
rspec-mocks (~> 3.2.0)
|
rspec-mocks (~> 3.5.0)
|
||||||
rspec-core (3.2.3)
|
rspec-core (3.5.4)
|
||||||
rspec-support (~> 3.2.0)
|
rspec-support (~> 3.5.0)
|
||||||
rspec-expectations (3.2.1)
|
rspec-expectations (3.5.0)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.2.0)
|
rspec-support (~> 3.5.0)
|
||||||
rspec-mocks (3.2.1)
|
rspec-mocks (3.5.0)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.2.0)
|
rspec-support (~> 3.5.0)
|
||||||
rspec-rails (3.2.1)
|
rspec-rails (3.5.2)
|
||||||
actionpack (>= 3.0, < 4.3)
|
actionpack (>= 3.0)
|
||||||
activesupport (>= 3.0, < 4.3)
|
activesupport (>= 3.0)
|
||||||
railties (>= 3.0, < 4.3)
|
railties (>= 3.0)
|
||||||
rspec-core (~> 3.2.0)
|
rspec-core (~> 3.5.0)
|
||||||
rspec-expectations (~> 3.2.0)
|
rspec-expectations (~> 3.5.0)
|
||||||
rspec-mocks (~> 3.2.0)
|
rspec-mocks (~> 3.5.0)
|
||||||
rspec-support (~> 3.2.0)
|
rspec-support (~> 3.5.0)
|
||||||
rspec-support (3.2.2)
|
rspec-support (3.5.0)
|
||||||
rubocop (0.30.1)
|
rubocop (0.45.0)
|
||||||
astrolabe (~> 1.3)
|
parser (>= 2.3.1.1, < 3.0)
|
||||||
parser (>= 2.2.2.1, < 3.0)
|
|
||||||
powerpack (~> 0.1)
|
powerpack (~> 0.1)
|
||||||
rainbow (>= 1.99.1, < 3.0)
|
rainbow (>= 1.99.1, < 3.0)
|
||||||
ruby-progressbar (~> 1.4)
|
ruby-progressbar (~> 1.7)
|
||||||
rubocop-checkstyle_formatter (0.2.0)
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
||||||
rubocop (>= 0.20.1)
|
rubocop-checkstyle_formatter (0.3.0)
|
||||||
rubocop-rspec (1.3.0)
|
rubocop (>= 0.30.1)
|
||||||
ruby-progressbar (1.7.5)
|
rubocop-rspec (1.8.0)
|
||||||
ruby2ruby (2.1.4)
|
rubocop (>= 0.42.0)
|
||||||
ruby_parser (~> 3.1)
|
ruby-progressbar (1.8.1)
|
||||||
sexp_processor (~> 4.0)
|
ruby_parser (3.8.3)
|
||||||
ruby_parser (3.7.0)
|
|
||||||
sexp_processor (~> 4.1)
|
sexp_processor (~> 4.1)
|
||||||
rubyzip (1.0.0)
|
rubyzip (1.0.0)
|
||||||
safe_yaml (1.0.4)
|
safe_yaml (1.0.4)
|
||||||
|
@ -489,75 +485,74 @@ GEM
|
||||||
sprockets (>= 2.8, < 4.0)
|
sprockets (>= 2.8, < 4.0)
|
||||||
sprockets-rails (>= 2.0, < 4.0)
|
sprockets-rails (>= 2.0, < 4.0)
|
||||||
tilt (>= 1.1, < 3)
|
tilt (>= 1.1, < 3)
|
||||||
sdoc (0.4.1)
|
scenic (1.3.0)
|
||||||
|
activerecord (>= 4.0.0)
|
||||||
|
railties (>= 4.0.0)
|
||||||
|
sdoc (0.4.2)
|
||||||
json (~> 1.7, >= 1.7.7)
|
json (~> 1.7, >= 1.7.7)
|
||||||
rdoc (~> 4.0)
|
rdoc (~> 4.0)
|
||||||
securecompare (1.0.0)
|
securecompare (1.0.0)
|
||||||
selenium-webdriver (2.44.0)
|
selenium-webdriver (3.0.1)
|
||||||
childprocess (~> 0.5)
|
childprocess (~> 0.5)
|
||||||
multi_json (~> 1.0)
|
|
||||||
rubyzip (~> 1.0)
|
rubyzip (~> 1.0)
|
||||||
websocket (~> 1.0)
|
websocket (~> 1.0)
|
||||||
sentry-raven (0.13.1)
|
sentry-raven (2.1.2)
|
||||||
faraday (>= 0.7.6)
|
faraday (>= 0.7.6, < 0.10.x)
|
||||||
sexp_processor (4.6.0)
|
sexp_processor (4.7.0)
|
||||||
shoulda-matchers (2.8.0)
|
shoulda-matchers (3.1.1)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 4.0.0)
|
||||||
simplecov (0.9.1)
|
simplecov (0.12.0)
|
||||||
docile (~> 1.1.0)
|
docile (~> 1.1.0)
|
||||||
multi_json (~> 1.0)
|
json (>= 1.8, < 3)
|
||||||
simplecov-html (~> 0.8.0)
|
simplecov-html (~> 0.10.0)
|
||||||
simplecov-html (0.8.0)
|
simplecov-html (0.10.0)
|
||||||
slim (3.0.6)
|
|
||||||
temple (~> 0.7.3)
|
|
||||||
tilt (>= 1.3.3, < 2.1)
|
|
||||||
slop (3.6.0)
|
slop (3.6.0)
|
||||||
smart_listing (1.1.2)
|
smart_listing (1.2.0)
|
||||||
coffee-rails
|
coffee-rails
|
||||||
jquery-rails
|
jquery-rails
|
||||||
kaminari (~> 0.16.1)
|
kaminari (~> 0.17)
|
||||||
rails (>= 3.2)
|
rails (>= 3.2)
|
||||||
spreadsheet_architect (1.4.7)
|
spreadsheet_architect (1.4.7)
|
||||||
axlsx (>= 2.0)
|
axlsx (>= 2.0)
|
||||||
rodf (>= 0.3.6)
|
rodf (>= 0.3.6)
|
||||||
spring (1.3.6)
|
spring (2.0.0)
|
||||||
|
activesupport (>= 4.2)
|
||||||
spring-commands-rspec (1.0.4)
|
spring-commands-rspec (1.0.4)
|
||||||
spring (>= 0.9.1)
|
spring (>= 0.9.1)
|
||||||
sprockets (3.7.0)
|
sprockets (3.7.0)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
rack (> 1, < 3)
|
rack (> 1, < 3)
|
||||||
sprockets-rails (3.1.1)
|
sprockets-rails (3.2.0)
|
||||||
actionpack (>= 4.0)
|
actionpack (>= 4.0)
|
||||||
activesupport (>= 4.0)
|
activesupport (>= 4.0)
|
||||||
sprockets (>= 3.0.0)
|
sprockets (>= 3.0.0)
|
||||||
swd (1.0.0)
|
swd (1.0.1)
|
||||||
activesupport (>= 3)
|
activesupport (>= 3)
|
||||||
attr_required (>= 0.0.5)
|
attr_required (>= 0.0.5)
|
||||||
httpclient (>= 2.4)
|
httpclient (>= 2.4)
|
||||||
i18n
|
i18n
|
||||||
json (>= 1.4.3)
|
json (>= 1.4.3)
|
||||||
temple (0.7.6)
|
|
||||||
terminal-table (1.5.2)
|
|
||||||
therubyracer (0.12.2)
|
therubyracer (0.12.2)
|
||||||
libv8 (~> 3.16.14.0)
|
libv8 (~> 3.16.14.0)
|
||||||
ref
|
ref
|
||||||
thor (0.19.1)
|
thor (0.19.1)
|
||||||
thread_safe (0.3.5)
|
thread_safe (0.3.5)
|
||||||
tilt (2.0.5)
|
tilt (2.0.5)
|
||||||
timecop (0.7.3)
|
timecop (0.8.1)
|
||||||
trollop (2.1.2)
|
trollop (2.1.2)
|
||||||
turbolinks (2.5.3)
|
turbolinks (5.0.1)
|
||||||
coffee-rails
|
turbolinks-source (~> 5)
|
||||||
|
turbolinks-source (5.0.0)
|
||||||
tzinfo (1.2.2)
|
tzinfo (1.2.2)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
uglifier (3.0.2)
|
uglifier (3.0.3)
|
||||||
execjs (>= 0.3.0, < 3)
|
execjs (>= 0.3.0, < 3)
|
||||||
unf (0.1.4)
|
unf (0.1.4)
|
||||||
unf_ext
|
unf_ext
|
||||||
unf_ext (0.0.7.1)
|
unf_ext (0.0.7.2)
|
||||||
unicorn (4.9.0)
|
unicode-display_width (1.1.1)
|
||||||
|
unicorn (5.2.0)
|
||||||
kgio (~> 2.6)
|
kgio (~> 2.6)
|
||||||
rack
|
|
||||||
raindrops (~> 0.7)
|
raindrops (~> 0.7)
|
||||||
url_safe_base64 (0.2.2)
|
url_safe_base64 (0.2.2)
|
||||||
validate_email (0.1.6)
|
validate_email (0.1.6)
|
||||||
|
@ -566,26 +561,27 @@ GEM
|
||||||
validate_url (1.0.2)
|
validate_url (1.0.2)
|
||||||
activemodel (>= 3.0.0)
|
activemodel (>= 3.0.0)
|
||||||
addressable
|
addressable
|
||||||
vcr (3.0.1)
|
vcr (3.0.3)
|
||||||
warden (1.2.6)
|
warden (1.2.6)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
web-console (2.2.1)
|
web-console (2.3.0)
|
||||||
activemodel (>= 4.0)
|
activemodel (>= 4.0)
|
||||||
binding_of_caller (>= 0.7.2)
|
binding_of_caller (>= 0.7.2)
|
||||||
railties (>= 4.0)
|
railties (>= 4.0)
|
||||||
sprockets-rails (>= 2.0, < 4.0)
|
sprockets-rails (>= 2.0, < 4.0)
|
||||||
webfinger (1.0.1)
|
webfinger (1.0.2)
|
||||||
activesupport
|
activesupport
|
||||||
httpclient (>= 2.4)
|
httpclient (>= 2.4)
|
||||||
multi_json
|
multi_json
|
||||||
webmock (1.21.0)
|
webmock (2.1.0)
|
||||||
addressable (>= 2.3.6)
|
addressable (>= 2.3.6)
|
||||||
crack (>= 0.3.2)
|
crack (>= 0.3.2)
|
||||||
websocket (1.2.1)
|
hashdiff
|
||||||
websocket-driver (0.5.3)
|
websocket (1.2.3)
|
||||||
|
websocket-driver (0.6.4)
|
||||||
websocket-extensions (>= 0.1.0)
|
websocket-extensions (>= 0.1.0)
|
||||||
websocket-extensions (0.1.2)
|
websocket-extensions (0.1.2)
|
||||||
will_paginate (3.0.7)
|
will_paginate (3.1.5)
|
||||||
will_paginate-bootstrap (1.0.1)
|
will_paginate-bootstrap (1.0.1)
|
||||||
will_paginate (>= 3.0.3)
|
will_paginate (>= 3.0.3)
|
||||||
xml-simple (1.1.5)
|
xml-simple (1.1.5)
|
||||||
|
@ -645,6 +641,7 @@ DEPENDENCIES
|
||||||
rubocop-checkstyle_formatter
|
rubocop-checkstyle_formatter
|
||||||
rubocop-rspec
|
rubocop-rspec
|
||||||
sass-rails (~> 5.0)
|
sass-rails (~> 5.0)
|
||||||
|
scenic
|
||||||
sdoc (~> 0.4.0)
|
sdoc (~> 0.4.0)
|
||||||
selenium-webdriver
|
selenium-webdriver
|
||||||
sentry-raven
|
sentry-raven
|
||||||
|
|
9
app/assets/javascripts/dossiers_list_link.js
Normal file
9
app/assets/javascripts/dossiers_list_link.js
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
$(document).on('page:load', link_init);
|
||||||
|
$(document).ready(link_init);
|
||||||
|
|
||||||
|
|
||||||
|
function link_init() {
|
||||||
|
$('#dossiers_list tr').on('click', function () {
|
||||||
|
$(location).attr('href', $(this).data('dossier_url'))
|
||||||
|
});
|
||||||
|
}
|
|
@ -27,4 +27,9 @@ h5 span {
|
||||||
#validate_button {
|
#validate_button {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#dossiers_list tr:hover{
|
||||||
|
background-color: #eeeeee;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
|
@ -179,7 +179,12 @@ class Admin::ProceduresController < AdminController
|
||||||
end
|
end
|
||||||
|
|
||||||
def path_list
|
def path_list
|
||||||
render json: ProcedurePath.where("path LIKE '%#{params[:request]}%'").pluck(:path, :administrateur_id).inject([]) {
|
render json: ProcedurePath
|
||||||
|
.joins(', procedures')
|
||||||
|
.where("procedures.id = procedure_paths.procedure_id AND procedures.archived != true")
|
||||||
|
.where("path LIKE '%#{params[:request]}%'")
|
||||||
|
.pluck(:path, :administrateur_id)
|
||||||
|
.inject([]) {
|
||||||
|acc, value| acc.push({label: value.first, mine: value.second == current_administrateur.id})
|
|acc, value| acc.push({label: value.first, mine: value.second == current_administrateur.id})
|
||||||
}.to_json
|
}.to_json
|
||||||
end
|
end
|
||||||
|
|
|
@ -34,7 +34,12 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
|
||||||
|
|
||||||
def search
|
def search
|
||||||
@search_terms = params[:q]
|
@search_terms = params[:q]
|
||||||
@dossier = Dossier.search(current_gestionnaire, @search_terms)
|
|
||||||
|
@dossier = Search.new(
|
||||||
|
gestionnaire: current_gestionnaire,
|
||||||
|
query: @search_terms,
|
||||||
|
page: params[:page]
|
||||||
|
).results
|
||||||
|
|
||||||
smartlisting_dossier @dossier, 'search'
|
smartlisting_dossier @dossier, 'search'
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,15 @@ class Users::DescriptionController < UsersController
|
||||||
return render 'show'
|
return render 'show'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
unless params[:champs].nil?
|
||||||
|
champs_service_errors = ChampsService.save_formulaire @dossier.champs, params, mandatory
|
||||||
|
|
||||||
|
unless champs_service_errors.empty?
|
||||||
|
flash.now.alert = (champs_service_errors.inject('') { |acc, error| acc+= error[:message]+'<br>' }).html_safe
|
||||||
|
return render 'show'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if @procedure.cerfa_flag?
|
if @procedure.cerfa_flag?
|
||||||
unless params[:cerfa_pdf].nil?
|
unless params[:cerfa_pdf].nil?
|
||||||
cerfa = Cerfa.new(content: params[:cerfa_pdf], dossier: @dossier, user: current_user)
|
cerfa = Cerfa.new(content: params[:cerfa_pdf], dossier: @dossier, user: current_user)
|
||||||
|
@ -48,15 +57,6 @@ class Users::DescriptionController < UsersController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
unless params[:champs].nil?
|
|
||||||
champs_service_errors = ChampsService.save_formulaire @dossier.champs, params, mandatory
|
|
||||||
|
|
||||||
unless champs_service_errors.empty?
|
|
||||||
flash.now.alert = (champs_service_errors.inject('') { |acc, error| acc+= error[:message]+'<br>' }).html_safe
|
|
||||||
return render 'show'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
unless (errors_upload = PiecesJustificativesService.upload!(@dossier, current_user, params)).empty?
|
unless (errors_upload = PiecesJustificativesService.upload!(@dossier, current_user, params)).empty?
|
||||||
flash.alert = errors_upload.html_safe
|
flash.alert = errors_upload.html_safe
|
||||||
return render 'show'
|
return render 'show'
|
||||||
|
@ -82,10 +82,24 @@ class Users::DescriptionController < UsersController
|
||||||
@dossier ||= Dossier.find(params[:dossier_id]) if invite
|
@dossier ||= Dossier.find(params[:dossier_id]) if invite
|
||||||
@dossier ||= current_user_dossier
|
@dossier ||= current_user_dossier
|
||||||
|
|
||||||
|
if @dossier.procedure.cerfa_flag?
|
||||||
|
unless params[:cerfa_pdf].nil?
|
||||||
|
cerfa = Cerfa.new(content: params[:cerfa_pdf], dossier: @dossier, user: current_user)
|
||||||
|
unless cerfa.save
|
||||||
|
flash.alert = cerfa.errors.full_messages.join('<br />').html_safe
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if !((errors_upload = PiecesJustificativesService.upload!(@dossier, current_user, params)).empty?)
|
if !((errors_upload = PiecesJustificativesService.upload!(@dossier, current_user, params)).empty?)
|
||||||
flash.alert = errors_upload.html_safe
|
if flash.alert.nil?
|
||||||
|
flash.alert = errors_upload.html_safe
|
||||||
|
else
|
||||||
|
flash.alert = (flash.alert + '<br />' + errors_upload.html_safe).html_safe
|
||||||
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
flash.notice = 'Nouveaux fichiers envoyés'
|
flash.notice = 'Nouveaux fichiers envoyés' if flash.alert.nil?
|
||||||
@dossier.next_step! 'user', 'update'
|
@dossier.next_step! 'user', 'update'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,13 @@ class Users::DossiersController < UsersController
|
||||||
procedure = ProcedurePath.where(path: params[:procedure_path]).first!.procedure
|
procedure = ProcedurePath.where(path: params[:procedure_path]).first!.procedure
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if procedure.archived?
|
||||||
|
|
||||||
|
@dossier = Dossier.new(procedure: procedure)
|
||||||
|
|
||||||
|
return render 'commencer/archived'
|
||||||
|
end
|
||||||
|
|
||||||
redirect_to new_users_dossier_path(procedure_id: procedure.id)
|
redirect_to new_users_dossier_path(procedure_id: procedure.id)
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
error_procedure
|
error_procedure
|
||||||
|
|
|
@ -58,6 +58,10 @@ class DossiersListFacades
|
||||||
(@liste == 'a_traiter' ? 'active' : '')
|
(@liste == 'a_traiter' ? 'active' : '')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def fige_class
|
||||||
|
(@liste == 'fige' ? 'active' : '')
|
||||||
|
end
|
||||||
|
|
||||||
def en_attente_class
|
def en_attente_class
|
||||||
(@liste == 'en_attente' ? 'active' : '')
|
(@liste == 'en_attente' ? 'active' : '')
|
||||||
end
|
end
|
||||||
|
@ -103,13 +107,17 @@ class DossiersListFacades
|
||||||
end
|
end
|
||||||
|
|
||||||
def a_traiter_total
|
def a_traiter_total
|
||||||
service.waiting_for_gestionnaire.count
|
service.ouvert.count
|
||||||
end
|
end
|
||||||
|
|
||||||
def en_construction_total
|
def en_construction_total
|
||||||
service.en_construction.count
|
service.en_construction.count
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def fige_total
|
||||||
|
service.fige.count
|
||||||
|
end
|
||||||
|
|
||||||
def en_attente_total
|
def en_attente_total
|
||||||
service.waiting_for_user.count
|
service.waiting_for_user.count
|
||||||
end
|
end
|
||||||
|
@ -158,6 +166,10 @@ class DossiersListFacades
|
||||||
base_url 'a_traiter'
|
base_url 'a_traiter'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def fige_url
|
||||||
|
base_url 'fige'
|
||||||
|
end
|
||||||
|
|
||||||
def en_attente_url
|
def en_attente_url
|
||||||
base_url 'en_attente'
|
base_url 'en_attente'
|
||||||
end
|
end
|
||||||
|
|
|
@ -46,6 +46,7 @@ class Dossier < ActiveRecord::Base
|
||||||
|
|
||||||
BROUILLON = %w(draft)
|
BROUILLON = %w(draft)
|
||||||
NOUVEAUX = %w(initiated)
|
NOUVEAUX = %w(initiated)
|
||||||
|
OUVERT = %w(updated replied)
|
||||||
WAITING_FOR_GESTIONNAIRE = %w(updated)
|
WAITING_FOR_GESTIONNAIRE = %w(updated)
|
||||||
WAITING_FOR_USER = %w(replied validated)
|
WAITING_FOR_USER = %w(replied validated)
|
||||||
EN_CONSTRUCTION = %w(initiated updated replied)
|
EN_CONSTRUCTION = %w(initiated updated replied)
|
||||||
|
@ -195,6 +196,10 @@ class Dossier < ActiveRecord::Base
|
||||||
EN_CONSTRUCTION.include?(state)
|
EN_CONSTRUCTION.include?(state)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def ouvert?
|
||||||
|
OUVERT.include?(state)
|
||||||
|
end
|
||||||
|
|
||||||
def deposes?
|
def deposes?
|
||||||
DEPOSES.include?(state)
|
DEPOSES.include?(state)
|
||||||
end
|
end
|
||||||
|
@ -203,6 +208,10 @@ class Dossier < ActiveRecord::Base
|
||||||
VALIDES.include?(state)
|
VALIDES.include?(state)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def fige?
|
||||||
|
VALIDES.include?(state)
|
||||||
|
end
|
||||||
|
|
||||||
def a_instruire?
|
def a_instruire?
|
||||||
A_INSTRUIRE.include?(state)
|
A_INSTRUIRE.include?(state)
|
||||||
end
|
end
|
||||||
|
@ -239,10 +248,18 @@ class Dossier < ActiveRecord::Base
|
||||||
where(state: EN_CONSTRUCTION, archived: false).order("updated_at #{order}")
|
where(state: EN_CONSTRUCTION, archived: false).order("updated_at #{order}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.ouvert order = 'ASC'
|
||||||
|
where(state: OUVERT, archived: false).order("updated_at #{order}")
|
||||||
|
end
|
||||||
|
|
||||||
def self.valides order = 'ASC'
|
def self.valides order = 'ASC'
|
||||||
where(state: VALIDES, archived: false).order("updated_at #{order}")
|
where(state: VALIDES, archived: false).order("updated_at #{order}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.fige order = 'ASC'
|
||||||
|
where(state: VALIDES, archived: false).order("updated_at #{order}")
|
||||||
|
end
|
||||||
|
|
||||||
def self.deposes order = 'ASC'
|
def self.deposes order = 'ASC'
|
||||||
where(state: DEPOSES, archived: false).order("updated_at #{order}")
|
where(state: DEPOSES, archived: false).order("updated_at #{order}")
|
||||||
end
|
end
|
||||||
|
@ -259,37 +276,6 @@ class Dossier < ActiveRecord::Base
|
||||||
where(state: TERMINE, archived: false).order("updated_at #{order}")
|
where(state: TERMINE, archived: false).order("updated_at #{order}")
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.search current_gestionnaire, terms
|
|
||||||
return [] if terms.blank?
|
|
||||||
|
|
||||||
dossiers = Dossier.arel_table
|
|
||||||
users = User.arel_table
|
|
||||||
etablissements = Etablissement.arel_table
|
|
||||||
entreprises = Entreprise.arel_table
|
|
||||||
|
|
||||||
composed_scope = self.joins('LEFT OUTER JOIN users ON users.id = dossiers.user_id')
|
|
||||||
.joins('LEFT OUTER JOIN entreprises ON entreprises.dossier_id = dossiers.id')
|
|
||||||
.joins('LEFT OUTER JOIN etablissements ON etablissements.dossier_id = dossiers.id')
|
|
||||||
|
|
||||||
terms.split.each do |word|
|
|
||||||
query_string = "%#{word}%"
|
|
||||||
query_string_start_with = "#{word}%"
|
|
||||||
|
|
||||||
composed_scope = composed_scope.where(
|
|
||||||
users[:email].matches(query_string).or\
|
|
||||||
etablissements[:siret].matches(query_string_start_with).or\
|
|
||||||
entreprises[:raison_sociale].matches(query_string).or\
|
|
||||||
dossiers[:id].eq(word_is_an_integer word))
|
|
||||||
end
|
|
||||||
|
|
||||||
composed_scope = composed_scope.where(
|
|
||||||
dossiers[:id].eq_any(current_gestionnaire.dossiers.ids).and\
|
|
||||||
dossiers[:state].does_not_match('draft').and\
|
|
||||||
dossiers[:archived].eq(false))
|
|
||||||
|
|
||||||
composed_scope
|
|
||||||
end
|
|
||||||
|
|
||||||
def cerfa_available?
|
def cerfa_available?
|
||||||
procedure.cerfa_flag? && cerfa.size != 0
|
procedure.cerfa_flag? && cerfa.size != 0
|
||||||
end
|
end
|
||||||
|
@ -354,7 +340,7 @@ class Dossier < ActiveRecord::Base
|
||||||
data = []
|
data = []
|
||||||
headers = dossiers.first.export_headers
|
headers = dossiers.first.export_headers
|
||||||
dossiers.each do |dossier|
|
dossiers.each do |dossier|
|
||||||
data << dossier.convert_specific_array_values_to_string(data_with_champs)
|
data << dossier.convert_specific_array_values_to_string(dossier.data_with_champs)
|
||||||
end
|
end
|
||||||
if ["csv"].include?(format)
|
if ["csv"].include?(format)
|
||||||
return SpreadsheetArchitect.to_csv(data: data, headers: headers)
|
return SpreadsheetArchitect.to_csv(data: data, headers: headers)
|
||||||
|
|
|
@ -103,7 +103,6 @@ class Procedure < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def archive
|
def archive
|
||||||
self.procedure_path.destroy! if self.path
|
|
||||||
self.update_attributes!({archived: true})
|
self.update_attributes!({archived: true})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
82
app/models/search.rb
Normal file
82
app/models/search.rb
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
# See:
|
||||||
|
# - https://robots.thoughtbot.com/implementing-multi-table-full-text-search-with-postgres
|
||||||
|
# - http://calebthompson.io/talks/search.html
|
||||||
|
class Search < ActiveRecord::Base
|
||||||
|
# :nodoc:
|
||||||
|
#
|
||||||
|
# Englobs a search result (actually a collection of Search objects) so it acts
|
||||||
|
# like a collection of regular Dossier objects, which can be decorated,
|
||||||
|
# paginated, ...
|
||||||
|
class Results
|
||||||
|
include Enumerable
|
||||||
|
|
||||||
|
def initialize(results)
|
||||||
|
@results = results
|
||||||
|
end
|
||||||
|
|
||||||
|
def each
|
||||||
|
@results.each do |search|
|
||||||
|
yield search.dossier
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def method_missing(name, *args, &block)
|
||||||
|
@results.__send__(name, *args, &block)
|
||||||
|
end
|
||||||
|
|
||||||
|
def decorate!
|
||||||
|
@results.each do |search|
|
||||||
|
search.dossier = search.dossier.decorate
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
attr_accessor :gestionnaire
|
||||||
|
attr_accessor :query
|
||||||
|
attr_accessor :page
|
||||||
|
|
||||||
|
belongs_to :dossier
|
||||||
|
|
||||||
|
def results
|
||||||
|
unless @query.present?
|
||||||
|
return Search.none
|
||||||
|
end
|
||||||
|
|
||||||
|
search_term = Search.connection.quote(to_tsquery)
|
||||||
|
|
||||||
|
dossier_ids = @gestionnaire.dossiers
|
||||||
|
.select(:id)
|
||||||
|
.where(archived: false)
|
||||||
|
.where.not(state: "draft")
|
||||||
|
|
||||||
|
q = Search
|
||||||
|
.select("DISTINCT(searches.dossier_id)")
|
||||||
|
.select("COALESCE(ts_rank(to_tsvector('french', searches.term::text), to_tsquery('french', #{search_term})), 0) AS rank")
|
||||||
|
.joins(:dossier)
|
||||||
|
.where(dossier_id: dossier_ids)
|
||||||
|
.where("to_tsvector('french', searches.term::text) @@ to_tsquery('french', #{search_term})")
|
||||||
|
.order("rank DESC")
|
||||||
|
.preload(:dossier)
|
||||||
|
|
||||||
|
if @page.present?
|
||||||
|
q = q.paginate(page: @page)
|
||||||
|
end
|
||||||
|
|
||||||
|
Results.new(q)
|
||||||
|
end
|
||||||
|
|
||||||
|
#def self.refresh
|
||||||
|
# # TODO: could be executed concurrently
|
||||||
|
# # See https://github.com/thoughtbot/scenic#what-about-materialized-views
|
||||||
|
# Scenic.database.refresh_materialized_view(table_name, concurrently: false)
|
||||||
|
#end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def to_tsquery
|
||||||
|
@query.gsub(/['?\\:&|!]/, "") # drop disallowed characters
|
||||||
|
.split(/\s+/) # split words
|
||||||
|
.map { |x| "#{x}:*" } # enable prefix matching
|
||||||
|
.join(" & ")
|
||||||
|
end
|
||||||
|
end
|
|
@ -7,8 +7,8 @@ class DossiersListGestionnaireService
|
||||||
|
|
||||||
def dossiers_to_display
|
def dossiers_to_display
|
||||||
{'nouveaux' => nouveaux,
|
{'nouveaux' => nouveaux,
|
||||||
'a_traiter' => waiting_for_gestionnaire,
|
'a_traiter' => ouvert,
|
||||||
'en_attente' => waiting_for_user,
|
'fige' => fige,
|
||||||
'deposes' => deposes,
|
'deposes' => deposes,
|
||||||
'a_instruire' => a_instruire,
|
'a_instruire' => a_instruire,
|
||||||
'termine' => termine,
|
'termine' => termine,
|
||||||
|
@ -16,7 +16,7 @@ class DossiersListGestionnaireService
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.dossiers_liste_libelle
|
def self.dossiers_liste_libelle
|
||||||
['nouveaux', 'a_traiter', 'en_attente', 'deposes', 'a_instruire', 'termine', 'all_state']
|
['nouveaux', 'a_traiter', 'fige' ,'deposes', 'a_instruire', 'termine', 'all_state']
|
||||||
end
|
end
|
||||||
|
|
||||||
def all_state
|
def all_state
|
||||||
|
@ -27,12 +27,12 @@ class DossiersListGestionnaireService
|
||||||
@nouveaux ||= filter_dossiers.nouveaux
|
@nouveaux ||= filter_dossiers.nouveaux
|
||||||
end
|
end
|
||||||
|
|
||||||
def waiting_for_gestionnaire
|
def ouvert
|
||||||
@waiting_for_gestionnaire ||= filter_dossiers.waiting_for_gestionnaire
|
@ouvert ||= filter_dossiers.ouvert
|
||||||
end
|
end
|
||||||
|
|
||||||
def waiting_for_user
|
def fige
|
||||||
@waiting_for_user ||= filter_dossiers.waiting_for_user
|
@fige ||= filter_dossiers.fige
|
||||||
end
|
end
|
||||||
|
|
||||||
def deposes
|
def deposes
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%table.table
|
%table#dossiers_list.table
|
||||||
%thead
|
%thead
|
||||||
- @dossiers_list_facade.preference_list_dossiers_filter.each do |preference|
|
- @dossiers_list_facade.preference_list_dossiers_filter.each do |preference|
|
||||||
%th{class: "col-md-#{preference.bootstrap_lg} col-lg-#{preference.bootstrap_lg}"}
|
%th{class: "col-md-#{preference.bootstrap_lg} col-lg-#{preference.bootstrap_lg}"}
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
- unless smart_listing.empty?
|
- unless smart_listing.empty?
|
||||||
- @dossiers.each do |dossier|
|
- @dossiers.each do |dossier|
|
||||||
%tr
|
%tr{id: "tr_dossier_#{dossier.id}", 'data-dossier_url' => backoffice_dossier_url(id: dossier.id)}
|
||||||
- @dossiers_list_facade.preference_list_dossiers_filter.each_with_index do |preference, index|
|
- @dossiers_list_facade.preference_list_dossiers_filter.each_with_index do |preference, index|
|
||||||
%td
|
%td
|
||||||
- if preference.table.nil? || preference.table.empty?
|
- if preference.table.nil? || preference.table.empty?
|
||||||
|
@ -30,10 +30,7 @@
|
||||||
- rescue NoMethodError
|
- rescue NoMethodError
|
||||||
- value = ''
|
- value = ''
|
||||||
|
|
||||||
- if index == 0
|
= value
|
||||||
= link_to value, backoffice_dossier_path(id: dossier.id)
|
|
||||||
- else
|
|
||||||
= value
|
|
||||||
|
|
||||||
%td.center
|
%td.center
|
||||||
- if current_gestionnaire.follow?(dossier.id)
|
- if current_gestionnaire.follow?(dossier.id)
|
||||||
|
@ -48,4 +45,4 @@
|
||||||
|
|
||||||
- if smart_listing.empty?
|
- if smart_listing.empty?
|
||||||
%h4.center
|
%h4.center
|
||||||
Aucun dossier
|
Aucun dossier
|
||||||
|
|
|
@ -19,18 +19,18 @@
|
||||||
=@dossiers_list_facade.nouveaux_total
|
=@dossiers_list_facade.nouveaux_total
|
||||||
|
|
||||||
%li{ class: (@dossiers_list_facade.a_traiter_class) }
|
%li{ class: (@dossiers_list_facade.a_traiter_class) }
|
||||||
%a{:href => "#{url_for @dossiers_list_facade.a_traiter_url}", 'data-toggle' => :tooltip, title: 'Les dossiers qui requièrent une action de votre part.'}
|
%a{:href => "#{url_for @dossiers_list_facade.a_traiter_url}", 'data-toggle' => :tooltip, title: 'Les dossiers qui ne sont pas encore déclarés complets.'}
|
||||||
%h5.text-danger
|
%h5.text-danger
|
||||||
= "Action requise"
|
="Ouverts"
|
||||||
.badge.progress-bar-danger
|
.badge.progress-bar-danger
|
||||||
=@dossiers_list_facade.a_traiter_total
|
=@dossiers_list_facade.a_traiter_total
|
||||||
|
|
||||||
%li{ class: (@dossiers_list_facade.en_attente_class) }
|
%li{ class: (@dossiers_list_facade.fige_class) }
|
||||||
%a{:href => "#{url_for @dossiers_list_facade.en_attente_url}", 'data-toggle' => :tooltip, title: 'Les dossiers en attentes d\'une action de la part de l\'usager.'}
|
%a{:href => "#{url_for @dossiers_list_facade.fige_url}", 'data-toggle' => :tooltip, title: 'Les dossiers qui sont déclarés complets et donc figés.'}
|
||||||
%h5.text-default
|
%h5.text-default
|
||||||
="Attente usager "
|
="Figés"
|
||||||
.badge.progress-bar-default
|
.badge.progress-bar-default
|
||||||
=@dossiers_list_facade.en_attente_total
|
=@dossiers_list_facade.fige_total
|
||||||
|
|
||||||
%li{ class: (@dossiers_list_facade.deposes_class) }
|
%li{ class: (@dossiers_list_facade.deposes_class) }
|
||||||
%a{:href => "#{url_for @dossiers_list_facade.deposes_url}", 'data-toggle' => :tooltip, title: 'Les dossiers qui ont été validés et déposés par les usager qui attendent une réponse de bonne réception avant examen.'}
|
%a{:href => "#{url_for @dossiers_list_facade.deposes_url}", 'data-toggle' => :tooltip, title: 'Les dossiers qui ont été validés et déposés par les usager qui attendent une réponse de bonne réception avant examen.'}
|
||||||
|
|
|
@ -11,12 +11,18 @@
|
||||||
n'ont jamais été ouvert par votre service.
|
n'ont jamais été ouvert par votre service.
|
||||||
Il attende une première lecture et intervention de votre part.
|
Il attende une première lecture et intervention de votre part.
|
||||||
-elsif dossiers_list_facade.liste == 'a_traiter'
|
-elsif dossiers_list_facade.liste == 'a_traiter'
|
||||||
Tous les dossiers présents dans cette liste sont ceux qui
|
Tous les dossiers présents dans cette liste sont ceux qui sont
|
||||||
%b
|
%b
|
||||||
attendent une action de votre part.
|
en cours de construction avec l'usager.
|
||||||
Cela peut être par exemple une demande client ou une relecture pour validation de complétude.
|
Ils ne sont pas figés et ne sont donc pas complets.
|
||||||
-elsif dossiers_list_facade.liste == 'en_attente'
|
-elsif dossiers_list_facade.liste == 'fige'
|
||||||
Tous les dossiers présents dans cette liste sont ceux qui requière une action de la part de l'usager. À priori, vous n'avez donc pas d'intervention particulière à réaliser.
|
Tous les dossiers présents dans cette liste ont été déclarés
|
||||||
|
%b
|
||||||
|
complets
|
||||||
|
et ne sont
|
||||||
|
%b
|
||||||
|
plus modifiables par l'usager.
|
||||||
|
Ils attendent donc leurs dépots officiels qui doit être effectué par l'usager.
|
||||||
-elsif dossiers_list_facade.liste == 'deposes'
|
-elsif dossiers_list_facade.liste == 'deposes'
|
||||||
Tous les dossiers présents dans cette liste ont été
|
Tous les dossiers présents dans cette liste ont été
|
||||||
%b
|
%b
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
<%= smart_listing_update :dossiers %>
|
<%= smart_listing_update :dossiers %>
|
||||||
|
|
||||||
filters_init();
|
filters_init();
|
||||||
|
link_init();
|
15
app/views/commencer/archived.html.haml
Normal file
15
app/views/commencer/archived.html.haml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
%br
|
||||||
|
%div{style: 'text-align: center; max-width:500px; margin-left:auto; margin-right:auto; padding: 20px;'}
|
||||||
|
= render partial: 'users/sessions/resume_procedure'
|
||||||
|
|
||||||
|
.center{style:'margin-top: -20px'}
|
||||||
|
%h3
|
||||||
|
La campagne de création de nouveau dossier
|
||||||
|
%br
|
||||||
|
pour cette démarche en ligne est maintenant terminée.
|
||||||
|
|
||||||
|
%br
|
||||||
|
%p
|
||||||
|
Si vous avez déjà déposé un ou plusieurs dossiers :
|
||||||
|
%a.btn.btn-lg.btn-info{href: new_user_session_path}
|
||||||
|
Accéder à mon espace en ligne.
|
|
@ -2,7 +2,8 @@
|
||||||
%html
|
%html
|
||||||
%head
|
%head
|
||||||
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
|
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
|
||||||
%title TPS - Téléprocédures simplifiées
|
%title
|
||||||
|
=t('dynamics.page_title')
|
||||||
%meta{'http-equiv' => "X-UA-Compatible", :content => "IE=edge"}
|
%meta{'http-equiv' => "X-UA-Compatible", :content => "IE=edge"}
|
||||||
|
|
||||||
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
|
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
<%= escape_once (MailTemplate.replace_tags @dossier.procedure.mail_received.body, @dossier).html_safe %>
|
<%= MailTemplate.replace_tags(@dossier.procedure.mail_received.body, @dossier).html_safe %>
|
|
@ -1,5 +1,5 @@
|
||||||
- unless smart_listing.empty?
|
- unless smart_listing.empty?
|
||||||
%table.table
|
%table#dossiers_list.table
|
||||||
%thead
|
%thead
|
||||||
%th.col-md-1.col-lg-1= smart_listing.sortable 'Numéro', 'id'
|
%th.col-md-1.col-lg-1= smart_listing.sortable 'Numéro', 'id'
|
||||||
%th.col-md-5.col-lg-5= smart_listing.sortable 'Procédure', 'procedure.libelle'
|
%th.col-md-5.col-lg-5= smart_listing.sortable 'Procédure', 'procedure.libelle'
|
||||||
|
@ -13,14 +13,17 @@
|
||||||
-dossier = invite.dossier.decorate
|
-dossier = invite.dossier.decorate
|
||||||
- else
|
- else
|
||||||
- dossier = dossier.decorate
|
- dossier = dossier.decorate
|
||||||
%tr
|
|
||||||
|
- dossier_url = users_dossiers_invite_path(id: invite.id) unless invite.nil?
|
||||||
|
- if invite.nil?
|
||||||
|
- dossier_url = users_dossier_recapitulatif_path(dossier) unless dossier.brouillon?
|
||||||
|
- dossier_url = users_dossier_description_path(dossier) if dossier.brouillon?
|
||||||
|
|
||||||
|
%tr{id: "tr_dossier_#{dossier.id}", 'data-dossier_url' => dossier_url}
|
||||||
%td.center
|
%td.center
|
||||||
= dossier.id
|
= dossier.id
|
||||||
%td
|
%td
|
||||||
= link_to(dossier.procedure.libelle, users_dossiers_invite_path(id: invite.id)) unless invite.nil?
|
= dossier.procedure.libelle
|
||||||
- if invite.nil?
|
|
||||||
= link_to(dossier.procedure.libelle, users_dossier_recapitulatif_path(dossier)) unless dossier.brouillon?
|
|
||||||
= link_to(dossier.procedure.libelle, users_dossier_description_path(dossier)) if dossier.brouillon?
|
|
||||||
|
|
||||||
%td{id: "dossier_#{dossier.id}_state"}= dossier.display_state
|
%td{id: "dossier_#{dossier.id}_state"}= dossier.display_state
|
||||||
%td= dossier.last_update
|
%td= dossier.last_update
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
<%= smart_listing_update :dossiers %>
|
<%= smart_listing_update :dossiers %>
|
||||||
|
link_init();
|
18
app/views/users/sessions/_resume_procedure.html.haml
Normal file
18
app/views/users/sessions/_resume_procedure.html.haml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
- if @dossier
|
||||||
|
= link_to 'X', users_no_procedure_url, class: 'btn btn-xs', style:'float: right'
|
||||||
|
|
||||||
|
- if @dossier.procedure.euro_flag
|
||||||
|
#euro_flag.flag
|
||||||
|
=image_tag('drapeau_europe.png')
|
||||||
|
|
||||||
|
#logo_procedure.flag
|
||||||
|
=image_tag( @dossier.procedure.decorate.logo_img )
|
||||||
|
|
||||||
|
%h2#titre_procedure.text-info
|
||||||
|
= @dossier.procedure.libelle
|
||||||
|
%p
|
||||||
|
= h @dossier.procedure.description.html_safe
|
||||||
|
|
||||||
|
- else
|
||||||
|
= image_tag(image_url(LOGO_NAME), {id: 'logo_tps'})
|
||||||
|
%br
|
|
@ -1,24 +1,6 @@
|
||||||
#form_login
|
#form_login
|
||||||
%br
|
%br
|
||||||
- if @dossier
|
= render partial: 'users/sessions/resume_procedure'
|
||||||
= link_to 'X', users_no_procedure_url, class: 'btn btn-xs', style:'float: right'
|
|
||||||
|
|
||||||
- if @dossier.procedure.euro_flag
|
|
||||||
#euro_flag.flag
|
|
||||||
=image_tag('drapeau_europe.png')
|
|
||||||
|
|
||||||
#logo_procedure.flag
|
|
||||||
=image_tag( @dossier.procedure.decorate.logo_img )
|
|
||||||
|
|
||||||
%h2#titre_procedure.text-info
|
|
||||||
= @dossier.procedure.libelle
|
|
||||||
%p
|
|
||||||
= h @dossier.procedure.description.html_safe
|
|
||||||
|
|
||||||
|
|
||||||
- else
|
|
||||||
= image_tag(image_url(LOGO_NAME), {id: 'logo_tps'})
|
|
||||||
%br
|
|
||||||
|
|
||||||
%h2#login_user
|
%h2#login_user
|
||||||
=t('dynamics.users.connexion_title')
|
=t('dynamics.users.connexion_title')
|
||||||
|
|
|
@ -98,7 +98,8 @@ set :shared_paths, [
|
||||||
'config/france_connect.yml',
|
'config/france_connect.yml',
|
||||||
'config/initializers/mailjet.rb',
|
'config/initializers/mailjet.rb',
|
||||||
'config/initializers/storage_url.rb',
|
'config/initializers/storage_url.rb',
|
||||||
'app/views/root/landing.html.haml'
|
'app/views/root/landing.html.haml',
|
||||||
|
'app/views/cgu/index.html.haml'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -139,6 +140,9 @@ task :setup => :environment do
|
||||||
queue! %[mkdir -p "#{deploy_to}/shared/app"]
|
queue! %[mkdir -p "#{deploy_to}/shared/app"]
|
||||||
queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/app"]
|
queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/app"]
|
||||||
|
|
||||||
|
queue! %[mkdir -p "#{deploy_to}/shared/views/cgu"]
|
||||||
|
queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/views/cgu"]
|
||||||
|
|
||||||
queue! %[mkdir -p "#{deploy_to}/shared/config/locales/dynamics"]
|
queue! %[mkdir -p "#{deploy_to}/shared/config/locales/dynamics"]
|
||||||
queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/config/locales/dynamics"]
|
queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/config/locales/dynamics"]
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
fr:
|
fr:
|
||||||
dynamics:
|
dynamics:
|
||||||
|
page_title: TPS - Téléprocédures simplifiées
|
||||||
contact_email: contact@tps.apientreprise.fr
|
contact_email: contact@tps.apientreprise.fr
|
||||||
users:
|
users:
|
||||||
connexion_title: Connexion
|
connexion_title: Connexion
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
fr_opensimplif:
|
fr_opensimplif:
|
||||||
dynamics:
|
dynamics:
|
||||||
|
page_title: OpenSimplif
|
||||||
contact_email: simplification.sgmap@modernisation.gouv.fr
|
contact_email: simplification.sgmap@modernisation.gouv.fr
|
||||||
users:
|
users:
|
||||||
connexion_title: "Connectez-vous en tant qu'utilisateur"
|
connexion_title: "Connectez-vous en tant qu'utilisateur"
|
||||||
|
|
|
@ -44,11 +44,11 @@ fr:
|
||||||
piece_justificative:
|
piece_justificative:
|
||||||
attributes:
|
attributes:
|
||||||
content:
|
content:
|
||||||
size_too_big: "La taille du fichier joint est trop importante. Elle doit être inférieure à 3Mo."
|
size_too_big: "La taille du fichier joint est trop importante. Elle doit être inférieure à 6Mo."
|
||||||
cerfa:
|
cerfa:
|
||||||
attributes:
|
attributes:
|
||||||
content:
|
content:
|
||||||
size_too_big: "La taille du fichier joint est trop importante. Elle doit être inférieure à 3Mo."
|
size_too_big: "La taille du fichier joint est trop importante. Elle doit être inférieure à 6Mo."
|
||||||
user:
|
user:
|
||||||
attributes:
|
attributes:
|
||||||
reset_password_token:
|
reset_password_token:
|
||||||
|
|
27
db/migrate/20161025150900_create_searches.rb
Normal file
27
db/migrate/20161025150900_create_searches.rb
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
class CreateSearches < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
add_index :champs, :dossier_id
|
||||||
|
add_index :champs, :type_de_champ_id
|
||||||
|
add_index :drop_down_lists, :type_de_champ_id
|
||||||
|
add_index :etablissements, :dossier_id
|
||||||
|
add_index :entreprises, :dossier_id
|
||||||
|
add_index :france_connect_informations, :user_id
|
||||||
|
add_index :individuals, :dossier_id
|
||||||
|
add_index :pieces_justificatives, :dossier_id
|
||||||
|
add_index :rna_informations, :entreprise_id
|
||||||
|
create_view :searches #, materialized: true
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
remove_index :champs, :dossier_id
|
||||||
|
remove_index :champs, :type_de_champ_id
|
||||||
|
remove_index :drop_down_lists, :type_de_champ_id
|
||||||
|
remove_index :etablissements, :dossier_id
|
||||||
|
remove_index :entreprises, :dossier_id
|
||||||
|
remove_index :france_connect_informations, :user_id
|
||||||
|
remove_index :individuals, :dossier_id
|
||||||
|
remove_index :pieces_justificatives, :dossier_id
|
||||||
|
remove_index :rna_informations, :entreprise_id
|
||||||
|
drop_view :searches #, materialized: true
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,9 @@
|
||||||
|
class UpdateSearchesToVersion2 < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
replace_view :searches, version: 2
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
replace_view :searches, version: 1
|
||||||
|
end
|
||||||
|
end
|
35
db/schema.rb
35
db/schema.rb
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20161011125345) do
|
ActiveRecord::Schema.define(version: 20161102154835) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
@ -102,6 +102,9 @@ ActiveRecord::Schema.define(version: 20161011125345) do
|
||||||
t.string "type"
|
t.string "type"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_index "champs", ["dossier_id"], name: "index_champs_on_dossier_id", using: :btree
|
||||||
|
add_index "champs", ["type_de_champ_id"], name: "index_champs_on_type_de_champ_id", using: :btree
|
||||||
|
|
||||||
create_table "commentaires", force: :cascade do |t|
|
create_table "commentaires", force: :cascade do |t|
|
||||||
t.string "email"
|
t.string "email"
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
|
@ -135,6 +138,8 @@ ActiveRecord::Schema.define(version: 20161011125345) do
|
||||||
t.integer "type_de_champ_id"
|
t.integer "type_de_champ_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_index "drop_down_lists", ["type_de_champ_id"], name: "index_drop_down_lists_on_type_de_champ_id", using: :btree
|
||||||
|
|
||||||
create_table "entreprises", force: :cascade do |t|
|
create_table "entreprises", force: :cascade do |t|
|
||||||
t.string "siren"
|
t.string "siren"
|
||||||
t.integer "capital_social"
|
t.integer "capital_social"
|
||||||
|
@ -151,6 +156,8 @@ ActiveRecord::Schema.define(version: 20161011125345) do
|
||||||
t.integer "dossier_id"
|
t.integer "dossier_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_index "entreprises", ["dossier_id"], name: "index_entreprises_on_dossier_id", using: :btree
|
||||||
|
|
||||||
create_table "etablissements", force: :cascade do |t|
|
create_table "etablissements", force: :cascade do |t|
|
||||||
t.string "siret"
|
t.string "siret"
|
||||||
t.boolean "siege_social"
|
t.boolean "siege_social"
|
||||||
|
@ -168,6 +175,8 @@ ActiveRecord::Schema.define(version: 20161011125345) do
|
||||||
t.integer "entreprise_id"
|
t.integer "entreprise_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_index "etablissements", ["dossier_id"], name: "index_etablissements_on_dossier_id", using: :btree
|
||||||
|
|
||||||
create_table "exercices", force: :cascade do |t|
|
create_table "exercices", force: :cascade do |t|
|
||||||
t.string "ca"
|
t.string "ca"
|
||||||
t.datetime "dateFinExercice"
|
t.datetime "dateFinExercice"
|
||||||
|
@ -194,6 +203,8 @@ ActiveRecord::Schema.define(version: 20161011125345) do
|
||||||
t.string "email_france_connect"
|
t.string "email_france_connect"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_index "france_connect_informations", ["user_id"], name: "index_france_connect_informations_on_user_id", using: :btree
|
||||||
|
|
||||||
create_table "gestionnaires", force: :cascade do |t|
|
create_table "gestionnaires", force: :cascade do |t|
|
||||||
t.string "email", default: "", null: false
|
t.string "email", default: "", null: false
|
||||||
t.string "encrypted_password", default: "", null: false
|
t.string "encrypted_password", default: "", null: false
|
||||||
|
@ -221,6 +232,8 @@ ActiveRecord::Schema.define(version: 20161011125345) do
|
||||||
t.string "gender"
|
t.string "gender"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_index "individuals", ["dossier_id"], name: "index_individuals_on_dossier_id", using: :btree
|
||||||
|
|
||||||
create_table "invites", force: :cascade do |t|
|
create_table "invites", force: :cascade do |t|
|
||||||
t.string "email"
|
t.string "email"
|
||||||
t.string "email_sender"
|
t.string "email_sender"
|
||||||
|
@ -255,6 +268,7 @@ ActiveRecord::Schema.define(version: 20161011125345) do
|
||||||
t.string "content_secure_token"
|
t.string "content_secure_token"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_index "pieces_justificatives", ["dossier_id"], name: "index_pieces_justificatives_on_dossier_id", using: :btree
|
||||||
add_index "pieces_justificatives", ["type_de_piece_justificative_id"], name: "index_pieces_justificatives_on_type_de_piece_justificative_id", using: :btree
|
add_index "pieces_justificatives", ["type_de_piece_justificative_id"], name: "index_pieces_justificatives_on_type_de_piece_justificative_id", using: :btree
|
||||||
|
|
||||||
create_table "preference_list_dossiers", force: :cascade do |t|
|
create_table "preference_list_dossiers", force: :cascade do |t|
|
||||||
|
@ -324,6 +338,8 @@ ActiveRecord::Schema.define(version: 20161011125345) do
|
||||||
t.integer "entreprise_id"
|
t.integer "entreprise_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_index "rna_informations", ["entreprise_id"], name: "index_rna_informations_on_entreprise_id", using: :btree
|
||||||
|
|
||||||
create_table "types_de_champ", force: :cascade do |t|
|
create_table "types_de_champ", force: :cascade do |t|
|
||||||
t.string "libelle"
|
t.string "libelle"
|
||||||
t.string "type_champ"
|
t.string "type_champ"
|
||||||
|
@ -369,4 +385,21 @@ ActiveRecord::Schema.define(version: 20161011125345) do
|
||||||
add_foreign_key "dossiers", "users"
|
add_foreign_key "dossiers", "users"
|
||||||
add_foreign_key "procedure_paths", "administrateurs"
|
add_foreign_key "procedure_paths", "administrateurs"
|
||||||
add_foreign_key "procedure_paths", "procedures"
|
add_foreign_key "procedure_paths", "procedures"
|
||||||
|
|
||||||
|
create_view :searches, sql_definition: <<-SQL
|
||||||
|
SELECT dossiers.id AS dossier_id,
|
||||||
|
(((((((((((((((((((((((((((((((((((((((((((((((((((((((COALESCE(users.email, ''::character varying))::text || ' '::text) || (COALESCE(france_connect_informations.given_name, ''::character varying))::text) || ' '::text) || (COALESCE(france_connect_informations.family_name, ''::character varying))::text) || ' '::text) || (COALESCE(cerfas.content, ''::character varying))::text) || ' '::text) || (COALESCE(champs.value, ''::character varying))::text) || ' '::text) || (COALESCE(drop_down_lists.value, ''::character varying))::text) || ' '::text) || (COALESCE(entreprises.siren, ''::character varying))::text) || ' '::text) || (COALESCE(entreprises.numero_tva_intracommunautaire, ''::character varying))::text) || ' '::text) || (COALESCE(entreprises.forme_juridique, ''::character varying))::text) || ' '::text) || (COALESCE(entreprises.forme_juridique_code, ''::character varying))::text) || ' '::text) || (COALESCE(entreprises.nom_commercial, ''::character varying))::text) || ' '::text) || (COALESCE(entreprises.raison_sociale, ''::character varying))::text) || ' '::text) || (COALESCE(entreprises.siret_siege_social, ''::character varying))::text) || ' '::text) || (COALESCE(entreprises.nom, ''::character varying))::text) || ' '::text) || (COALESCE(entreprises.prenom, ''::character varying))::text) || ' '::text) || (COALESCE(rna_informations.association_id, ''::character varying))::text) || ' '::text) || (COALESCE(rna_informations.titre, ''::character varying))::text) || ' '::text) || COALESCE(rna_informations.objet, ''::text)) || ' '::text) || (COALESCE(etablissements.siret, ''::character varying))::text) || ' '::text) || (COALESCE(etablissements.naf, ''::character varying))::text) || ' '::text) || (COALESCE(etablissements.libelle_naf, ''::character varying))::text) || ' '::text) || (COALESCE(etablissements.adresse, ''::character varying))::text) || ' '::text) || (COALESCE(etablissements.code_postal, ''::character varying))::text) || ' '::text) || (COALESCE(etablissements.localite, ''::character varying))::text) || ' '::text) || (COALESCE(etablissements.code_insee_localite, ''::character varying))::text) || ' '::text) || (COALESCE(individuals.nom, ''::character varying))::text) || ' '::text) || (COALESCE(individuals.prenom, ''::character varying))::text) || ' '::text) || (COALESCE(pieces_justificatives.content, ''::character varying))::text) AS term
|
||||||
|
FROM ((((((((((dossiers
|
||||||
|
JOIN users ON ((users.id = dossiers.user_id)))
|
||||||
|
LEFT JOIN france_connect_informations ON ((france_connect_informations.user_id = dossiers.user_id)))
|
||||||
|
LEFT JOIN cerfas ON ((cerfas.dossier_id = dossiers.id)))
|
||||||
|
LEFT JOIN champs ON ((champs.dossier_id = dossiers.id)))
|
||||||
|
LEFT JOIN drop_down_lists ON ((drop_down_lists.type_de_champ_id = champs.type_de_champ_id)))
|
||||||
|
LEFT JOIN entreprises ON ((entreprises.dossier_id = dossiers.id)))
|
||||||
|
LEFT JOIN rna_informations ON ((rna_informations.entreprise_id = entreprises.id)))
|
||||||
|
LEFT JOIN etablissements ON ((etablissements.dossier_id = dossiers.id)))
|
||||||
|
LEFT JOIN individuals ON ((individuals.dossier_id = dossiers.id)))
|
||||||
|
LEFT JOIN pieces_justificatives ON ((pieces_justificatives.dossier_id = dossiers.id)));
|
||||||
|
SQL
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
59
db/views/searches_v01.sql
Normal file
59
db/views/searches_v01.sql
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
-- this version allows to search for a single term within many tables,
|
||||||
|
-- but behaves badly with multiple terms scattered in multiple tables.
|
||||||
|
|
||||||
|
SELECT dossiers.id AS dossier_id,
|
||||||
|
dossiers.id::text || ' ' ||
|
||||||
|
COALESCE(users.email, '') AS term
|
||||||
|
FROM dossiers
|
||||||
|
INNER JOIN users ON users.id = dossiers.user_id
|
||||||
|
|
||||||
|
UNION SELECT cerfas.dossier_id,
|
||||||
|
COALESCE(cerfas.content, '') AS term
|
||||||
|
FROM cerfas
|
||||||
|
|
||||||
|
UNION SELECT champs.dossier_id,
|
||||||
|
COALESCE(champs.value, '') || ' ' ||
|
||||||
|
COALESCE(drop_down_lists.value, '') AS term
|
||||||
|
FROM champs
|
||||||
|
INNER JOIN drop_down_lists ON drop_down_lists.type_de_champ_id = champs.type_de_champ_id
|
||||||
|
|
||||||
|
UNION SELECT entreprises.dossier_id,
|
||||||
|
COALESCE(entreprises.siren, '') || ' ' ||
|
||||||
|
COALESCE(entreprises.numero_tva_intracommunautaire, '') || ' ' ||
|
||||||
|
COALESCE(entreprises.forme_juridique, '') || ' ' ||
|
||||||
|
COALESCE(entreprises.forme_juridique_code, '') || ' ' ||
|
||||||
|
COALESCE(entreprises.nom_commercial, '') || ' ' ||
|
||||||
|
COALESCE(entreprises.raison_sociale, '') || ' ' ||
|
||||||
|
COALESCE(entreprises.siret_siege_social, '') || ' ' ||
|
||||||
|
COALESCE(entreprises.nom, '') || ' ' ||
|
||||||
|
COALESCE(entreprises.prenom, '') || ' ' ||
|
||||||
|
COALESCE(rna_informations.association_id, '') || ' ' ||
|
||||||
|
COALESCE(rna_informations.titre, '') || ' ' ||
|
||||||
|
COALESCE(rna_informations.objet, '') AS term
|
||||||
|
FROM entreprises
|
||||||
|
LEFT JOIN rna_informations ON rna_informations.entreprise_id = entreprises.id
|
||||||
|
|
||||||
|
UNION SELECT etablissements.dossier_id,
|
||||||
|
COALESCE(etablissements.siret, '') || ' ' ||
|
||||||
|
COALESCE(etablissements.naf, '') || ' ' ||
|
||||||
|
COALESCE(etablissements.libelle_naf, '') || ' ' ||
|
||||||
|
COALESCE(etablissements.adresse, '') || ' ' ||
|
||||||
|
COALESCE(etablissements.code_postal, '') || ' ' ||
|
||||||
|
COALESCE(etablissements.localite, '') || ' ' ||
|
||||||
|
COALESCE(etablissements.code_insee_localite, '') AS term
|
||||||
|
FROM etablissements
|
||||||
|
|
||||||
|
UNION SELECT individuals.dossier_id,
|
||||||
|
COALESCE(individuals.nom, '') || ' ' ||
|
||||||
|
COALESCE(individuals.prenom, '') AS term
|
||||||
|
FROM individuals
|
||||||
|
|
||||||
|
UNION SELECT pieces_justificatives.dossier_id,
|
||||||
|
COALESCE(pieces_justificatives.content, '') AS term
|
||||||
|
FROM pieces_justificatives
|
||||||
|
|
||||||
|
UNION SELECT dossiers.id,
|
||||||
|
COALESCE(france_connect_informations.given_name, '') || ' ' ||
|
||||||
|
COALESCE(france_connect_informations.family_name, '') AS term
|
||||||
|
FROM france_connect_informations
|
||||||
|
INNER JOIN dossiers ON dossiers.user_id = france_connect_informations.user_id
|
43
db/views/searches_v02.sql
Normal file
43
db/views/searches_v02.sql
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
-- this version merges all possible search terms together, complicating the
|
||||||
|
-- view, but enables searching for multiple terms from multiple tables at once.
|
||||||
|
|
||||||
|
SELECT dossiers.id AS dossier_id,
|
||||||
|
COALESCE(users.email, '') || ' ' ||
|
||||||
|
COALESCE(france_connect_informations.given_name, '') || ' ' ||
|
||||||
|
COALESCE(france_connect_informations.family_name, '') || ' ' ||
|
||||||
|
COALESCE(cerfas.content, '') || ' ' ||
|
||||||
|
COALESCE(champs.value, '') || ' ' ||
|
||||||
|
COALESCE(drop_down_lists.value, '') || ' ' ||
|
||||||
|
COALESCE(entreprises.siren, '') || ' ' ||
|
||||||
|
COALESCE(entreprises.numero_tva_intracommunautaire, '') || ' ' ||
|
||||||
|
COALESCE(entreprises.forme_juridique, '') || ' ' ||
|
||||||
|
COALESCE(entreprises.forme_juridique_code, '') || ' ' ||
|
||||||
|
COALESCE(entreprises.nom_commercial, '') || ' ' ||
|
||||||
|
COALESCE(entreprises.raison_sociale, '') || ' ' ||
|
||||||
|
COALESCE(entreprises.siret_siege_social, '') || ' ' ||
|
||||||
|
COALESCE(entreprises.nom, '') || ' ' ||
|
||||||
|
COALESCE(entreprises.prenom, '') || ' ' ||
|
||||||
|
COALESCE(rna_informations.association_id, '') || ' ' ||
|
||||||
|
COALESCE(rna_informations.titre, '') || ' ' ||
|
||||||
|
COALESCE(rna_informations.objet, '') || ' ' ||
|
||||||
|
COALESCE(etablissements.siret, '') || ' ' ||
|
||||||
|
COALESCE(etablissements.naf, '') || ' ' ||
|
||||||
|
COALESCE(etablissements.libelle_naf, '') || ' ' ||
|
||||||
|
COALESCE(etablissements.adresse, '') || ' ' ||
|
||||||
|
COALESCE(etablissements.code_postal, '') || ' ' ||
|
||||||
|
COALESCE(etablissements.localite, '') || ' ' ||
|
||||||
|
COALESCE(etablissements.code_insee_localite, '') || ' ' ||
|
||||||
|
COALESCE(individuals.nom, '') || ' ' ||
|
||||||
|
COALESCE(individuals.prenom, '') || ' ' ||
|
||||||
|
COALESCE(pieces_justificatives.content, '') AS term
|
||||||
|
FROM dossiers
|
||||||
|
INNER JOIN users ON users.id = dossiers.user_id
|
||||||
|
LEFT JOIN france_connect_informations ON france_connect_informations.user_id = dossiers.user_id
|
||||||
|
LEFT JOIN cerfas ON cerfas.dossier_id = dossiers.id
|
||||||
|
LEFT JOIN champs ON champs.dossier_id = dossiers.id
|
||||||
|
LEFT JOIN drop_down_lists ON drop_down_lists.type_de_champ_id = champs.type_de_champ_id
|
||||||
|
LEFT JOIN entreprises ON entreprises.dossier_id = dossiers.id
|
||||||
|
LEFT JOIN rna_informations ON rna_informations.entreprise_id = entreprises.id
|
||||||
|
LEFT JOIN etablissements ON etablissements.dossier_id = dossiers.id
|
||||||
|
LEFT JOIN individuals ON individuals.dossier_id = dossiers.id
|
||||||
|
LEFT JOIN pieces_justificatives ON pieces_justificatives.dossier_id = dossiers.id
|
118
lib/tasks/opensimplif_import.rake
Normal file
118
lib/tasks/opensimplif_import.rake
Normal file
|
@ -0,0 +1,118 @@
|
||||||
|
require 'csv'
|
||||||
|
require 'json'
|
||||||
|
|
||||||
|
namespace :opensimplif_import do
|
||||||
|
task :import_all => :environment do
|
||||||
|
puts 'start opensimplif'
|
||||||
|
|
||||||
|
Rake::Task['opensimplif_import:import_proposition'].invoke
|
||||||
|
Rake::Task['opensimplif_import:import_piste'].invoke
|
||||||
|
Rake::Task['opensimplif_import:import_mesure'].invoke
|
||||||
|
|
||||||
|
puts 'end import opensimplif'
|
||||||
|
end
|
||||||
|
|
||||||
|
task :import_proposition do
|
||||||
|
file_path = "lib/tasks/161102_OS_Inputs_test_propositions.csv"
|
||||||
|
procedure_id = 35
|
||||||
|
|
||||||
|
matching = [
|
||||||
|
{id: 44, key: 'Intitulé de la proposition'},
|
||||||
|
{id: 43, key: 'Champ concerné'},
|
||||||
|
{id: 45, key: 'Champ ministériel chef de file'},
|
||||||
|
{id: 59, key: 'Date de la proposition'},
|
||||||
|
{id: 60, key: 'Moment de vie'},
|
||||||
|
{id: 61, key: 'Source'},
|
||||||
|
{id: 48, key: 'Description de la proposition'}
|
||||||
|
]
|
||||||
|
|
||||||
|
puts 'start propositions'
|
||||||
|
import file_path, procedure_id, matching
|
||||||
|
puts 'done propositions'
|
||||||
|
end
|
||||||
|
|
||||||
|
task :import_piste do
|
||||||
|
file_path = "lib/tasks/161102_OS_Inputs_test_pistes.csv"
|
||||||
|
procedure_id = 36
|
||||||
|
|
||||||
|
matching = [
|
||||||
|
{id: 81, key: 'Intitulé de la piste *'},
|
||||||
|
{id: 82, key: 'Usager concerné *'},
|
||||||
|
{id: 83, key: 'Champ ministériel chef de file *'},
|
||||||
|
{id: 84, key: 'Champ ministériel contributeur'},
|
||||||
|
{id: 85, key: 'Date de saisine'},
|
||||||
|
{id: 66, key: 'Moment de vie'},
|
||||||
|
{id: 80, key: 'Source de la piste'},
|
||||||
|
{id: 70, key: 'Description de la piste '},
|
||||||
|
{id: 68, key: 'Objectifs / bénéfices attendus'},
|
||||||
|
{id: 65, key: 'Description détaillée des démarches impactées par la piste'},
|
||||||
|
{id: 69, key: 'Levier de mise en oeuvre'},
|
||||||
|
{id: 67, key: 'Précision sur le levier de meo'},
|
||||||
|
{id: 64, key: 'Calendrier de mise en oeuvre'}
|
||||||
|
]
|
||||||
|
|
||||||
|
puts 'start piste'
|
||||||
|
import file_path, procedure_id, matching
|
||||||
|
puts 'done pistes'
|
||||||
|
end
|
||||||
|
|
||||||
|
task :import_mesure do
|
||||||
|
file_path = "lib/tasks/161102_OS_Inputs_test_mesures.csv"
|
||||||
|
procedure_id = 37
|
||||||
|
|
||||||
|
matching = [
|
||||||
|
{id: 107, key: 'Intitulé projet / mesure'},
|
||||||
|
{id: 104, key: 'Champ concerné'},
|
||||||
|
{id: 105, key: 'Champ ministériel chef de file'},
|
||||||
|
{id: 112, key: 'Direction chef de file'},
|
||||||
|
{id: 106, key: 'Champ ministériel contributeur'},
|
||||||
|
{id: 113, key: 'Direction contributrice'},
|
||||||
|
{id: 92, key: 'Moment de vie'},
|
||||||
|
{id: 109, key: 'Date d\'annonce'},
|
||||||
|
{id: 114, key: 'N° de la mesure'},
|
||||||
|
{id: 115, key: 'Responsable ministère'},
|
||||||
|
{id: 116, key: 'Responsable SGMAP'},
|
||||||
|
{id: 89, key: 'Actions réalisées'},
|
||||||
|
{id: 95, key: 'Etapes nécessaires à l\'atteinte de la cible et alertes'},
|
||||||
|
{id: 102, key: 'Alertes'},
|
||||||
|
{id: 101, key: 'Échéance initiale'},
|
||||||
|
{id: 96, key: 'Échéance prévisionnelle / réelle'},
|
||||||
|
{id: 94, key: 'Appréciation avancement'},
|
||||||
|
{id: 91, key: 'Etat d\'avancement LOLF'},
|
||||||
|
{id: 111, key: '§ de com'}
|
||||||
|
]
|
||||||
|
|
||||||
|
puts 'start mesures'
|
||||||
|
import file_path, procedure_id, matching
|
||||||
|
puts 'done mesures'
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.import file_path, procedure_id, matching
|
||||||
|
user = User.find_or_create_by(email: 'import@opensimplif.modernisation.fr')
|
||||||
|
|
||||||
|
unless user.valid?
|
||||||
|
user.password = 'TPSpassword2016'
|
||||||
|
user.save
|
||||||
|
end
|
||||||
|
|
||||||
|
file ||= CSV.open(file_path, :col_sep => ";", :headers => true).map { |x| x.to_h }.to_json
|
||||||
|
file = JSON.parse(file)
|
||||||
|
|
||||||
|
procedure = Procedure.find(procedure_id)
|
||||||
|
|
||||||
|
user.dossiers.where(procedure_id: procedure.id).destroy_all
|
||||||
|
|
||||||
|
file.each do |proposition|
|
||||||
|
dossier = Dossier.create procedure: procedure, user: user, state: :initiated
|
||||||
|
|
||||||
|
dossier.champs.each do |champ|
|
||||||
|
matching.each do |match|
|
||||||
|
if match[:id] == champ.type_de_champ.id
|
||||||
|
champ.update_column :value, proposition[match[:key]]
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -299,7 +299,7 @@ describe Admin::ProceduresController, type: :controller do
|
||||||
it 'archive previous procedure' do
|
it 'archive previous procedure' do
|
||||||
expect(procedure2.published).to be_truthy
|
expect(procedure2.published).to be_truthy
|
||||||
expect(procedure2.archived).to be_truthy
|
expect(procedure2.archived).to be_truthy
|
||||||
expect(procedure2.path).to be_nil
|
expect(procedure2.path).not_to be_nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -427,21 +427,31 @@ describe Admin::ProceduresController, type: :controller do
|
||||||
let!(:procedure) { create(:procedure, :published, administrateur: admin) }
|
let!(:procedure) { create(:procedure, :published, administrateur: admin) }
|
||||||
let(:admin2) { create(:administrateur) }
|
let(:admin2) { create(:administrateur) }
|
||||||
let!(:procedure2) { create(:procedure, :published, administrateur: admin2) }
|
let!(:procedure2) { create(:procedure, :published, administrateur: admin2) }
|
||||||
|
let!(:procedure3) { create(:procedure, :published, administrateur: admin2) }
|
||||||
|
|
||||||
subject { get :path_list }
|
subject { get :path_list }
|
||||||
|
|
||||||
let(:body) { JSON.parse(response.body) }
|
let(:body) { JSON.parse(response.body) }
|
||||||
|
|
||||||
before do
|
describe 'when no params' do
|
||||||
subject
|
before do
|
||||||
|
subject
|
||||||
|
end
|
||||||
|
|
||||||
|
it { expect(response.status).to eq(200) }
|
||||||
|
it { expect(body.size).to eq(3) }
|
||||||
|
it { expect(body.first['label']).to eq(procedure.path) }
|
||||||
|
it { expect(body.first['mine']).to be_truthy }
|
||||||
|
it { expect(body.second['label']).to eq(procedure2.path) }
|
||||||
|
it { expect(body.second['mine']).to be_falsy }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it { expect(response.status).to eq(200) }
|
|
||||||
it { expect(body.size).to eq(2) }
|
|
||||||
it { expect(body.first['label']).to eq(procedure.path) }
|
|
||||||
it { expect(body.first['mine']).to be_truthy }
|
|
||||||
it { expect(body.second['label']).to eq(procedure2.path) }
|
|
||||||
it { expect(body.second['mine']).to be_falsy }
|
|
||||||
|
|
||||||
context 'filtered' do
|
context 'filtered' do
|
||||||
|
before do
|
||||||
|
subject
|
||||||
|
end
|
||||||
|
|
||||||
subject { get :path_list, request: procedure2.path }
|
subject { get :path_list, request: procedure2.path }
|
||||||
|
|
||||||
it { expect(response.status).to eq(200) }
|
it { expect(response.status).to eq(200) }
|
||||||
|
@ -449,6 +459,18 @@ describe Admin::ProceduresController, type: :controller do
|
||||||
it { expect(body.first['label']).to eq(procedure2.path) }
|
it { expect(body.first['label']).to eq(procedure2.path) }
|
||||||
it { expect(body.first['mine']).to be_falsy }
|
it { expect(body.first['mine']).to be_falsy }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when procedure is archived' do
|
||||||
|
|
||||||
|
before do
|
||||||
|
procedure3.update_attribute :archived, true
|
||||||
|
subject
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'do not return on the json' do
|
||||||
|
expect(body.size).to eq(2)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'POST transfer' do
|
describe 'POST transfer' do
|
||||||
|
@ -467,7 +489,7 @@ describe Admin::ProceduresController, type: :controller do
|
||||||
let(:email_admin) { new_admin.email }
|
let(:email_admin) { new_admin.email }
|
||||||
|
|
||||||
it { expect(subject.status).to eq 200 }
|
it { expect(subject.status).to eq 200 }
|
||||||
it { expect {subject}.to change(Procedure, :count).by(1) }
|
it { expect { subject }.to change(Procedure, :count).by(1) }
|
||||||
|
|
||||||
context {
|
context {
|
||||||
before do
|
before do
|
||||||
|
|
|
@ -63,14 +63,14 @@ describe Backoffice::DossiersController, type: :controller do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'GET #en_attente' do
|
describe 'GET #fige' do
|
||||||
context 'when gestionnaire is connected' do
|
context 'when gestionnaire is connected' do
|
||||||
before do
|
before do
|
||||||
sign_in gestionnaire
|
sign_in gestionnaire
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns http success' do
|
it 'returns http success' do
|
||||||
get :index, liste: :en_attente
|
get :index, liste: :fige
|
||||||
expect(response).to have_http_status(200)
|
expect(response).to have_http_status(200)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -157,6 +157,16 @@ describe Users::DossiersController, type: :controller do
|
||||||
|
|
||||||
it { expect(subject.status).to eq 302 }
|
it { expect(subject.status).to eq 302 }
|
||||||
it { expect(subject).to redirect_to new_users_dossier_path(procedure_id: procedure.id) }
|
it { expect(subject).to redirect_to new_users_dossier_path(procedure_id: procedure.id) }
|
||||||
|
|
||||||
|
context 'when procedure is archived' do
|
||||||
|
let(:procedure) { create(:procedure, :published, archived: true) }
|
||||||
|
|
||||||
|
before do
|
||||||
|
procedure.update_column :archived, true
|
||||||
|
end
|
||||||
|
|
||||||
|
it { expect(subject.status).to eq 200 }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'POST #siret_informations' do
|
describe 'POST #siret_informations' do
|
||||||
|
|
|
@ -20,9 +20,9 @@ feature 'on backoffice page' do
|
||||||
|
|
||||||
page.click_on 'Se connecter'
|
page.click_on 'Se connecter'
|
||||||
end
|
end
|
||||||
context 'when he click on first dossier' do
|
context 'when he click on first dossier', js: true do
|
||||||
before do
|
before do
|
||||||
page.click_on dossier.id
|
page.find("#tr_dossier_#{dossier.id}").click
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'it redirect to dossier page' do
|
scenario 'it redirect to dossier page' do
|
||||||
|
@ -30,7 +30,7 @@ feature 'on backoffice page' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when gestionnaire have enterprise and individual dossier in his inbox' do
|
context 'when gestionnaire have enterprise and individual dossier in his inbox', js: true do
|
||||||
let!(:procedure_individual) { create :procedure, libelle: 'procedure individual', administrateur: administrateur, for_individual: true }
|
let!(:procedure_individual) { create :procedure, libelle: 'procedure individual', administrateur: administrateur, for_individual: true }
|
||||||
let!(:dossier_individual) { create :dossier, procedure: procedure_individual, state: 'updated' }
|
let!(:dossier_individual) { create :dossier, procedure: procedure_individual, state: 'updated' }
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ feature 'on backoffice page' do
|
||||||
create :assign_to, gestionnaire: gestionnaire, procedure: procedure_individual
|
create :assign_to, gestionnaire: gestionnaire, procedure: procedure_individual
|
||||||
|
|
||||||
visit backoffice_path
|
visit backoffice_path
|
||||||
page.click_on dossier_individual.id
|
page.find("#tr_dossier_#{dossier_individual.id}").click
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'it redirect to dossier page' do
|
scenario 'it redirect to dossier page' do
|
||||||
|
|
|
@ -37,7 +37,7 @@ feature 'on click on tabs button' do
|
||||||
context 'when he click on tabs a traite' do
|
context 'when he click on tabs a traite' do
|
||||||
before do
|
before do
|
||||||
visit backoffice_dossiers_url(liste: :a_traiter)
|
visit backoffice_dossiers_url(liste: :a_traiter)
|
||||||
page.click_on 'Action requise 1'
|
page.click_on 'Ouverts 2'
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'it redirect to backoffice dossier termine' do
|
scenario 'it redirect to backoffice dossier termine' do
|
||||||
|
@ -47,8 +47,8 @@ feature 'on click on tabs button' do
|
||||||
|
|
||||||
context 'when he click on tabs en attente' do
|
context 'when he click on tabs en attente' do
|
||||||
before do
|
before do
|
||||||
visit backoffice_dossiers_url(liste: :en_attente)
|
visit backoffice_dossiers_url(liste: :figes)
|
||||||
page.click_on 'Attente usager 2'
|
page.click_on 'Figés 1'
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'it redirect to backoffice dossier en attente' do
|
scenario 'it redirect to backoffice dossier en attente' do
|
||||||
|
|
|
@ -32,9 +32,9 @@ feature 'user access to the list of his dossier' do
|
||||||
expect(page).to have_css("#dossier_#{dossier1.id}_state")
|
expect(page).to have_css("#dossier_#{dossier1.id}_state")
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when user clicks on a projet in list' do
|
context 'when user clicks on a projet in list', js: true do
|
||||||
before do
|
before do
|
||||||
page.click_on dossier1.procedure.libelle
|
page.find("#tr_dossier_#{dossier1.id}").click
|
||||||
end
|
end
|
||||||
scenario 'user is redirected to dossier page' do
|
scenario 'user is redirected to dossier page' do
|
||||||
expect(page).to have_css('#recap_dossier')
|
expect(page).to have_css('#recap_dossier')
|
||||||
|
|
|
@ -556,87 +556,6 @@ describe Dossier do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '.search' do
|
|
||||||
subject { liste_dossiers }
|
|
||||||
|
|
||||||
let(:liste_dossiers) { described_class.search(gestionnaire_1, terms) }
|
|
||||||
# let(:dossier) { described_class.search(gestionnaire_1, terms)[1] }
|
|
||||||
|
|
||||||
let(:administrateur_1) { create(:administrateur) }
|
|
||||||
let(:administrateur_2) { create(:administrateur) }
|
|
||||||
|
|
||||||
let(:gestionnaire_1) { create(:gestionnaire, administrateurs: [administrateur_1]) }
|
|
||||||
let(:gestionnaire_2) { create(:gestionnaire, administrateurs: [administrateur_2]) }
|
|
||||||
|
|
||||||
before do
|
|
||||||
create :assign_to, gestionnaire: gestionnaire_1, procedure: procedure_1
|
|
||||||
create :assign_to, gestionnaire: gestionnaire_2, procedure: procedure_2
|
|
||||||
end
|
|
||||||
|
|
||||||
let(:procedure_1) { create(:procedure, administrateur: administrateur_1) }
|
|
||||||
let(:procedure_2) { create(:procedure, administrateur: administrateur_2) }
|
|
||||||
|
|
||||||
let!(:dossier_0) { create(:dossier, state: 'draft', procedure: procedure_1, user: create(:user, email: 'brouillon@clap.fr')) }
|
|
||||||
let!(:dossier_1) { create(:dossier, state: 'initiated', procedure: procedure_1, user: create(:user, email: 'contact@test.com')) }
|
|
||||||
let!(:dossier_2) { create(:dossier, state: 'initiated', procedure: procedure_1, user: create(:user, email: 'plop@gmail.com')) }
|
|
||||||
let!(:dossier_3) { create(:dossier, state: 'initiated', procedure: procedure_2, user: create(:user, email: 'peace@clap.fr')) }
|
|
||||||
let!(:dossier_archived) { create(:dossier, state: 'initiated', procedure: procedure_1, archived: true, user: create(:user, email: 'brouillonArchived@clap.fr')) }
|
|
||||||
|
|
||||||
let!(:etablissement_1) { create(:etablissement, entreprise: create(:entreprise, raison_sociale: 'OCTO Academy', dossier: dossier_1), dossier: dossier_1, siret: '41636169600051') }
|
|
||||||
let!(:etablissement_2) { create(:etablissement, entreprise: create(:entreprise, raison_sociale: 'Plop octo', dossier: dossier_2), dossier: dossier_2, siret: '41816602300012') }
|
|
||||||
let!(:etablissement_3) { create(:etablissement, entreprise: create(:entreprise, raison_sociale: 'OCTO Technology', dossier: dossier_3), dossier: dossier_3, siret: '41816609600051') }
|
|
||||||
|
|
||||||
describe 'search is empty' do
|
|
||||||
let(:terms) { '' }
|
|
||||||
|
|
||||||
it { expect(subject.size).to eq(0) }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'search draft file' do
|
|
||||||
let(:terms) { 'brouillon' }
|
|
||||||
|
|
||||||
it { expect(subject.size).to eq(0) }
|
|
||||||
it { expect(subject.class).to eq Dossier::ActiveRecord_Relation }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'search on contact email' do
|
|
||||||
let(:terms) { 'clap' }
|
|
||||||
|
|
||||||
it { expect(subject.size).to eq(0) }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'search on ID dossier' do
|
|
||||||
let(:terms) { "#{dossier_2.id}" }
|
|
||||||
|
|
||||||
it { expect(subject.size).to eq(1) }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'search on SIRET' do
|
|
||||||
context 'when is part of SIRET' do
|
|
||||||
let(:terms) { '4181' }
|
|
||||||
|
|
||||||
it { expect(subject.size).to eq(1) }
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when is a complet SIRET' do
|
|
||||||
let(:terms) { '41816602300012' }
|
|
||||||
|
|
||||||
it { expect(subject.size).to eq(1) }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'search on raison social' do
|
|
||||||
let(:terms) { 'OCTO' }
|
|
||||||
|
|
||||||
it { expect(subject.size).to eq(2) }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'search on multiple fields' do
|
|
||||||
let(:terms) { 'octo test' }
|
|
||||||
|
|
||||||
it { expect(subject.size).to eq(1) }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#cerfa_available?' do
|
describe '#cerfa_available?' do
|
||||||
|
|
|
@ -243,14 +243,14 @@ describe Procedure do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'is not available from a valid path anymore' do
|
it 'is not available from a valid path anymore' do
|
||||||
expect(procedure.path).to be_nil
|
expect(procedure.path).to eq procedure_path.path
|
||||||
expect(procedure.published).to be_truthy
|
expect(procedure.published).to be_truthy
|
||||||
expect(procedure.archived).to be_truthy
|
expect(procedure.archived).to be_truthy
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'is not in ProcedurePath table anymore' do
|
it 'is not in ProcedurePath table anymore' do
|
||||||
expect(ProcedurePath.where(path: procedure.path).count).to eq(0)
|
expect(ProcedurePath.where(path: procedure.path).count).to eq(1)
|
||||||
expect(ProcedurePath.find_by_procedure_id(procedure.id)).to be_nil
|
expect(ProcedurePath.find_by_procedure_id(procedure.id)).not_to be_nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
79
spec/models/search_spec.rb
Normal file
79
spec/models/search_spec.rb
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
describe Search do
|
||||||
|
describe '.results' do
|
||||||
|
subject { liste_dossiers }
|
||||||
|
|
||||||
|
let(:liste_dossiers) do
|
||||||
|
described_class.new(gestionnaire: gestionnaire_1, query: terms).results
|
||||||
|
end
|
||||||
|
|
||||||
|
let(:administrateur_1) { create(:administrateur) }
|
||||||
|
let(:administrateur_2) { create(:administrateur) }
|
||||||
|
|
||||||
|
let(:gestionnaire_1) { create(:gestionnaire, administrateurs: [administrateur_1]) }
|
||||||
|
let(:gestionnaire_2) { create(:gestionnaire, administrateurs: [administrateur_2]) }
|
||||||
|
|
||||||
|
before do
|
||||||
|
create :assign_to, gestionnaire: gestionnaire_1, procedure: procedure_1
|
||||||
|
create :assign_to, gestionnaire: gestionnaire_2, procedure: procedure_2
|
||||||
|
end
|
||||||
|
|
||||||
|
let(:procedure_1) { create(:procedure, administrateur: administrateur_1) }
|
||||||
|
let(:procedure_2) { create(:procedure, administrateur: administrateur_2) }
|
||||||
|
|
||||||
|
let!(:dossier_0) { create(:dossier, state: 'draft', procedure: procedure_1, user: create(:user, email: 'brouillon@clap.fr')) }
|
||||||
|
let!(:dossier_1) { create(:dossier, state: 'initiated', procedure: procedure_1, user: create(:user, email: 'contact@test.com')) }
|
||||||
|
let!(:dossier_2) { create(:dossier, state: 'initiated', procedure: procedure_1, user: create(:user, email: 'plop@gmail.com')) }
|
||||||
|
let!(:dossier_3) { create(:dossier, state: 'initiated', procedure: procedure_2, user: create(:user, email: 'peace@clap.fr')) }
|
||||||
|
let!(:dossier_archived) { create(:dossier, state: 'initiated', procedure: procedure_1, archived: true, user: create(:user, email: 'brouillonArchived@clap.fr')) }
|
||||||
|
|
||||||
|
let!(:etablissement_1) { create(:etablissement, entreprise: create(:entreprise, raison_sociale: 'OCTO Academy', dossier: dossier_1), dossier: dossier_1, siret: '41636169600051') }
|
||||||
|
let!(:etablissement_2) { create(:etablissement, entreprise: create(:entreprise, raison_sociale: 'Plop octo', dossier: dossier_2), dossier: dossier_2, siret: '41816602300012') }
|
||||||
|
let!(:etablissement_3) { create(:etablissement, entreprise: create(:entreprise, raison_sociale: 'OCTO Technology', dossier: dossier_3), dossier: dossier_3, siret: '41816609600051') }
|
||||||
|
|
||||||
|
describe 'search is empty' do
|
||||||
|
let(:terms) { '' }
|
||||||
|
|
||||||
|
it { expect(subject.size).to eq(0) }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe 'search draft file' do
|
||||||
|
let(:terms) { 'brouillon' }
|
||||||
|
|
||||||
|
it { expect(subject.size).to eq(0) }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe 'search on contact email' do
|
||||||
|
let(:terms) { 'clap' }
|
||||||
|
|
||||||
|
it { expect(subject.size).to eq(0) }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe 'search on SIRET' do
|
||||||
|
context 'when is part of SIRET' do
|
||||||
|
let(:terms) { '4181' }
|
||||||
|
|
||||||
|
it { expect(subject.size).to eq(1) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when is a complet SIRET' do
|
||||||
|
let(:terms) { '41816602300012' }
|
||||||
|
|
||||||
|
it { expect(subject.size).to eq(1) }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe 'search on raison social' do
|
||||||
|
let(:terms) { 'OCTO' }
|
||||||
|
|
||||||
|
it { expect(subject.size).to eq(2) }
|
||||||
|
end
|
||||||
|
|
||||||
|
describe 'search on multiple fields' do
|
||||||
|
let(:terms) { 'octo plop' }
|
||||||
|
|
||||||
|
it { expect(subject.size).to eq(1) }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -95,29 +95,27 @@ describe 'backoffice/dossiers/index.html.haml', type: :view do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'on tab a_traiter' do
|
describe 'on tab a_traiter' do
|
||||||
let(:total_dossiers) { 1 }
|
let(:total_dossiers) { 2 }
|
||||||
let(:active_class) { '.active .text-danger' }
|
let(:active_class) { '.active .text-danger' }
|
||||||
let(:dossiers_to_display) { gestionnaire.dossiers.waiting_for_gestionnaire }
|
let(:dossiers_to_display) { gestionnaire.dossiers.ouvert }
|
||||||
let(:liste) { 'a_traiter' }
|
let(:liste) { 'a_traiter' }
|
||||||
|
|
||||||
it_behaves_like 'check_tab_content' do
|
it_behaves_like 'check_tab_content' do
|
||||||
let(:decorate_dossier_at_check) { decorate_dossier_updated }
|
let(:decorate_dossier_at_check) { decorate_dossier_updated }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it_behaves_like 'check_tab_content' do
|
||||||
|
let(:decorate_dossier_at_check) { decorate_dossier_replied }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'on tab en_attente' do
|
describe 'on tab figes' do
|
||||||
let(:total_dossiers) { 2 }
|
let(:total_dossiers) { 1 }
|
||||||
let(:active_class) { '.active .text-default' }
|
let(:active_class) { '.active .text-default' }
|
||||||
let(:dossiers_to_display) { gestionnaire.dossiers.waiting_for_user }
|
let(:dossiers_to_display) { gestionnaire.dossiers.fige }
|
||||||
let(:liste) { 'en_attente' }
|
let(:liste) { 'fige' }
|
||||||
|
|
||||||
describe 'for state replied' do
|
describe 'for state replied' do
|
||||||
it_behaves_like 'check_tab_content' do
|
|
||||||
let(:decorate_dossier_at_check) { decorate_dossier_replied }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'for state validated' do
|
|
||||||
it_behaves_like 'check_tab_content' do
|
it_behaves_like 'check_tab_content' do
|
||||||
let(:decorate_dossier_at_check) { decorate_dossier_validated }
|
let(:decorate_dossier_at_check) { decorate_dossier_validated }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue