Merge branch 'dev'
This commit is contained in:
commit
c3f39a7941
70 changed files with 595 additions and 264 deletions
|
@ -523,7 +523,7 @@ Performance/FlatMap:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Performance/HashEachMethods:
|
Performance/HashEachMethods:
|
||||||
Enabled: true
|
Enabled: false
|
||||||
|
|
||||||
Performance/LstripRstrip:
|
Performance/LstripRstrip:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
3
Gemfile
3
Gemfile
|
@ -2,6 +2,9 @@ source 'https://rubygems.org'
|
||||||
|
|
||||||
gem 'rails', '~> 5.2.0.rc1'
|
gem 'rails', '~> 5.2.0.rc1'
|
||||||
|
|
||||||
|
# Temporary lock ffi version. Read more: https://github.com/ffi/ffi/commit/0fef6d44d09018d03c24af7fa4f9fcd38f36b642
|
||||||
|
gem 'ffi', '1.9.18'
|
||||||
|
|
||||||
# Use SCSS for stylesheets
|
# Use SCSS for stylesheets
|
||||||
gem 'sass-rails'
|
gem 'sass-rails'
|
||||||
# Use Uglifier as compressor for JavaScript assets
|
# Use Uglifier as compressor for JavaScript assets
|
||||||
|
|
77
Gemfile.lock
77
Gemfile.lock
|
@ -96,7 +96,7 @@ GEM
|
||||||
apipie-rails (0.5.6)
|
apipie-rails (0.5.6)
|
||||||
rails (>= 4.1)
|
rails (>= 4.1)
|
||||||
arel (9.0.0)
|
arel (9.0.0)
|
||||||
ast (2.3.0)
|
ast (2.4.0)
|
||||||
attr_required (1.0.1)
|
attr_required (1.0.1)
|
||||||
autoprefixer-rails (7.2.5)
|
autoprefixer-rails (7.2.5)
|
||||||
execjs
|
execjs
|
||||||
|
@ -115,8 +115,8 @@ GEM
|
||||||
brakeman (4.1.1)
|
brakeman (4.1.1)
|
||||||
browser (2.5.2)
|
browser (2.5.2)
|
||||||
builder (3.2.3)
|
builder (3.2.3)
|
||||||
byebug (9.1.0)
|
byebug (10.0.0)
|
||||||
capybara (2.17.0)
|
capybara (2.18.0)
|
||||||
addressable
|
addressable
|
||||||
mini_mime (>= 0.1.3)
|
mini_mime (>= 0.1.3)
|
||||||
nokogiri (>= 1.3.3)
|
nokogiri (>= 1.3.3)
|
||||||
|
@ -296,7 +296,7 @@ GEM
|
||||||
multi_json (~> 1.10)
|
multi_json (~> 1.10)
|
||||||
fog-local (0.4.0)
|
fog-local (0.4.0)
|
||||||
fog-core (~> 1.27)
|
fog-core (~> 1.27)
|
||||||
fog-openstack (0.1.23)
|
fog-openstack (0.1.24)
|
||||||
fog-core (~> 1.40)
|
fog-core (~> 1.40)
|
||||||
fog-json (>= 1.0)
|
fog-json (>= 1.0)
|
||||||
ipaddress (>= 0.8)
|
ipaddress (>= 0.8)
|
||||||
|
@ -403,7 +403,7 @@ GEM
|
||||||
domain_name (~> 0.5)
|
domain_name (~> 0.5)
|
||||||
http_parser.rb (0.6.0)
|
http_parser.rb (0.6.0)
|
||||||
httpclient (2.8.3)
|
httpclient (2.8.3)
|
||||||
i18n (0.9.3)
|
i18n (0.9.5)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
inflecto (0.0.2)
|
inflecto (0.0.2)
|
||||||
ipaddress (0.8.3)
|
ipaddress (0.8.3)
|
||||||
|
@ -448,7 +448,7 @@ GEM
|
||||||
activesupport (>= 4.0)
|
activesupport (>= 4.0)
|
||||||
logstash-event (~> 1.2.0)
|
logstash-event (~> 1.2.0)
|
||||||
request_store
|
request_store
|
||||||
loofah (2.1.1)
|
loofah (2.2.0)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
lumberjack (1.0.12)
|
lumberjack (1.0.12)
|
||||||
|
@ -474,7 +474,7 @@ GEM
|
||||||
multi_json (1.13.1)
|
multi_json (1.13.1)
|
||||||
multi_xml (0.6.0)
|
multi_xml (0.6.0)
|
||||||
multipart-post (2.0.0)
|
multipart-post (2.0.0)
|
||||||
mustermann (1.0.1)
|
mustermann (1.0.2)
|
||||||
nenv (0.3.0)
|
nenv (0.3.0)
|
||||||
netrc (0.11.0)
|
netrc (0.11.0)
|
||||||
nio4r (2.2.0)
|
nio4r (2.2.0)
|
||||||
|
@ -510,12 +510,12 @@ GEM
|
||||||
validate_email
|
validate_email
|
||||||
validate_url
|
validate_url
|
||||||
webfinger (>= 1.0.1)
|
webfinger (>= 1.0.1)
|
||||||
openstack (3.3.12)
|
openstack (3.3.15)
|
||||||
json
|
json
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
parallel (1.12.1)
|
parallel (1.12.1)
|
||||||
parser (2.4.0.2)
|
parser (2.5.0.1)
|
||||||
ast (~> 2.3)
|
ast (~> 2.4.0)
|
||||||
pdf-core (0.7.0)
|
pdf-core (0.7.0)
|
||||||
pg (0.19.0)
|
pg (0.19.0)
|
||||||
powerpack (0.1.1)
|
powerpack (0.1.1)
|
||||||
|
@ -528,11 +528,11 @@ GEM
|
||||||
pry (0.11.3)
|
pry (0.11.3)
|
||||||
coderay (~> 1.1.0)
|
coderay (~> 1.1.0)
|
||||||
method_source (~> 0.9.0)
|
method_source (~> 0.9.0)
|
||||||
pry-byebug (3.5.1)
|
pry-byebug (3.6.0)
|
||||||
byebug (~> 9.1)
|
byebug (~> 10.0)
|
||||||
pry (~> 0.10)
|
pry (~> 0.10)
|
||||||
public_suffix (3.0.1)
|
public_suffix (3.0.2)
|
||||||
rack (2.0.3)
|
rack (2.0.4)
|
||||||
rack-handlers (0.7.3)
|
rack-handlers (0.7.3)
|
||||||
rack
|
rack
|
||||||
rack-mini-profiler (0.10.7)
|
rack-mini-profiler (0.10.7)
|
||||||
|
@ -543,7 +543,7 @@ GEM
|
||||||
httpclient (>= 2.4)
|
httpclient (>= 2.4)
|
||||||
multi_json (>= 1.3.6)
|
multi_json (>= 1.3.6)
|
||||||
rack (>= 1.1)
|
rack (>= 1.1)
|
||||||
rack-protection (2.0.0)
|
rack-protection (2.0.1)
|
||||||
rack
|
rack
|
||||||
rack-test (0.8.2)
|
rack-test (0.8.2)
|
||||||
rack (>= 1.0, < 3)
|
rack (>= 1.0, < 3)
|
||||||
|
@ -604,27 +604,27 @@ GEM
|
||||||
activesupport (>= 3.0, < 6.0)
|
activesupport (>= 3.0, < 6.0)
|
||||||
builder (~> 3.0)
|
builder (~> 3.0)
|
||||||
rubyzip (~> 1.0)
|
rubyzip (~> 1.0)
|
||||||
rspec (3.5.0)
|
rspec (3.7.0)
|
||||||
rspec-core (~> 3.5.0)
|
rspec-core (~> 3.7.0)
|
||||||
rspec-expectations (~> 3.5.0)
|
rspec-expectations (~> 3.7.0)
|
||||||
rspec-mocks (~> 3.5.0)
|
rspec-mocks (~> 3.7.0)
|
||||||
rspec-core (3.5.4)
|
rspec-core (3.7.1)
|
||||||
rspec-support (~> 3.5.0)
|
rspec-support (~> 3.7.0)
|
||||||
rspec-expectations (3.5.0)
|
rspec-expectations (3.7.0)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.5.0)
|
rspec-support (~> 3.7.0)
|
||||||
rspec-mocks (3.5.0)
|
rspec-mocks (3.7.0)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.5.0)
|
rspec-support (~> 3.7.0)
|
||||||
rspec-rails (3.5.2)
|
rspec-rails (3.7.2)
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
railties (>= 3.0)
|
railties (>= 3.0)
|
||||||
rspec-core (~> 3.5.0)
|
rspec-core (~> 3.7.0)
|
||||||
rspec-expectations (~> 3.5.0)
|
rspec-expectations (~> 3.7.0)
|
||||||
rspec-mocks (~> 3.5.0)
|
rspec-mocks (~> 3.7.0)
|
||||||
rspec-support (~> 3.5.0)
|
rspec-support (~> 3.7.0)
|
||||||
rspec-support (3.5.0)
|
rspec-support (3.7.1)
|
||||||
rspec_junit_formatter (0.3.0)
|
rspec_junit_formatter (0.3.0)
|
||||||
rspec-core (>= 2, < 4, != 2.12.0)
|
rspec-core (>= 2, < 4, != 2.12.0)
|
||||||
rubocop (0.52.1)
|
rubocop (0.52.1)
|
||||||
|
@ -670,21 +670,21 @@ GEM
|
||||||
selenium-webdriver (3.8.0)
|
selenium-webdriver (3.8.0)
|
||||||
childprocess (~> 0.5)
|
childprocess (~> 0.5)
|
||||||
rubyzip (~> 1.0)
|
rubyzip (~> 1.0)
|
||||||
sentry-raven (2.7.1)
|
sentry-raven (2.7.2)
|
||||||
faraday (>= 0.7.6, < 1.0)
|
faraday (>= 0.7.6, < 1.0)
|
||||||
sexp_processor (4.10.0)
|
sexp_processor (4.10.0)
|
||||||
shellany (0.0.1)
|
shellany (0.0.1)
|
||||||
shoulda-matchers (3.1.2)
|
shoulda-matchers (3.1.2)
|
||||||
activesupport (>= 4.0.0)
|
activesupport (>= 4.0.0)
|
||||||
simple_form (3.5.0)
|
simple_form (3.5.1)
|
||||||
actionpack (> 4, < 5.2)
|
actionpack (> 4, < 5.2)
|
||||||
activemodel (> 4, < 5.2)
|
activemodel (> 4, < 5.2)
|
||||||
sinatra (2.0.0)
|
sinatra (2.0.1)
|
||||||
mustermann (~> 1.0)
|
mustermann (~> 1.0)
|
||||||
rack (~> 2.0)
|
rack (~> 2.0)
|
||||||
rack-protection (= 2.0.0)
|
rack-protection (= 2.0.1)
|
||||||
tilt (~> 2.0)
|
tilt (~> 2.0)
|
||||||
skylight (1.5.0)
|
skylight (1.5.1)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
spreadsheet_architect (1.4.8)
|
spreadsheet_architect (1.4.8)
|
||||||
axlsx (>= 2.0)
|
axlsx (>= 2.0)
|
||||||
|
@ -718,9 +718,9 @@ GEM
|
||||||
turbolinks (5.1.0)
|
turbolinks (5.1.0)
|
||||||
turbolinks-source (~> 5.1)
|
turbolinks-source (~> 5.1)
|
||||||
turbolinks-source (5.1.0)
|
turbolinks-source (5.1.0)
|
||||||
tzinfo (1.2.4)
|
tzinfo (1.2.5)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
uglifier (4.1.4)
|
uglifier (4.1.6)
|
||||||
execjs (>= 0.3.0, < 3)
|
execjs (>= 0.3.0, < 3)
|
||||||
unf (0.1.4)
|
unf (0.1.4)
|
||||||
unf_ext
|
unf_ext
|
||||||
|
@ -789,6 +789,7 @@ DEPENDENCIES
|
||||||
dotenv-rails
|
dotenv-rails
|
||||||
draper
|
draper
|
||||||
factory_bot
|
factory_bot
|
||||||
|
ffi (= 1.9.18)
|
||||||
fog
|
fog
|
||||||
fog-openstack
|
fog-openstack
|
||||||
font-awesome-rails
|
font-awesome-rails
|
||||||
|
|
|
@ -7,3 +7,7 @@ $footer-height: 267px;
|
||||||
$footer-height-mobile: 531px;
|
$footer-height-mobile: 531px;
|
||||||
|
|
||||||
$small-footer-height: 2 * $default-padding;
|
$small-footer-height: 2 * $default-padding;
|
||||||
|
|
||||||
|
// layouts
|
||||||
|
$two-columns-padding: 60px;
|
||||||
|
$two-columns-breakpoint: $page-width + (2 * $two-columns-padding);
|
||||||
|
|
|
@ -3,24 +3,7 @@
|
||||||
@import "placeholders";
|
@import "placeholders";
|
||||||
@import "mixins";
|
@import "mixins";
|
||||||
|
|
||||||
$auth-breakpoint: 820px;
|
$auth-breakpoint: $two-columns-breakpoint;
|
||||||
|
|
||||||
@media (max-width: $auth-breakpoint) {
|
|
||||||
.preview {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.two-columns .column.auth-form {
|
|
||||||
@include horizontal-padding(0);
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: $auth-breakpoint) {
|
|
||||||
.two-columns.auth {
|
|
||||||
background: #FFFFFF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.preview {
|
.preview {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
|
@ -28,6 +11,10 @@ $auth-breakpoint: 820px;
|
||||||
.paperless-logo {
|
.paperless-logo {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-bottom: 60px;
|
margin-bottom: 60px;
|
||||||
|
|
||||||
|
@media (max-width: $auth-breakpoint) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
|
@ -41,11 +28,19 @@ $auth-breakpoint: 820px;
|
||||||
|
|
||||||
.procedure-title {
|
.procedure-title {
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
margin: 50px 0 32px;
|
margin: 20px 0 0;
|
||||||
|
|
||||||
|
@media (min-width: $auth-breakpoint) {
|
||||||
|
margin: 50px 0 32px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.procedure-description {
|
.procedure-description {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
|
||||||
|
@media (max-width: $auth-breakpoint) {
|
||||||
|
display: none; // TO FIX : make this description available for small devices
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.procedure-logos {
|
.procedure-logos {
|
||||||
|
@ -53,8 +48,14 @@ $auth-breakpoint: 820px;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
max-height: 130px;
|
max-height: 50px;
|
||||||
|
max-width: 100%;
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
|
|
||||||
|
@media (min-width: $auth-breakpoint) {
|
||||||
|
max-height: 130px;
|
||||||
|
max-width: 500px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,13 @@
|
||||||
display: block;
|
display: block;
|
||||||
margin-top: $default-spacer;
|
margin-top: $default-spacer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.required {
|
||||||
|
&::after {
|
||||||
|
color: $dark-red;
|
||||||
|
content: " *";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.editable-champ {
|
.editable-champ {
|
||||||
|
@ -70,6 +77,10 @@
|
||||||
&:disabled {
|
&:disabled {
|
||||||
background-color: $border-grey;
|
background-color: $border-grey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.small {
|
||||||
|
padding: $default-padding / 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type=text],
|
input[type=text],
|
||||||
|
@ -114,11 +125,17 @@
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
-moz-appearance: none;
|
-moz-appearance: none;
|
||||||
appearance: none;
|
appearance: none;
|
||||||
background: image-url("icons/chevron-down.svg") no-repeat;
|
background-color: #FFFFFF;
|
||||||
|
background-image: image-url("icons/chevron-down.svg");
|
||||||
|
background-repeat: no-repeat;
|
||||||
background-size: 14px;
|
background-size: 14px;
|
||||||
background-position: right 10px center;
|
background-position: right 10px center;
|
||||||
padding-right: 4 * $default-spacer;
|
padding-right: 4 * $default-spacer;
|
||||||
|
|
||||||
|
&.small {
|
||||||
|
padding-right: 3 * $default-spacer;
|
||||||
|
}
|
||||||
|
|
||||||
// CAUTION: IE hackery ahead
|
// CAUTION: IE hackery ahead
|
||||||
&::-ms-expand {
|
&::-ms-expand {
|
||||||
display: none; // remove default arrow in IE 10 and 11 */
|
display: none; // remove default arrow in IE 10 and 11 */
|
||||||
|
@ -208,4 +225,18 @@
|
||||||
margin-bottom: $default-padding;
|
margin-bottom: $default-padding;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.inline-champ {
|
||||||
|
margin-left: $default-spacer;
|
||||||
|
margin-right: $default-spacer;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
5
app/assets/stylesheets/new_design/helpers.scss
Normal file
5
app/assets/stylesheets/new_design/helpers.scss
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
@import "constants";
|
||||||
|
|
||||||
|
.mb-1 {
|
||||||
|
margin-bottom: $default-spacer;
|
||||||
|
}
|
|
@ -3,23 +3,34 @@
|
||||||
@import "constants";
|
@import "constants";
|
||||||
|
|
||||||
.two-columns {
|
.two-columns {
|
||||||
$column-padding: 60px;
|
background-color: #FFFFFF;
|
||||||
$two-columns-breakpoint: $page-width + (2 * $column-padding);
|
|
||||||
|
|
||||||
background: linear-gradient(to right, #FFFFFF 0%, #FFFFFF 50%, $light-grey 50%, $light-grey 100%);
|
@media (min-width: $two-columns-breakpoint) {
|
||||||
|
background: linear-gradient(to right, #FFFFFF 0%, #FFFFFF 50%, $light-grey 50%, $light-grey 100%);
|
||||||
|
}
|
||||||
|
|
||||||
.columns-container {
|
.columns-container {
|
||||||
@extend .container;
|
@extend .container;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: column;
|
||||||
align-items: center;
|
|
||||||
|
@media (min-width: $two-columns-breakpoint) {
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.column {
|
.column {
|
||||||
width: 50%;
|
padding: $two-columns-padding 0 0;
|
||||||
padding: $column-padding;
|
width: 100%;
|
||||||
|
max-width: 500px;
|
||||||
|
margin: auto;
|
||||||
|
|
||||||
@media (min-width: $two-columns-breakpoint) {
|
@media (min-width: $two-columns-breakpoint) {
|
||||||
|
padding: $two-columns-padding;
|
||||||
|
width: 50%;
|
||||||
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ module NewGestionnaire
|
||||||
def update
|
def update
|
||||||
avis.update_attributes(avis_params)
|
avis.update_attributes(avis_params)
|
||||||
flash.notice = 'Votre réponse est enregistrée.'
|
flash.notice = 'Votre réponse est enregistrée.'
|
||||||
redirect_to instruction_avis_path(avis)
|
redirect_to instruction_gestionnaire_avis_path(avis)
|
||||||
end
|
end
|
||||||
|
|
||||||
def messagerie
|
def messagerie
|
||||||
|
@ -46,7 +46,7 @@ module NewGestionnaire
|
||||||
|
|
||||||
if @commentaire.save
|
if @commentaire.save
|
||||||
flash.notice = "Message envoyé"
|
flash.notice = "Message envoyé"
|
||||||
redirect_to messagerie_avis_path(avis)
|
redirect_to messagerie_gestionnaire_avis_path(avis)
|
||||||
else
|
else
|
||||||
flash.alert = @commentaire.errors.full_messages
|
flash.alert = @commentaire.errors.full_messages
|
||||||
render :messagerie
|
render :messagerie
|
||||||
|
@ -56,7 +56,7 @@ module NewGestionnaire
|
||||||
def create_avis
|
def create_avis
|
||||||
confidentiel = avis.confidentiel || params[:avis][:confidentiel]
|
confidentiel = avis.confidentiel || params[:avis][:confidentiel]
|
||||||
Avis.create(create_avis_params.merge(claimant: current_gestionnaire, dossier: avis.dossier, confidentiel: confidentiel))
|
Avis.create(create_avis_params.merge(claimant: current_gestionnaire, dossier: avis.dossier, confidentiel: confidentiel))
|
||||||
redirect_to instruction_avis_path(avis)
|
redirect_to instruction_gestionnaire_avis_path(avis)
|
||||||
end
|
end
|
||||||
|
|
||||||
def sign_up
|
def sign_up
|
||||||
|
@ -76,10 +76,10 @@ module NewGestionnaire
|
||||||
sign_in(gestionnaire, scope: :gestionnaire)
|
sign_in(gestionnaire, scope: :gestionnaire)
|
||||||
Avis.link_avis_to_gestionnaire(gestionnaire)
|
Avis.link_avis_to_gestionnaire(gestionnaire)
|
||||||
avis = Avis.find(params[:id])
|
avis = Avis.find(params[:id])
|
||||||
redirect_to url_for(avis_index_path)
|
redirect_to url_for(gestionnaire_avis_index_path)
|
||||||
else
|
else
|
||||||
flash[:alert] = gestionnaire.errors.full_messages
|
flash[:alert] = gestionnaire.errors.full_messages
|
||||||
redirect_to url_for(sign_up_avis_path(params[:id], email))
|
redirect_to url_for(sign_up_gestionnaire_avis_path(params[:id], email))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ module NewGestionnaire
|
||||||
if current_gestionnaire.present?
|
if current_gestionnaire.present?
|
||||||
# a gestionnaire is authenticated ... lets see if it can view the dossier
|
# a gestionnaire is authenticated ... lets see if it can view the dossier
|
||||||
|
|
||||||
redirect_to avis_url(avis)
|
redirect_to gestionnaire_avis_url(avis)
|
||||||
elsif avis.gestionnaire.present? && avis.gestionnaire.email == params[:email]
|
elsif avis.gestionnaire.present? && avis.gestionnaire.email == params[:email]
|
||||||
# the avis gestionnaire has already signed up and it sould sign in
|
# the avis gestionnaire has already signed up and it sould sign in
|
||||||
|
|
||||||
|
|
|
@ -40,31 +40,31 @@ module NewGestionnaire
|
||||||
recipient = Gestionnaire.find(params[:recipient])
|
recipient = Gestionnaire.find(params[:recipient])
|
||||||
GestionnaireMailer.send_dossier(current_gestionnaire, dossier, recipient).deliver_later
|
GestionnaireMailer.send_dossier(current_gestionnaire, dossier, recipient).deliver_later
|
||||||
flash.notice = "Dossier envoyé"
|
flash.notice = "Dossier envoyé"
|
||||||
redirect_to(personnes_impliquees_dossier_path(procedure, dossier))
|
redirect_to(personnes_impliquees_gestionnaire_dossier_path(procedure, dossier))
|
||||||
end
|
end
|
||||||
|
|
||||||
def follow
|
def follow
|
||||||
current_gestionnaire.follow(dossier)
|
current_gestionnaire.follow(dossier)
|
||||||
flash.notice = 'Dossier suivi'
|
flash.notice = 'Dossier suivi'
|
||||||
redirect_back(fallback_location: procedures_url)
|
redirect_back(fallback_location: gestionnaire_procedures_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
def unfollow
|
def unfollow
|
||||||
current_gestionnaire.unfollow(dossier)
|
current_gestionnaire.unfollow(dossier)
|
||||||
flash.notice = "Vous ne suivez plus le dossier nº #{dossier.id}"
|
flash.notice = "Vous ne suivez plus le dossier nº #{dossier.id}"
|
||||||
|
|
||||||
redirect_back(fallback_location: procedures_url)
|
redirect_back(fallback_location: gestionnaire_procedures_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
def archive
|
def archive
|
||||||
dossier.update_attributes(archived: true)
|
dossier.update_attributes(archived: true)
|
||||||
current_gestionnaire.unfollow(dossier)
|
current_gestionnaire.unfollow(dossier)
|
||||||
redirect_back(fallback_location: procedures_url)
|
redirect_back(fallback_location: gestionnaire_procedures_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
def unarchive
|
def unarchive
|
||||||
dossier.update_attributes(archived: false)
|
dossier.update_attributes(archived: false)
|
||||||
redirect_back(fallback_location: procedures_url)
|
redirect_back(fallback_location: gestionnaire_procedures_url)
|
||||||
end
|
end
|
||||||
|
|
||||||
def passer_en_instruction
|
def passer_en_instruction
|
||||||
|
@ -72,14 +72,14 @@ module NewGestionnaire
|
||||||
current_gestionnaire.follow(dossier)
|
current_gestionnaire.follow(dossier)
|
||||||
flash.notice = 'Dossier passé en instruction.'
|
flash.notice = 'Dossier passé en instruction.'
|
||||||
|
|
||||||
redirect_to dossier_path(procedure, dossier)
|
redirect_to gestionnaire_dossier_path(procedure, dossier)
|
||||||
end
|
end
|
||||||
|
|
||||||
def repasser_en_construction
|
def repasser_en_construction
|
||||||
dossier.en_construction!
|
dossier.en_construction!
|
||||||
flash.notice = 'Dossier repassé en construction.'
|
flash.notice = 'Dossier repassé en construction.'
|
||||||
|
|
||||||
redirect_to dossier_path(procedure, dossier)
|
redirect_to gestionnaire_dossier_path(procedure, dossier)
|
||||||
end
|
end
|
||||||
|
|
||||||
def terminer
|
def terminer
|
||||||
|
@ -118,7 +118,7 @@ module NewGestionnaire
|
||||||
|
|
||||||
NotificationMailer.send_notification(dossier, template, attestation_pdf).deliver_now!
|
NotificationMailer.send_notification(dossier, template, attestation_pdf).deliver_now!
|
||||||
|
|
||||||
redirect_to dossier_path(procedure, dossier)
|
redirect_to gestionnaire_dossier_path(procedure, dossier)
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_commentaire
|
def create_commentaire
|
||||||
|
@ -135,7 +135,7 @@ module NewGestionnaire
|
||||||
if @commentaire.save
|
if @commentaire.save
|
||||||
current_gestionnaire.follow(dossier)
|
current_gestionnaire.follow(dossier)
|
||||||
flash.notice = "Message envoyé"
|
flash.notice = "Message envoyé"
|
||||||
redirect_to messagerie_dossier_path(procedure, dossier)
|
redirect_to messagerie_gestionnaire_dossier_path(procedure, dossier)
|
||||||
else
|
else
|
||||||
flash.alert = @commentaire.errors.full_messages
|
flash.alert = @commentaire.errors.full_messages
|
||||||
render :messagerie
|
render :messagerie
|
||||||
|
@ -160,14 +160,14 @@ module NewGestionnaire
|
||||||
|
|
||||||
def create_avis
|
def create_avis
|
||||||
Avis.create(avis_params.merge(claimant: current_gestionnaire, dossier: dossier))
|
Avis.create(avis_params.merge(claimant: current_gestionnaire, dossier: dossier))
|
||||||
redirect_to avis_dossier_path(procedure, dossier)
|
redirect_to avis_gestionnaire_dossier_path(procedure, dossier)
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_annotations
|
def update_annotations
|
||||||
dossier = current_gestionnaire.dossiers.includes(champs_private: :type_de_champ).find(params[:dossier_id])
|
dossier = current_gestionnaire.dossiers.includes(champs_private: :type_de_champ).find(params[:dossier_id])
|
||||||
# FIXME: add attachements validation, cf. Champ#piece_justificative_file_errors
|
# FIXME: add attachements validation, cf. Champ#piece_justificative_file_errors
|
||||||
dossier.update_attributes(champs_private_params)
|
dossier.update_attributes(champs_private_params)
|
||||||
redirect_to annotations_privees_dossier_path(procedure, dossier)
|
redirect_to annotations_privees_gestionnaire_dossier_path(procedure, dossier)
|
||||||
end
|
end
|
||||||
|
|
||||||
def print
|
def print
|
||||||
|
|
|
@ -3,5 +3,9 @@ module NewGestionnaire
|
||||||
layout "new_application"
|
layout "new_application"
|
||||||
|
|
||||||
before_action :authenticate_gestionnaire!
|
before_action :authenticate_gestionnaire!
|
||||||
|
|
||||||
|
def nav_bar_profile
|
||||||
|
:gestionnaire
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -116,7 +116,7 @@ module NewGestionnaire
|
||||||
procedure_presentation.update_attributes(sort: Procedure.default_sort)
|
procedure_presentation.update_attributes(sort: Procedure.default_sort)
|
||||||
end
|
end
|
||||||
|
|
||||||
redirect_back(fallback_location: procedure_url(procedure))
|
redirect_back(fallback_location: gestionnaire_procedure_url(procedure))
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_sort
|
def update_sort
|
||||||
|
@ -138,7 +138,7 @@ module NewGestionnaire
|
||||||
|
|
||||||
procedure_presentation.update_attributes(sort: sort)
|
procedure_presentation.update_attributes(sort: sort)
|
||||||
|
|
||||||
redirect_back(fallback_location: procedure_url(procedure))
|
redirect_back(fallback_location: gestionnaire_procedure_url(procedure))
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_filter
|
def add_filter
|
||||||
|
@ -157,7 +157,7 @@ module NewGestionnaire
|
||||||
procedure_presentation.update_attributes(filters: filters.to_json)
|
procedure_presentation.update_attributes(filters: filters.to_json)
|
||||||
end
|
end
|
||||||
|
|
||||||
redirect_back(fallback_location: procedure_url(procedure))
|
redirect_back(fallback_location: gestionnaire_procedure_url(procedure))
|
||||||
end
|
end
|
||||||
|
|
||||||
def remove_filter
|
def remove_filter
|
||||||
|
@ -170,7 +170,7 @@ module NewGestionnaire
|
||||||
|
|
||||||
procedure_presentation.update_attributes(filters: filters.to_json)
|
procedure_presentation.update_attributes(filters: filters.to_json)
|
||||||
|
|
||||||
redirect_back(fallback_location: procedure_url(procedure))
|
redirect_back(fallback_location: gestionnaire_procedure_url(procedure))
|
||||||
end
|
end
|
||||||
|
|
||||||
def download_dossiers
|
def download_dossiers
|
||||||
|
@ -203,7 +203,7 @@ module NewGestionnaire
|
||||||
|
|
||||||
def redirect_to_avis_if_needed
|
def redirect_to_avis_if_needed
|
||||||
if current_gestionnaire.procedures.count == 0 && current_gestionnaire.avis.count > 0
|
if current_gestionnaire.procedures.count == 0 && current_gestionnaire.avis.count > 0
|
||||||
redirect_to avis_index_path
|
redirect_to gestionnaire_avis_index_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,35 @@ module NewUser
|
||||||
send_data(dossier.attestation.pdf.read, filename: 'attestation.pdf', type: 'application/pdf')
|
send_data(dossier.attestation.pdf.read, filename: 'attestation.pdf', type: 'application/pdf')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def identite
|
||||||
|
@dossier = dossier
|
||||||
|
@user = current_user
|
||||||
|
end
|
||||||
|
|
||||||
|
def update_identite
|
||||||
|
@dossier = dossier
|
||||||
|
|
||||||
|
individual_updated = @dossier.individual.update(individual_params)
|
||||||
|
dossier_updated = @dossier.update(dossier_params)
|
||||||
|
|
||||||
|
if individual_updated && dossier_updated
|
||||||
|
flash.notice = "Identité enregistrée"
|
||||||
|
|
||||||
|
if @dossier.procedure.module_api_carto.use_api_carto
|
||||||
|
redirect_to users_dossier_carte_path(@dossier.id)
|
||||||
|
else
|
||||||
|
redirect_to users_dossier_description_path(@dossier) # Simon should replace this with dossier_path when done
|
||||||
|
end
|
||||||
|
else
|
||||||
|
flash.now.alert = @dossier.errors.full_messages
|
||||||
|
render :identite
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def dossier
|
def dossier
|
||||||
Dossier.find(params[:dossier_id])
|
Dossier.find(params[:id] || params[:dossier_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
def ensure_ownership!
|
def ensure_ownership!
|
||||||
|
@ -18,5 +43,13 @@ module NewUser
|
||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def individual_params
|
||||||
|
params.require(:individual).permit(:gender, :nom, :prenom, :birthdate)
|
||||||
|
end
|
||||||
|
|
||||||
|
def dossier_params
|
||||||
|
params.require(:dossier).permit(:autorisation_donnees)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
module NewUser
|
module NewUser
|
||||||
class UserController < ApplicationController
|
class UserController < ApplicationController
|
||||||
|
layout "new_application"
|
||||||
|
|
||||||
before_action :authenticate_user!
|
before_action :authenticate_user!
|
||||||
|
|
||||||
|
def nav_bar_profile
|
||||||
|
:user
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,7 +5,7 @@ class RootController < ApplicationController
|
||||||
if administrateur_signed_in?
|
if administrateur_signed_in?
|
||||||
return redirect_to admin_procedures_path
|
return redirect_to admin_procedures_path
|
||||||
elsif gestionnaire_signed_in?
|
elsif gestionnaire_signed_in?
|
||||||
return redirect_to procedures_path
|
return redirect_to gestionnaire_procedures_path
|
||||||
elsif user_signed_in?
|
elsif user_signed_in?
|
||||||
return redirect_to users_dossiers_path
|
return redirect_to users_dossiers_path
|
||||||
elsif administration_signed_in?
|
elsif administration_signed_in?
|
||||||
|
|
|
@ -73,7 +73,11 @@ class Users::DossiersController < UsersController
|
||||||
|
|
||||||
update_current_user_siret! siret if siret.present?
|
update_current_user_siret! siret if siret.present?
|
||||||
|
|
||||||
redirect_to users_dossier_path(id: dossier.id)
|
if dossier.procedure.for_individual
|
||||||
|
redirect_to identite_dossier_path(dossier)
|
||||||
|
else
|
||||||
|
redirect_to users_dossier_path(id: dossier.id)
|
||||||
|
end
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
error_procedure
|
error_procedure
|
||||||
end
|
end
|
||||||
|
|
|
@ -26,7 +26,7 @@ class Users::SessionsController < Sessions::SessionsController
|
||||||
if user_signed_in?
|
if user_signed_in?
|
||||||
redirect_to after_sign_in_path_for(:user)
|
redirect_to after_sign_in_path_for(:user)
|
||||||
elsif gestionnaire_signed_in?
|
elsif gestionnaire_signed_in?
|
||||||
location = stored_location_for(:gestionnaire) || procedures_path
|
location = stored_location_for(:gestionnaire) || gestionnaire_procedures_path
|
||||||
redirect_to location
|
redirect_to location
|
||||||
elsif administrateur_signed_in?
|
elsif administrateur_signed_in?
|
||||||
redirect_to admin_path
|
redirect_to admin_path
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
module DossierLinkHelper
|
module DossierLinkHelper
|
||||||
def dossier_linked_path(gestionnaire, dossier)
|
def dossier_linked_path(gestionnaire, dossier)
|
||||||
if dossier.procedure.gestionnaires.include?(gestionnaire)
|
if dossier.procedure.gestionnaires.include?(gestionnaire)
|
||||||
dossier_path(dossier.procedure, dossier)
|
gestionnaire_dossier_path(dossier.procedure, dossier)
|
||||||
else
|
else
|
||||||
avis = dossier.avis.find_by(gestionnaire: gestionnaire)
|
avis = dossier.avis.find_by(gestionnaire: gestionnaire)
|
||||||
if avis.present?
|
if avis.present?
|
||||||
avis_path(avis)
|
gestionnaire_avis_path(avis)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,4 +6,8 @@ class ApplicationJob < ActiveJob::Base
|
||||||
after_perform do |job|
|
after_perform do |job|
|
||||||
Rails.logger.info("#{job.class.name} ended at #{Time.now}")
|
Rails.logger.info("#{job.class.name} ended at #{Time.now}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def error(job, exception)
|
||||||
|
Raven.capture_exception(exception)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,9 +2,23 @@ class AutoReceiveDossiersForProcedureJob < ApplicationJob
|
||||||
queue_as :cron
|
queue_as :cron
|
||||||
|
|
||||||
def perform(procedure_id, state)
|
def perform(procedure_id, state)
|
||||||
procedure = Procedure.find_by(id: procedure_id)
|
procedure = Procedure.find(procedure_id)
|
||||||
if procedure
|
attrs = case state
|
||||||
procedure.dossiers.state_en_construction.update_all(state: state, en_instruction_at: Time.now)
|
when :en_instruction
|
||||||
|
{
|
||||||
|
state: :en_instruction,
|
||||||
|
en_instruction_at: DateTime.now
|
||||||
|
}
|
||||||
|
when :accepte
|
||||||
|
{
|
||||||
|
state: :accepte,
|
||||||
|
en_instruction_at: DateTime.now,
|
||||||
|
processed_at: DateTime.now
|
||||||
|
}
|
||||||
|
else
|
||||||
|
raise "Receiving Procedure##{procedure_id} in invalid state \"#{state}\""
|
||||||
end
|
end
|
||||||
|
|
||||||
|
procedure.dossiers.state_en_construction.update_all(attrs)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@ class WeeklyOverviewJob < ApplicationJob
|
||||||
Gestionnaire.all
|
Gestionnaire.all
|
||||||
.map { |gestionnaire| [gestionnaire, gestionnaire.last_week_overview] }
|
.map { |gestionnaire| [gestionnaire, gestionnaire.last_week_overview] }
|
||||||
.reject { |_, overview| overview.nil? }
|
.reject { |_, overview| overview.nil? }
|
||||||
.each { |gestionnaire, overview| GestionnaireMailer.last_week_overview(gestionnaire, overview).deliver_now }
|
.each { |gestionnaire, _| GestionnaireMailer.last_week_overview(gestionnaire).deliver_later }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,8 +5,9 @@ class GestionnaireMailer < ApplicationMailer
|
||||||
send_mail email, password, "Vous avez été nommé accompagnateur sur la plateforme TPS"
|
send_mail email, password, "Vous avez été nommé accompagnateur sur la plateforme TPS"
|
||||||
end
|
end
|
||||||
|
|
||||||
def last_week_overview(gestionnaire, overview)
|
def last_week_overview(gestionnaire)
|
||||||
headers['X-mailjet-campaign'] = 'last_week_overview'
|
headers['X-mailjet-campaign'] = 'last_week_overview'
|
||||||
|
overview = gestionnaire.last_week_overview
|
||||||
send_mail gestionnaire.email, overview, 'Vos activités sur TPS'
|
send_mail gestionnaire.email, overview, 'Vos activités sur TPS'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,8 @@ class Dossier < ActiveRecord::Base
|
||||||
accepts_nested_attributes_for :champs
|
accepts_nested_attributes_for :champs
|
||||||
accepts_nested_attributes_for :champs_private
|
accepts_nested_attributes_for :champs_private
|
||||||
|
|
||||||
|
validates :autorisation_donnees, acceptance: { message: 'doit être coché' }, allow_nil: false, on: :update
|
||||||
|
|
||||||
default_scope { where(hidden_at: nil) }
|
default_scope { where(hidden_at: nil) }
|
||||||
scope :state_brouillon, -> { where(state: 'brouillon') }
|
scope :state_brouillon, -> { where(state: 'brouillon') }
|
||||||
scope :state_not_brouillon, -> { where.not(state: 'brouillon') }
|
scope :state_not_brouillon, -> { where.not(state: 'brouillon') }
|
||||||
|
@ -177,7 +179,7 @@ class Dossier < ActiveRecord::Base
|
||||||
etablissement.destroy
|
etablissement.destroy
|
||||||
entreprise.destroy
|
entreprise.destroy
|
||||||
|
|
||||||
update_attributes(autorisation_donnees: false)
|
update_columns(autorisation_donnees: false)
|
||||||
end
|
end
|
||||||
|
|
||||||
def total_follow
|
def total_follow
|
||||||
|
|
|
@ -101,14 +101,28 @@ class Gestionnaire < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def notifications_for_procedure(procedure)
|
def notifications_for_procedure(procedure, state = :en_cours)
|
||||||
dossiers = procedure.dossiers.en_cours.followed_by(self)
|
dossiers = case state
|
||||||
|
when :termine
|
||||||
|
procedure.dossiers.termine
|
||||||
|
when :not_archived
|
||||||
|
procedure.dossiers.not_archived
|
||||||
|
else
|
||||||
|
procedure.dossiers.en_cours
|
||||||
|
end.followed_by(self)
|
||||||
|
|
||||||
dossiers_id_with_notifications(dossiers)
|
dossiers_id_with_notifications(dossiers)
|
||||||
end
|
end
|
||||||
|
|
||||||
def notifications_per_procedure
|
def notifications_per_procedure(state = :en_cours)
|
||||||
dossiers = Dossier.en_cours.followed_by(self)
|
dossiers = case state
|
||||||
|
when :termine
|
||||||
|
Dossier.termine
|
||||||
|
when :not_archived
|
||||||
|
Dossier.not_archived
|
||||||
|
else
|
||||||
|
Dossier.en_cours
|
||||||
|
end.followed_by(self)
|
||||||
|
|
||||||
Dossier.where(id: dossiers_id_with_notifications(dossiers)).group(:procedure_id).count
|
Dossier.where(id: dossiers_id_with_notifications(dossiers)).group(:procedure_id).count
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,5 +2,18 @@ class Individual < ActiveRecord::Base
|
||||||
belongs_to :dossier
|
belongs_to :dossier
|
||||||
|
|
||||||
validates_uniqueness_of :dossier_id
|
validates_uniqueness_of :dossier_id
|
||||||
|
validates :gender, presence: true, allow_nil: false, on: :update
|
||||||
|
validates :nom, presence: true, allow_blank: false, allow_nil: false, on: :update
|
||||||
|
validates :prenom, presence: true, allow_blank: false, allow_nil: false, on: :update
|
||||||
validates :birthdate, format: { with: /\A\d{4}\-\d{2}\-\d{2}\z/, message: "La date n'est pas au format AAAA-MM-JJ" }, allow_nil: true
|
validates :birthdate, format: { with: /\A\d{4}\-\d{2}\-\d{2}\z/, message: "La date n'est pas au format AAAA-MM-JJ" }, allow_nil: true
|
||||||
|
|
||||||
|
before_validation :set_iso_date, if: -> { birthdate_changed? }
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def set_iso_date
|
||||||
|
if birthdate.present?
|
||||||
|
self.birthdate = Date.parse(birthdate).iso8601
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -50,7 +50,8 @@ class TypeDeChamp < ActiveRecord::Base
|
||||||
|
|
||||||
def params_for_champ
|
def params_for_champ
|
||||||
{
|
{
|
||||||
private: private?
|
private: private?,
|
||||||
|
type: "Champs::#{type_champ.classify}Champ"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -77,4 +78,8 @@ class TypeDeChamp < ActiveRecord::Base
|
||||||
def public?
|
def public?
|
||||||
!private?
|
!private?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.type_champ_to_class_name(type_champ)
|
||||||
|
"TypesDeChamp::#{type_champ.classify}TypeDeChamp"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,6 +18,10 @@ class TypesDeChampService
|
||||||
|
|
||||||
parameters[attributes].each do |index, param|
|
parameters[attributes].each do |index, param|
|
||||||
param[:private] = private
|
param[:private] = private
|
||||||
|
if param[:type_champ]
|
||||||
|
param[:type] = TypeDeChamp.type_champ_to_class_name(param[:type_champ])
|
||||||
|
end
|
||||||
|
|
||||||
if param[:libelle].empty?
|
if param[:libelle].empty?
|
||||||
parameters[attributes].delete(index.to_s)
|
parameters[attributes].delete(index.to_s)
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,10 +12,10 @@
|
||||||
|
|
||||||
- if @avis.gestionnaire.present?
|
- if @avis.gestionnaire.present?
|
||||||
%p
|
%p
|
||||||
= link_to "Connectez-vous pour donner votre avis", dossier_url(@avis.dossier.procedure, @avis.dossier)
|
= link_to "Connectez-vous pour donner votre avis", gestionnaire_dossier_url(@avis.dossier.procedure, @avis.dossier)
|
||||||
- else
|
- else
|
||||||
%p
|
%p
|
||||||
= link_to "Inscrivez-vous pour donner votre avis", sign_up_avis_url(@avis.id, @avis.email)
|
= link_to "Inscrivez-vous pour donner votre avis", sign_up_gestionnaire_avis_url(@avis.id, @avis.email)
|
||||||
|
|
||||||
Bonne journée,
|
Bonne journée,
|
||||||
%br
|
%br
|
||||||
|
|
|
@ -14,4 +14,4 @@
|
||||||
- if user_signed_in? && current_user == dossier.user
|
- if user_signed_in? && current_user == dossier.user
|
||||||
= link_to 'Télécharger', dossier_attestation_path(dossier), target: '_blank', class: 'btn btn-primary'
|
= link_to 'Télécharger', dossier_attestation_path(dossier), target: '_blank', class: 'btn btn-primary'
|
||||||
- else
|
- else
|
||||||
= link_to 'Télécharger', attestation_dossier_path(dossier.procedure, dossier), target: '_blank', class: 'btn btn-primary'
|
= link_to 'Télécharger', attestation_gestionnaire_dossier_path(dossier.procedure, dossier), target: '_blank', class: 'btn btn-primary'
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
- nav_bar_profile = controller.try(:nav_bar_profile)
|
||||||
|
|
||||||
.new-header{ class: current_page?(root_path) ? nil : "new-header-with-border" }
|
.new-header{ class: current_page?(root_path) ? nil : "new-header-with-border" }
|
||||||
.header-inner-content
|
.header-inner-content
|
||||||
|
|
||||||
|
@ -5,15 +7,15 @@
|
||||||
= link_to root_path, class: "header-logo" do
|
= link_to root_path, class: "header-logo" do
|
||||||
%img{ src: image_url("header/logo-tps.svg") }
|
%img{ src: image_url("header/logo-tps.svg") }
|
||||||
|
|
||||||
- if gestionnaire_signed_in?
|
- if nav_bar_profile == :gestionnaire && gestionnaire_signed_in?
|
||||||
- current_url = request.path_info
|
- current_url = request.path_info
|
||||||
%ul.header-tabs
|
%ul.header-tabs
|
||||||
- if current_gestionnaire.procedures.count > 0
|
- if current_gestionnaire.procedures.count > 0
|
||||||
%li
|
%li
|
||||||
= link_to "Procédures", procedures_path, class: (controller_name != 'avis') ? "tab-link active" : 'tab-link'
|
= link_to "Procédures", gestionnaire_procedures_path, class: (controller_name != 'avis') ? "tab-link active" : 'tab-link'
|
||||||
- if current_gestionnaire.avis.count > 0
|
- if current_gestionnaire.avis.count > 0
|
||||||
%li
|
%li
|
||||||
= link_to avis_index_path, class: (controller_name == 'avis') ? "tab-link active" : 'tab-link' do
|
= link_to gestionnaire_avis_index_path, class: (controller_name == 'avis') ? "tab-link active" : 'tab-link' do
|
||||||
Avis
|
Avis
|
||||||
- avis_counter = current_gestionnaire.avis.without_answer.count
|
- avis_counter = current_gestionnaire.avis.without_answer.count
|
||||||
- if avis_counter > 0
|
- if avis_counter > 0
|
||||||
|
@ -29,13 +31,15 @@
|
||||||
– par email : <a href="mailto:contact@tps.apientreprise.fr">contact@tps.apientreprise.fr</a>
|
– par email : <a href="mailto:contact@tps.apientreprise.fr">contact@tps.apientreprise.fr</a>
|
||||||
|
|
||||||
%ul.header-right-content
|
%ul.header-right-content
|
||||||
- if gestionnaire_signed_in?
|
- if nav_bar_profile == :gestionnaire && gestionnaire_signed_in?
|
||||||
%li
|
%li
|
||||||
.header-search
|
.header-search
|
||||||
= form_tag recherche_path, method: :get, class: "form" do
|
= form_tag gestionnaire_recherche_path, method: :get, class: "form" do
|
||||||
= text_field_tag "q", "#{@search_terms if @search_terms.present?}", placeholder: "Rechercher un dossier"
|
= text_field_tag "q", "#{@search_terms if @search_terms.present?}", placeholder: "Rechercher un dossier"
|
||||||
%button{ title: "Rechercher" }
|
%button{ title: "Rechercher" }
|
||||||
= image_tag "icons/search-blue.svg"
|
= image_tag "icons/search-blue.svg"
|
||||||
|
|
||||||
|
- if gestionnaire_signed_in? || user_signed_in?
|
||||||
%li
|
%li
|
||||||
.header-menu-opener
|
.header-menu-opener
|
||||||
= image_tag "icons/account-circle.svg", onclick: "javascript:TPS.toggleHeaderMenu(event);", title: "Mon compte"
|
= image_tag "icons/account-circle.svg", onclick: "javascript:TPS.toggleHeaderMenu(event);", title: "Mon compte"
|
||||||
|
@ -49,17 +53,17 @@
|
||||||
= image_tag "icons/super-admin.svg"
|
= image_tag "icons/super-admin.svg"
|
||||||
Passer en super-admin
|
Passer en super-admin
|
||||||
- if SwitchDeviseProfileService.new(warden).multiple_devise_profile_connect?
|
- if SwitchDeviseProfileService.new(warden).multiple_devise_profile_connect?
|
||||||
- if user_signed_in?
|
- if user_signed_in? && nav_bar_profile != :usager
|
||||||
%li
|
%li
|
||||||
= link_to users_dossiers_path, class: "menu-item menu-link" do
|
= link_to users_dossiers_path, class: "menu-item menu-link" do
|
||||||
= image_tag "icons/switch-profile.svg"
|
= image_tag "icons/switch-profile.svg"
|
||||||
Passer en usager
|
Passer en usager
|
||||||
- if gestionnaire_signed_in?
|
- if gestionnaire_signed_in? && nav_bar_profile != :gestionnaire
|
||||||
%li
|
%li
|
||||||
= link_to procedures_path, class: "menu-item menu-link" do
|
= link_to gestionnaire_procedures_path, class: "menu-item menu-link" do
|
||||||
= image_tag "icons/switch-profile.svg"
|
= image_tag "icons/switch-profile.svg"
|
||||||
Passer en accompagnateur
|
Passer en accompagnateur
|
||||||
- if administrateur_signed_in?
|
- if administrateur_signed_in? && nav_bar_profile != :administrateur
|
||||||
%li
|
%li
|
||||||
= link_to admin_procedures_path, class: "menu-item menu-link" do
|
= link_to admin_procedures_path, class: "menu-item menu-link" do
|
||||||
= image_tag "icons/switch-profile.svg"
|
= image_tag "icons/switch-profile.svg"
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
Usager
|
Usager
|
||||||
- if gestionnaire_signed_in?
|
- if gestionnaire_signed_in?
|
||||||
%li
|
%li
|
||||||
= link_to(procedures_path) do
|
= link_to(gestionnaire_procedures_path) do
|
||||||
%i.fa.fa-user
|
%i.fa.fa-user
|
||||||
|
|
||||||
Accompagnateur
|
Accompagnateur
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
.accompagnateur-header
|
.accompagnateur-header
|
||||||
.container
|
.container
|
||||||
%ul.breadcrumbs
|
%ul.breadcrumbs
|
||||||
%li= link_to('Avis', avis_index_path)
|
%li= link_to('Avis', gestionnaire_avis_index_path)
|
||||||
%li= "#{dossier.procedure.libelle}, dossier nº #{dossier.id}"
|
%li= "#{dossier.procedure.libelle}, dossier nº #{dossier.id}"
|
||||||
|
|
||||||
%ul.tabs
|
%ul.tabs
|
||||||
%li{ class: current_page?(avis_path(avis)) ? 'active' : nil }
|
%li{ class: current_page?(gestionnaire_avis_path(avis)) ? 'active' : nil }
|
||||||
= link_to 'Demande', avis_path(avis)
|
= link_to 'Demande', gestionnaire_avis_path(avis)
|
||||||
%li{ class: current_page?(instruction_avis_path(avis)) ? 'active' : nil }
|
%li{ class: current_page?(instruction_gestionnaire_avis_path(avis)) ? 'active' : nil }
|
||||||
= link_to 'Avis', instruction_avis_path(avis)
|
= link_to 'Avis', instruction_gestionnaire_avis_path(avis)
|
||||||
- if avis.answer == nil
|
- if avis.answer == nil
|
||||||
%span.notifications{ 'aria-label': 'notifications' }
|
%span.notifications{ 'aria-label': 'notifications' }
|
||||||
%li{ class: current_page?(messagerie_avis_path(avis)) ? 'active' : nil }
|
%li{ class: current_page?(messagerie_gestionnaire_avis_path(avis)) ? 'active' : nil }
|
||||||
= link_to 'Messagerie', messagerie_avis_path(avis)
|
= link_to 'Messagerie', messagerie_gestionnaire_avis_path(avis)
|
||||||
|
|
|
@ -7,14 +7,14 @@
|
||||||
%h1.tab-title Avis
|
%h1.tab-title Avis
|
||||||
%ul.tabs
|
%ul.tabs
|
||||||
%li{ class: (@statut == NewGestionnaire::AvisController::A_DONNER_STATUS) ? 'active' : nil }>
|
%li{ class: (@statut == NewGestionnaire::AvisController::A_DONNER_STATUS) ? 'active' : nil }>
|
||||||
= link_to(avis_index_path(statut: NewGestionnaire::AvisController::A_DONNER_STATUS)) do
|
= link_to(gestionnaire_avis_index_path(statut: NewGestionnaire::AvisController::A_DONNER_STATUS)) do
|
||||||
avis à donner
|
avis à donner
|
||||||
%span.badge= @avis_a_donner.count
|
%span.badge= @avis_a_donner.count
|
||||||
- if @avis_a_donner.any?
|
- if @avis_a_donner.any?
|
||||||
%span.notifications
|
%span.notifications
|
||||||
|
|
||||||
%li{ class: (@statut == NewGestionnaire::AvisController::DONNES_STATUS) ? 'active' : nil }>
|
%li{ class: (@statut == NewGestionnaire::AvisController::DONNES_STATUS) ? 'active' : nil }>
|
||||||
= link_to(avis_index_path(statut: NewGestionnaire::AvisController::DONNES_STATUS)) do
|
= link_to(gestionnaire_avis_index_path(statut: NewGestionnaire::AvisController::DONNES_STATUS)) do
|
||||||
avis #{'donné'.pluralize(@avis_donnes.count)}
|
avis #{'donné'.pluralize(@avis_donnes.count)}
|
||||||
%span.badge= @avis_donnes.count
|
%span.badge= @avis_donnes.count
|
||||||
|
|
||||||
|
@ -30,11 +30,11 @@
|
||||||
- @avis.each do |avis|
|
- @avis.each do |avis|
|
||||||
%tr
|
%tr
|
||||||
%td.number-col
|
%td.number-col
|
||||||
= link_to(avis_path(avis), class: 'cell-link') do
|
= link_to(gestionnaire_avis_path(avis), class: 'cell-link') do
|
||||||
%span.icon.folder
|
%span.icon.folder
|
||||||
#{avis.dossier.id}
|
#{avis.dossier.id}
|
||||||
%td= link_to(avis.dossier.user.email, avis_path(avis), class: 'cell-link')
|
%td= link_to(avis.dossier.user.email, gestionnaire_avis_path(avis), class: 'cell-link')
|
||||||
%td= link_to(avis.dossier.procedure.libelle, avis_path(avis), class: 'cell-link')
|
%td= link_to(avis.dossier.procedure.libelle, gestionnaire_avis_path(avis), class: 'cell-link')
|
||||||
= paginate(@avis)
|
= paginate(@avis)
|
||||||
- else
|
- else
|
||||||
%h2.empty-text Aucun avis
|
%h2.empty-text Aucun avis
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
%span.date Demande d'avis envoyée le #{I18n.l(@avis.created_at.localtime, format: '%d/%m/%y')}
|
%span.date Demande d'avis envoyée le #{I18n.l(@avis.created_at.localtime, format: '%d/%m/%y')}
|
||||||
%p.introduction= @avis.introduction
|
%p.introduction= @avis.introduction
|
||||||
|
|
||||||
= form_for @avis, url: avis_path(@avis), html: { class: 'form' } do |f|
|
= form_for @avis, url: gestionnaire_avis_path(@avis), html: { class: 'form' } do |f|
|
||||||
= f.text_area :answer, rows: 3, placeholder: 'Votre avis', required: true
|
= f.text_area :answer, rows: 3, placeholder: 'Votre avis', required: true
|
||||||
.flex.justify-between.align-baseline
|
.flex.justify-between.align-baseline
|
||||||
%p.confidentiel.flex
|
%p.confidentiel.flex
|
||||||
|
@ -21,6 +21,6 @@
|
||||||
.send-wrapper
|
.send-wrapper
|
||||||
= f.submit 'Envoyer votre avis', class: 'button send'
|
= f.submit 'Envoyer votre avis', class: 'button send'
|
||||||
|
|
||||||
= render partial: "new_gestionnaire/shared/avis/form", locals: { url: avis_avis_path(@avis), must_be_confidentiel: @avis.confidentiel? }
|
= render partial: "new_gestionnaire/shared/avis/form", locals: { url: avis_gestionnaire_avis_path(@avis), must_be_confidentiel: @avis.confidentiel? }
|
||||||
|
|
||||||
= render partial: 'new_gestionnaire/shared/avis/list', locals: { avis: @dossier.avis_for(current_gestionnaire), avis_seen_at: nil }
|
= render partial: 'new_gestionnaire/shared/avis/list', locals: { avis: @dossier.avis_for(current_gestionnaire), avis_seen_at: nil }
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
= render partial: 'header', locals: { avis: @avis, dossier: @dossier }
|
= render partial: 'header', locals: { avis: @avis, dossier: @dossier }
|
||||||
|
|
||||||
= render partial: "new_gestionnaire/shared/messagerie", locals: { dossier: @dossier, messagerie_seen_at: nil, new_commentaire: @commentaire, form_url: commentaire_avis_path(@avis) }
|
= render partial: "new_gestionnaire/shared/messagerie", locals: { dossier: @dossier, messagerie_seen_at: nil, new_commentaire: @commentaire, form_url: commentaire_gestionnaire_avis_path(@avis) }
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
%p.tab-paragraph
|
%p.tab-paragraph
|
||||||
Vous êtes le seul accompagnateur assigné sur cette procédure
|
Vous êtes le seul accompagnateur assigné sur cette procédure
|
||||||
- else
|
- else
|
||||||
= form_for dossier, url: envoyer_a_accompagnateur_dossier_path(dossier.procedure, dossier), method: :post, html: { class: 'form' } do |f|
|
= form_for dossier, url: envoyer_a_accompagnateur_gestionnaire_dossier_path(dossier.procedure, dossier), method: :post, html: { class: 'form' } do |f|
|
||||||
.flex.justify-start.align-baseline
|
.flex.justify-start.align-baseline
|
||||||
= select_tag(:recipient, options_from_collection_for_select(potential_recipients, :id, :email))
|
= select_tag(:recipient, options_from_collection_for_select(potential_recipients, :id, :email))
|
||||||
= f.submit "Envoyer", class: "button large send gap-left"
|
= f.submit "Envoyer", class: "button large send gap-left"
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
.flex.justify-between
|
.flex.justify-between
|
||||||
%ul.breadcrumbs
|
%ul.breadcrumbs
|
||||||
%li
|
%li
|
||||||
= link_to dossier.procedure.libelle.truncate_words(10), procedure_path(dossier.procedure), title: dossier.procedure.libelle
|
= link_to dossier.procedure.libelle.truncate_words(10), gestionnaire_procedure_path(dossier.procedure), title: dossier.procedure.libelle
|
||||||
%li
|
%li
|
||||||
= "Dossier nº #{dossier.id}"
|
= "Dossier nº #{dossier.id}"
|
||||||
.mixed-buttons-bar
|
.mixed-buttons-bar
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
%span.icon.printer
|
%span.icon.printer
|
||||||
%ul.print-menu
|
%ul.print-menu
|
||||||
%li
|
%li
|
||||||
= link_to "Tout le dossier", print_dossier_path(dossier.procedure, dossier), target: "_blank", class: "menu-item menu-link"
|
= link_to "Tout le dossier", print_gestionnaire_dossier_path(dossier.procedure, dossier), target: "_blank", class: "menu-item menu-link"
|
||||||
%li
|
%li
|
||||||
= link_to "Uniquement cet onglet", "#", onclick: "TPS.togglePrintMenu; window.print()", class: "menu-item menu-link"
|
= link_to "Uniquement cet onglet", "#", onclick: "TPS.togglePrintMenu; window.print()", class: "menu-item menu-link"
|
||||||
|
|
||||||
|
@ -19,24 +19,24 @@
|
||||||
= render partial: "state_button", locals: { dossier: dossier }
|
= render partial: "state_button", locals: { dossier: dossier }
|
||||||
%ul.tabs
|
%ul.tabs
|
||||||
- notifications_summary = current_gestionnaire.notifications_for_dossier(dossier)
|
- notifications_summary = current_gestionnaire.notifications_for_dossier(dossier)
|
||||||
%li{ class: current_page?(dossier_path(dossier.procedure, dossier)) ? 'active' : nil }
|
%li{ class: current_page?(gestionnaire_dossier_path(dossier.procedure, dossier)) ? 'active' : nil }
|
||||||
- if notifications_summary[:demande]
|
- if notifications_summary[:demande]
|
||||||
%span.notifications{ 'aria-label': 'notifications' }
|
%span.notifications{ 'aria-label': 'notifications' }
|
||||||
= link_to "Demande", dossier_path(dossier.procedure, dossier)
|
= link_to "Demande", gestionnaire_dossier_path(dossier.procedure, dossier)
|
||||||
%li{ class: current_page?(annotations_privees_dossier_path(dossier.procedure, dossier)) ? 'active' : nil }
|
%li{ class: current_page?(annotations_privees_gestionnaire_dossier_path(dossier.procedure, dossier)) ? 'active' : nil }
|
||||||
- if notifications_summary[:annotations_privees]
|
- if notifications_summary[:annotations_privees]
|
||||||
%span.notifications{ 'aria-label': 'notifications' }
|
%span.notifications{ 'aria-label': 'notifications' }
|
||||||
= link_to "Annotations privées", annotations_privees_dossier_path(dossier.procedure, dossier)
|
= link_to "Annotations privées", annotations_privees_gestionnaire_dossier_path(dossier.procedure, dossier)
|
||||||
%li{ class: current_page?(avis_dossier_path(dossier.procedure, dossier)) ? 'active' : nil }
|
%li{ class: current_page?(avis_gestionnaire_dossier_path(dossier.procedure, dossier)) ? 'active' : nil }
|
||||||
- if notifications_summary[:avis]
|
- if notifications_summary[:avis]
|
||||||
%span.notifications{ 'aria-label': 'notifications' }
|
%span.notifications{ 'aria-label': 'notifications' }
|
||||||
= link_to "Avis externes", avis_dossier_path(dossier.procedure, dossier)
|
= link_to "Avis externes", avis_gestionnaire_dossier_path(dossier.procedure, dossier)
|
||||||
%li{ class: current_page?(messagerie_dossier_path(dossier.procedure, dossier)) ? 'active' : nil }
|
%li{ class: current_page?(messagerie_gestionnaire_dossier_path(dossier.procedure, dossier)) ? 'active' : nil }
|
||||||
- if notifications_summary[:messagerie]
|
- if notifications_summary[:messagerie]
|
||||||
%span.notifications{ 'aria-label': 'notifications' }
|
%span.notifications{ 'aria-label': 'notifications' }
|
||||||
= link_to "Messagerie", messagerie_dossier_path(dossier.procedure, dossier)
|
= link_to "Messagerie", messagerie_gestionnaire_dossier_path(dossier.procedure, dossier)
|
||||||
%li{ class: current_page?(personnes_impliquees_dossier_path(dossier.procedure, dossier)) ? 'active' : nil }
|
%li{ class: current_page?(personnes_impliquees_gestionnaire_dossier_path(dossier.procedure, dossier)) ? 'active' : nil }
|
||||||
= link_to "Personnes impliquées", personnes_impliquees_dossier_path(dossier.procedure, dossier)
|
= link_to "Personnes impliquées", personnes_impliquees_gestionnaire_dossier_path(dossier.procedure, dossier)
|
||||||
|
|
||||||
.container
|
.container
|
||||||
.print-header
|
.print-header
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
= "Parcelle n° #{p.numero} - Feuille #{p.code_arr} #{p.section} #{p.feuille}"
|
= "Parcelle n° #{p.numero} - Feuille #{p.code_arr} #{p.section} #{p.feuille}"
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
var getPositionUrl = "#{position_dossier_path(dossier.procedure, dossier)}";
|
var getPositionUrl = "#{position_gestionnaire_dossier_path(dossier.procedure, dossier)}";
|
||||||
var dossierJsonLatLngs = #{dossier.json_latlngs};
|
var dossierJsonLatLngs = #{dossier.json_latlngs};
|
||||||
var dossierCadastres = #{dossier.cadastres.to_json};
|
var dossierCadastres = #{dossier.cadastres.to_json};
|
||||||
var dossierQuartiersPrioritaires = #{dossier.quartier_prioritaires.to_json};
|
var dossierQuartiersPrioritaires = #{dossier.quartier_prioritaires.to_json};
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
%h4 En construction
|
%h4 En construction
|
||||||
Vous permettez à l'usager de modifier ses réponses au formulaire
|
Vous permettez à l'usager de modifier ses réponses au formulaire
|
||||||
%li
|
%li
|
||||||
= link_to passer_en_instruction_dossier_path(dossier.procedure, dossier), method: :post, data: { confirm: "Confirmer vous le passage en instruction de ce dossier ?" } do
|
= link_to passer_en_instruction_gestionnaire_dossier_path(dossier.procedure, dossier), method: :post, data: { confirm: "Confirmer vous le passage en instruction de ce dossier ?" } do
|
||||||
%span.icon.in-progress
|
%span.icon.in-progress
|
||||||
.description
|
.description
|
||||||
%h4 Passer en instruction
|
%h4 Passer en instruction
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
- if dossier.en_instruction?
|
- if dossier.en_instruction?
|
||||||
%li
|
%li
|
||||||
= link_to repasser_en_construction_dossier_path(dossier.procedure, dossier), method: :post, data: { confirm: "Confirmer vous le passage en construction de ce dossier ?" } do
|
= link_to repasser_en_construction_gestionnaire_dossier_path(dossier.procedure, dossier), method: :post, data: { confirm: "Confirmer vous le passage en construction de ce dossier ?" } do
|
||||||
%span.icon.edit
|
%span.icon.edit
|
||||||
.description
|
.description
|
||||||
%h4 Repasser en construction
|
%h4 Repasser en construction
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
- if dossier.attestation.present?
|
- if dossier.attestation.present?
|
||||||
%h4 Attestation
|
%h4 Attestation
|
||||||
%p.attestation L'acceptation du dossier a envoyé automatiquement une attestation au demandeur
|
%p.attestation L'acceptation du dossier a envoyé automatiquement une attestation au demandeur
|
||||||
= link_to "Voir l'attestation", attestation_dossier_path(dossier.procedure, dossier), target: '_blank', class: 'button'
|
= link_to "Voir l'attestation", attestation_gestionnaire_dossier_path(dossier.procedure, dossier), target: '_blank', class: 'button'
|
||||||
- else
|
- else
|
||||||
%span.label{ class: button_or_label_class(dossier) }
|
%span.label{ class: button_or_label_class(dossier) }
|
||||||
= dossier.statut
|
= dossier.statut
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
%span.icon{ class: popup_class }
|
%span.icon{ class: popup_class }
|
||||||
#{popup_title}
|
#{popup_title}
|
||||||
|
|
||||||
= form_tag(terminer_dossier_path(dossier.procedure, dossier), method: :post, class: 'form') do
|
= form_tag(terminer_gestionnaire_dossier_path(dossier.procedure, dossier), method: :post, class: 'form') do
|
||||||
= text_area :dossier, :motivation, class: 'motivation-text-area', placeholder: 'Rédigez votre motivation ici (facultative)'
|
= text_area :dossier, :motivation, class: 'motivation-text-area', placeholder: 'Rédigez votre motivation ici (facultative)'
|
||||||
- if title == 'Accepter'
|
- if title == 'Accepter'
|
||||||
%p.help
|
%p.help
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#dossier-annotations-privees.container
|
#dossier-annotations-privees.container
|
||||||
- if @dossier.ordered_champs_private.present?
|
- if @dossier.ordered_champs_private.present?
|
||||||
%section
|
%section
|
||||||
= form_for @dossier, url: annotations_dossier_path(@dossier.procedure, @dossier), html: { class: 'form' } do |f|
|
= form_for @dossier, url: annotations_gestionnaire_dossier_path(@dossier.procedure, @dossier), html: { class: 'form' } do |f|
|
||||||
= f.fields_for :champs_private, f.object.ordered_champs_private do |champ_form|
|
= f.fields_for :champs_private, f.object.ordered_champs_private do |champ_form|
|
||||||
- champ = champ_form.object
|
- champ = champ_form.object
|
||||||
= render partial: "new_gestionnaire/dossiers/editable_champs/editable_champ",
|
= render partial: "new_gestionnaire/dossiers/editable_champs/editable_champ",
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
= render partial: "header", locals: { dossier: @dossier }
|
= render partial: "header", locals: { dossier: @dossier }
|
||||||
|
|
||||||
.container
|
.container
|
||||||
= render partial: "new_gestionnaire/shared/avis/form", locals: { url: avis_dossier_path(@dossier.procedure, @dossier), must_be_confidentiel: false }
|
= render partial: "new_gestionnaire/shared/avis/form", locals: { url: avis_gestionnaire_dossier_path(@dossier.procedure, @dossier), must_be_confidentiel: false }
|
||||||
|
|
||||||
= render partial: 'new_gestionnaire/shared/avis/list', locals: { avis: @dossier.avis, avis_seen_at: @avis_seen_at }
|
= render partial: 'new_gestionnaire/shared/avis/list', locals: { avis: @dossier.avis, avis_seen_at: @avis_seen_at }
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
= render partial: "header", locals: { dossier: @dossier }
|
= render partial: "header", locals: { dossier: @dossier }
|
||||||
|
|
||||||
= render partial: "new_gestionnaire/shared/messagerie", locals: { dossier: @dossier, messagerie_seen_at: @messagerie_seen_at , new_commentaire: @commentaire, form_url: commentaire_dossier_path(@dossier.procedure, @dossier) }
|
= render partial: "new_gestionnaire/shared/messagerie", locals: { dossier: @dossier, messagerie_seen_at: @messagerie_seen_at , new_commentaire: @commentaire, form_url: commentaire_gestionnaire_dossier_path(@dossier.procedure, @dossier) }
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
- if dossier.en_construction_ou_instruction?
|
- if dossier.en_construction_ou_instruction?
|
||||||
- if dossier_is_followed
|
- if dossier_is_followed
|
||||||
= link_to unfollow_dossier_path(procedure, dossier), method: :patch, class: 'button' do
|
= link_to unfollow_gestionnaire_dossier_path(procedure, dossier), method: :patch, class: 'button' do
|
||||||
%span.icon.unfollow>
|
%span.icon.unfollow>
|
||||||
Ne plus suivre
|
Ne plus suivre
|
||||||
- else
|
- else
|
||||||
= link_to follow_dossier_path(procedure, dossier), method: :patch, class: 'button' do
|
= link_to follow_gestionnaire_dossier_path(procedure, dossier), method: :patch, class: 'button' do
|
||||||
%span.icon.follow>
|
%span.icon.follow>
|
||||||
Suivre le dossier
|
Suivre le dossier
|
||||||
|
|
||||||
- elsif dossier.termine?
|
- elsif dossier.termine?
|
||||||
- if dossier.archived
|
- if dossier.archived
|
||||||
= link_to unarchive_dossier_path(procedure, dossier), method: :patch, class: 'button' do
|
= link_to unarchive_gestionnaire_dossier_path(procedure, dossier), method: :patch, class: 'button' do
|
||||||
%span.icon.unarchive>
|
%span.icon.unarchive>
|
||||||
Désarchiver le dossier
|
Désarchiver le dossier
|
||||||
- else
|
- else
|
||||||
= link_to archive_dossier_path(procedure, dossier), method: :patch, class: 'button' do
|
= link_to archive_gestionnaire_dossier_path(procedure, dossier), method: :patch, class: 'button' do
|
||||||
%span.icon.archive>
|
%span.icon.archive>
|
||||||
Archiver le dossier
|
Archiver le dossier
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
.dropdown-content.fade-in-down
|
.dropdown-content.fade-in-down
|
||||||
%ul.dropdown-items
|
%ul.dropdown-items
|
||||||
%li
|
%li
|
||||||
= link_to "Au format .csv", download_dossiers_procedure_path(format: :csv, procedure_id: procedure.id), target: "_blank"
|
= link_to "Au format .csv", download_dossiers_gestionnaire_procedure_path(format: :csv, procedure_id: procedure.id), target: "_blank"
|
||||||
%li
|
%li
|
||||||
= link_to "Au format .xlsx", download_dossiers_procedure_path(format: :xlsx, procedure_id: procedure.id), target: "_blank"
|
= link_to "Au format .xlsx", download_dossiers_gestionnaire_procedure_path(format: :xlsx, procedure_id: procedure.id), target: "_blank"
|
||||||
%li
|
%li
|
||||||
= link_to "Au format .ods", download_dossiers_procedure_path(format: :ods, procedure_id: procedure.id), target: "_blank"
|
= link_to "Au format .ods", download_dossiers_gestionnaire_procedure_path(format: :ods, procedure_id: procedure.id), target: "_blank"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%th{ class: classname }
|
%th{ class: classname }
|
||||||
= link_to update_sort_procedure_path(@procedure, table: field['table'], column: field['column']) do
|
= link_to update_sort_gestionnaire_procedure_path(@procedure, table: field['table'], column: field['column']) do
|
||||||
= field['label']
|
= field['label']
|
||||||
- if @procedure_presentation.sort['table'] == field['table'] && @procedure_presentation.sort['column'] == field['column']
|
- if @procedure_presentation.sort['table'] == field['table'] && @procedure_presentation.sort['column'] == field['column']
|
||||||
- if @procedure_presentation.sort['order'] == 'asc'
|
- if @procedure_presentation.sort['order'] == 'asc'
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
%ul.procedure-list
|
%ul.procedure-list
|
||||||
- @procedures.each do |p|
|
- @procedures.each do |p|
|
||||||
%li.procedure-item.flex.align-start
|
%li.procedure-item.flex.align-start
|
||||||
= link_to(procedure_path(p)) do
|
= link_to(gestionnaire_procedure_path(p)) do
|
||||||
.flex
|
.flex
|
||||||
|
|
||||||
.procedure-logo{ style: p.logo.present? ? "background-image: url(#{p.logo.url})" : nil }
|
.procedure-logo{ style: p.logo.present? ? "background-image: url(#{p.logo.url})" : nil }
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
%ul.procedure-stats.flex
|
%ul.procedure-stats.flex
|
||||||
%li
|
%li
|
||||||
%object
|
%object
|
||||||
= link_to(procedure_path(p, statut: 'a-suivre')) do
|
= link_to(gestionnaire_procedure_path(p, statut: 'a-suivre')) do
|
||||||
- a_suivre_count = @dossiers_a_suivre_count_per_procedure[p.id] || 0
|
- a_suivre_count = @dossiers_a_suivre_count_per_procedure[p.id] || 0
|
||||||
.stats-number
|
.stats-number
|
||||||
= a_suivre_count
|
= a_suivre_count
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
à suivre
|
à suivre
|
||||||
%li
|
%li
|
||||||
%object
|
%object
|
||||||
= link_to(procedure_path(p, statut: 'suivis')) do
|
= link_to(gestionnaire_procedure_path(p, statut: 'suivis')) do
|
||||||
- if current_gestionnaire.notifications_per_procedure[p.id].present?
|
- if current_gestionnaire.notifications_per_procedure[p.id].present?
|
||||||
%span.notifications{ 'aria-label': "notifications" }
|
%span.notifications{ 'aria-label': "notifications" }
|
||||||
- followed_count = @followed_dossiers_count_per_procedure[p.id] || 0
|
- followed_count = @followed_dossiers_count_per_procedure[p.id] || 0
|
||||||
|
@ -36,7 +36,9 @@
|
||||||
= t('pluralize.followed', count: followed_count)
|
= t('pluralize.followed', count: followed_count)
|
||||||
%li
|
%li
|
||||||
%object
|
%object
|
||||||
= link_to(procedure_path(p, statut: 'traites')) do
|
= link_to(gestionnaire_procedure_path(p, statut: 'traites')) do
|
||||||
|
- if current_gestionnaire.notifications_per_procedure(:termine)[p.id].present?
|
||||||
|
%span.notifications{ 'aria-label': "notifications" }
|
||||||
- termines_count = @dossiers_termines_count_per_procedure[p.id] || 0
|
- termines_count = @dossiers_termines_count_per_procedure[p.id] || 0
|
||||||
.stats-number
|
.stats-number
|
||||||
= termines_count
|
= termines_count
|
||||||
|
@ -44,7 +46,7 @@
|
||||||
= t('pluralize.processed', count: termines_count)
|
= t('pluralize.processed', count: termines_count)
|
||||||
%li
|
%li
|
||||||
%object
|
%object
|
||||||
= link_to(procedure_path(p, statut: 'tous')) do
|
= link_to(gestionnaire_procedure_path(p, statut: 'tous')) do
|
||||||
- dossier_count = @dossiers_count_per_procedure[p.id] || 0
|
- dossier_count = @dossiers_count_per_procedure[p.id] || 0
|
||||||
.stats-number
|
.stats-number
|
||||||
= dossier_count
|
= dossier_count
|
||||||
|
@ -52,7 +54,7 @@
|
||||||
= t('pluralize.case', count: dossier_count)
|
= t('pluralize.case', count: dossier_count)
|
||||||
%li
|
%li
|
||||||
%object
|
%object
|
||||||
= link_to(procedure_path(p, statut: 'archives')) do
|
= link_to(gestionnaire_procedure_path(p, statut: 'archives')) do
|
||||||
- archived_count = @dossiers_archived_count_per_procedure[p.id] || 0
|
- archived_count = @dossiers_archived_count_per_procedure[p.id] || 0
|
||||||
.stats-number
|
.stats-number
|
||||||
= archived_count
|
= archived_count
|
||||||
|
|
|
@ -11,31 +11,31 @@
|
||||||
%h1= @procedure.libelle
|
%h1= @procedure.libelle
|
||||||
%ul.tabs
|
%ul.tabs
|
||||||
%li{ class: (@statut == 'a-suivre') ? 'active' : nil }>
|
%li{ class: (@statut == 'a-suivre') ? 'active' : nil }>
|
||||||
= link_to(procedure_path(@procedure, statut: 'a-suivre')) do
|
= link_to(gestionnaire_procedure_path(@procedure, statut: 'a-suivre')) do
|
||||||
à suivre
|
à suivre
|
||||||
%span.badge= @a_suivre_dossiers.count
|
%span.badge= @a_suivre_dossiers.count
|
||||||
|
|
||||||
%li{ class: (@statut == 'suivis') ? 'active' : nil }>
|
%li{ class: (@statut == 'suivis') ? 'active' : nil }>
|
||||||
- if current_gestionnaire.notifications_for_procedure(@procedure).present?
|
- if current_gestionnaire.notifications_for_procedure(@procedure).present?
|
||||||
%span.notifications{ 'aria-label': 'notifications' }
|
%span.notifications{ 'aria-label': 'notifications' }
|
||||||
= link_to(procedure_path(@procedure, statut: 'suivis')) do
|
= link_to(gestionnaire_procedure_path(@procedure, statut: 'suivis')) do
|
||||||
= t('pluralize.followed', count: @followed_dossiers.count)
|
= t('pluralize.followed', count: @followed_dossiers.count)
|
||||||
%span.badge= @followed_dossiers.count
|
%span.badge= @followed_dossiers.count
|
||||||
|
|
||||||
%li{ class: (@statut == 'traites') ? 'active' : nil }>
|
%li{ class: (@statut == 'traites') ? 'active' : nil }>
|
||||||
= link_to(procedure_path(@procedure, statut: 'traites')) do
|
- if current_gestionnaire.notifications_for_procedure(@procedure, :termine).present?
|
||||||
|
%span.notifications{ 'aria-label': 'notifications' }
|
||||||
|
= link_to(gestionnaire_procedure_path(@procedure, statut: 'traites')) do
|
||||||
= t('pluralize.processed', count: @termines_dossiers.count)
|
= t('pluralize.processed', count: @termines_dossiers.count)
|
||||||
%span.badge= @termines_dossiers.count
|
%span.badge= @termines_dossiers.count
|
||||||
|
|
||||||
%li{ class: (@statut == 'tous') ? 'active' : nil }>
|
%li{ class: (@statut == 'tous') ? 'active' : nil }>
|
||||||
- if current_gestionnaire.notifications_for_procedure(@procedure).present?
|
= link_to(gestionnaire_procedure_path(@procedure, statut: 'tous')) do
|
||||||
%span.notifications{ 'aria-label': 'notifications' }
|
|
||||||
= link_to(procedure_path(@procedure, statut: 'tous')) do
|
|
||||||
tous les dossiers
|
tous les dossiers
|
||||||
%span.badge= @all_state_dossiers.count
|
%span.badge= @all_state_dossiers.count
|
||||||
|
|
||||||
%li{ class: (@statut == 'archives') ? 'active' : nil }>
|
%li{ class: (@statut == 'archives') ? 'active' : nil }>
|
||||||
= link_to(procedure_path(@procedure, statut: 'archives')) do
|
= link_to(gestionnaire_procedure_path(@procedure, statut: 'archives')) do
|
||||||
= t('pluralize.archived', count: @archived_dossiers.count)
|
= t('pluralize.archived', count: @archived_dossiers.count)
|
||||||
%span.badge= @archived_dossiers.count
|
%span.badge= @archived_dossiers.count
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
%span.button.dropdown
|
%span.button.dropdown
|
||||||
Filtrer
|
Filtrer
|
||||||
.dropdown-content.left-aligned.fade-in-down
|
.dropdown-content.left-aligned.fade-in-down
|
||||||
= form_tag add_filter_procedure_path(@procedure), method: :post, class: 'dropdown-form large' do
|
= form_tag add_filter_gestionnaire_procedure_path(@procedure), method: :post, class: 'dropdown-form large' do
|
||||||
= label_tag :field, "Colonne"
|
= label_tag :field, "Colonne"
|
||||||
= select_tag :field, options_for_select(@available_fields_to_filters)
|
= select_tag :field, options_for_select(@available_fields_to_filters)
|
||||||
%br
|
%br
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
- @current_filters.each do |filter|
|
- @current_filters.each do |filter|
|
||||||
%span.filter
|
%span.filter
|
||||||
= "#{filter['label']} : #{filter['value']}"
|
= "#{filter['label']} : #{filter['value']}"
|
||||||
= link_to remove_filter_procedure_path(@procedure, statut: @statut, table: filter['table'], column: filter['column']) do
|
= link_to remove_filter_gestionnaire_procedure_path(@procedure, statut: @statut, table: filter['table'], column: filter['column']) do
|
||||||
%img.close-icon{ src: image_url("close.svg") }
|
%img.close-icon{ src: image_url("close.svg") }
|
||||||
|
|
||||||
%table.table.dossiers-table.hoverable
|
%table.table.dossiers-table.hoverable
|
||||||
|
@ -82,7 +82,7 @@
|
||||||
%span.button.dropdown
|
%span.button.dropdown
|
||||||
Personnaliser
|
Personnaliser
|
||||||
.dropdown-content.fade-in-down
|
.dropdown-content.fade-in-down
|
||||||
= form_tag update_displayed_fields_procedure_path(@procedure), method: :patch, class: 'dropdown-form' do
|
= form_tag update_displayed_fields_gestionnaire_procedure_path(@procedure), method: :patch, class: 'dropdown-form' do
|
||||||
= select_tag :values,
|
= select_tag :values,
|
||||||
options_for_select(@procedure.fields_for_select,
|
options_for_select(@procedure.fields_for_select,
|
||||||
selected: @displayed_fields_values),
|
selected: @displayed_fields_values),
|
||||||
|
@ -94,22 +94,22 @@
|
||||||
- @dossiers.each do |dossier|
|
- @dossiers.each do |dossier|
|
||||||
%tr
|
%tr
|
||||||
%td.folder-col
|
%td.folder-col
|
||||||
= link_to(dossier_path(@procedure, dossier), class: 'cell-link') do
|
= link_to(gestionnaire_dossier_path(@procedure, dossier), class: 'cell-link') do
|
||||||
%span.icon.folder
|
%span.icon.folder
|
||||||
- if current_gestionnaire.notifications_for_procedure(@procedure).include?(dossier.id)
|
- if current_gestionnaire.notifications_for_procedure(@procedure, :not_archived).include?(dossier.id)
|
||||||
%span.notifications{ 'aria-label': 'notifications' }
|
%span.notifications{ 'aria-label': 'notifications' }
|
||||||
|
|
||||||
%td.number-col
|
%td.number-col
|
||||||
= link_to(dossier_path(@procedure, dossier), class: 'cell-link') do
|
= link_to(gestionnaire_dossier_path(@procedure, dossier), class: 'cell-link') do
|
||||||
= dossier.id
|
= dossier.id
|
||||||
|
|
||||||
- @displayed_fields.each do |field|
|
- @displayed_fields.each do |field|
|
||||||
%td
|
%td
|
||||||
= link_to(dossier_path(@procedure, dossier), class: 'cell-link') do
|
= link_to(gestionnaire_dossier_path(@procedure, dossier), class: 'cell-link') do
|
||||||
= dossier.get_value(field['table'], field['column'])
|
= dossier.get_value(field['table'], field['column'])
|
||||||
|
|
||||||
%td.status-col
|
%td.status-col
|
||||||
= link_to(dossier_path(@procedure, dossier), class: 'cell-link') do
|
= link_to(gestionnaire_dossier_path(@procedure, dossier), class: 'cell-link') do
|
||||||
= render partial: 'status', locals: { dossier: dossier }
|
= render partial: 'status', locals: { dossier: dossier }
|
||||||
%td.follow-col= render partial: 'dossier_actions', locals: { procedure: @procedure, dossier: dossier, dossier_is_followed: @followed_dossiers_id.include?(dossier.id) }
|
%td.follow-col= render partial: 'dossier_actions', locals: { procedure: @procedure, dossier: dossier, dossier_is_followed: @followed_dossiers_id.include?(dossier.id) }
|
||||||
= paginate @dossiers
|
= paginate @dossiers
|
||||||
|
|
45
app/views/new_user/dossiers/identite.html.haml
Normal file
45
app/views/new_user/dossiers/identite.html.haml
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
.two-columns
|
||||||
|
.columns-container
|
||||||
|
.column.preview
|
||||||
|
.procedure-logos
|
||||||
|
= image_tag @dossier.procedure.decorate.logo_img
|
||||||
|
- if @dossier.procedure.euro_flag
|
||||||
|
= image_tag "flag_of_europe.svg"
|
||||||
|
|
||||||
|
%h2.procedure-title
|
||||||
|
= @dossier.procedure.libelle
|
||||||
|
%p.procedure-description
|
||||||
|
= h sanitize(@dossier.procedure.description)
|
||||||
|
|
||||||
|
.column
|
||||||
|
= form_for @dossier.individual, url: update_identite_dossier_path(@dossier), html: { class: "form" } do |f|
|
||||||
|
%h1 Données d'identité
|
||||||
|
|
||||||
|
%p.mb-1 Merci de remplir vos informations personnelles pour accéder à la démarche.
|
||||||
|
|
||||||
|
%label
|
||||||
|
%span.mandatory *
|
||||||
|
champs requis
|
||||||
|
|
||||||
|
= f.label :gender, class: "required"
|
||||||
|
= f.select :gender, ['M.', 'Mme'], {}, class: "small"
|
||||||
|
|
||||||
|
.flex
|
||||||
|
.inline-champ
|
||||||
|
= f.label :prenom, class: "required"
|
||||||
|
= f.text_field :prenom, class: "small", required: true
|
||||||
|
.inline-champ
|
||||||
|
= f.label :nom, class: "required"
|
||||||
|
= f.text_field :nom, class: "small", required: true
|
||||||
|
|
||||||
|
- if @dossier.procedure.ask_birthday?
|
||||||
|
= f.label :birthdate, class: "required"
|
||||||
|
= f.date_field :birthdate, value: @dossier.individual.birthdate, placeholder: 'format : AAAA-MM-JJ', required: true, class: "small"
|
||||||
|
|
||||||
|
= fields_for :dossier, @dossier do |df|
|
||||||
|
= label_tag do
|
||||||
|
= df.check_box :autorisation_donnees, required: true
|
||||||
|
J'accepte
|
||||||
|
= link_to "les CGU", CGU_URL, target: :blank
|
||||||
|
|
||||||
|
= f.submit "Continuer", class: "button large primary expand"
|
|
@ -15,7 +15,7 @@ ActiveSupport::Inflector.inflections(:en) do |inflect|
|
||||||
inflect.irregular 'type_de_champ', 'types_de_champ'
|
inflect.irregular 'type_de_champ', 'types_de_champ'
|
||||||
inflect.irregular 'type_de_champ_private', 'types_de_champ_private'
|
inflect.irregular 'type_de_champ_private', 'types_de_champ_private'
|
||||||
inflect.irregular 'assign_to', 'assign_tos'
|
inflect.irregular 'assign_to', 'assign_tos'
|
||||||
inflect.irregular('avis', 'avis')
|
inflect.uncountable(['avis', 'pays'])
|
||||||
end
|
end
|
||||||
|
|
||||||
# From https://github.com/davidcelis/inflections
|
# From https://github.com/davidcelis/inflections
|
||||||
|
|
|
@ -14,6 +14,7 @@ fr:
|
||||||
accepte: "Accepté"
|
accepte: "Accepté"
|
||||||
refuse: "Refusé"
|
refuse: "Refusé"
|
||||||
sans_suite: "Sans suite"
|
sans_suite: "Sans suite"
|
||||||
|
autorisation_donnees: Acceptation des CGU
|
||||||
|
|
||||||
errors:
|
errors:
|
||||||
models:
|
models:
|
||||||
|
|
|
@ -2,6 +2,7 @@ fr:
|
||||||
activerecord:
|
activerecord:
|
||||||
attributes:
|
attributes:
|
||||||
individual:
|
individual:
|
||||||
|
gender: Civilité
|
||||||
nom: Nom
|
nom: Nom
|
||||||
prenom: Prénom
|
prenom: Prénom
|
||||||
birthdate: Date de naissance
|
birthdate: Date de naissance
|
||||||
|
@ -9,6 +10,8 @@ fr:
|
||||||
models:
|
models:
|
||||||
individual:
|
individual:
|
||||||
attributes:
|
attributes:
|
||||||
|
gender:
|
||||||
|
blank: 'doit être rempli'
|
||||||
nom:
|
nom:
|
||||||
blank: 'doit être rempli'
|
blank: 'doit être rempli'
|
||||||
prenom:
|
prenom:
|
||||||
|
|
|
@ -202,11 +202,15 @@ Rails.application.routes.draw do
|
||||||
|
|
||||||
scope module: 'new_user' do
|
scope module: 'new_user' do
|
||||||
resources :dossiers, only: [] do
|
resources :dossiers, only: [] do
|
||||||
|
member do
|
||||||
|
get 'identite'
|
||||||
|
patch 'update_identite'
|
||||||
|
end
|
||||||
get 'attestation'
|
get 'attestation'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
scope module: 'new_gestionnaire' do
|
scope module: 'new_gestionnaire', as: 'gestionnaire' do
|
||||||
resources :procedures, only: [:index, :show], param: :procedure_id do
|
resources :procedures, only: [:index, :show], param: :procedure_id do
|
||||||
member do
|
member do
|
||||||
patch 'update_displayed_fields'
|
patch 'update_displayed_fields'
|
||||||
|
|
14
lib/tasks/2018_02_13_fill_champ_private_and_type.rake
Normal file
14
lib/tasks/2018_02_13_fill_champ_private_and_type.rake
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
namespace :'2018_02_13_fill_champ_private_and_type' do
|
||||||
|
task set: :environment do
|
||||||
|
Champ.includes(:type_de_champ).find_each do |champ|
|
||||||
|
champ.update_columns(champ.type_de_champ.params_for_champ)
|
||||||
|
end
|
||||||
|
|
||||||
|
TypeDeChamp.find_each do |type_de_champ|
|
||||||
|
type_de_champ.update_columns(
|
||||||
|
private: type_de_champ.private?,
|
||||||
|
type: TypeDeChamp.type_champ_to_class_name(type_de_champ.type_champ)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
17
lib/tasks/2018_02_20_remove_duplicated_assign_tos.rake
Normal file
17
lib/tasks/2018_02_20_remove_duplicated_assign_tos.rake
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
namespace :'2018_02_20_remove_duplicated_assign_tos' do
|
||||||
|
task remove: :environment do
|
||||||
|
duplicates = AssignTo.group(:gestionnaire_id, :procedure_id)
|
||||||
|
.having("COUNT(*) > 1")
|
||||||
|
.size
|
||||||
|
.to_a
|
||||||
|
|
||||||
|
duplicates.each do |duplicate|
|
||||||
|
keys = duplicate.first
|
||||||
|
gestionnaire_id = keys.first
|
||||||
|
procedure_id = keys.last
|
||||||
|
assign_tos = AssignTo.where(gestionnaire_id: gestionnaire_id, procedure_id: procedure_id).to_a
|
||||||
|
assign_tos.shift
|
||||||
|
assign_tos.each(&:destroy)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
7
lib/tasks/2018_02_20_set_processed_at.rake
Normal file
7
lib/tasks/2018_02_20_set_processed_at.rake
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
namespace :'2018_02_20_set_processed_at' do
|
||||||
|
task set: :environment do
|
||||||
|
Dossier.where(state: :accepte, processed_at: nil).find_each do |dossier|
|
||||||
|
dossier.update_column(:processed_at, dossier.en_instruction_at)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -58,7 +58,7 @@ describe NewGestionnaire::AvisController, type: :controller do
|
||||||
avis_without_answer.reload
|
avis_without_answer.reload
|
||||||
end
|
end
|
||||||
|
|
||||||
it { expect(response).to redirect_to(instruction_avis_path(avis_without_answer)) }
|
it { expect(response).to redirect_to(instruction_gestionnaire_avis_path(avis_without_answer)) }
|
||||||
it { expect(avis_without_answer.answer).to eq('answer') }
|
it { expect(avis_without_answer.answer).to eq('answer') }
|
||||||
it { expect(flash.notice).to eq('Votre réponse est enregistrée.') }
|
it { expect(flash.notice).to eq('Votre réponse est enregistrée.') }
|
||||||
end
|
end
|
||||||
|
@ -76,7 +76,7 @@ describe NewGestionnaire::AvisController, type: :controller do
|
||||||
it do
|
it do
|
||||||
subject
|
subject
|
||||||
|
|
||||||
expect(response).to redirect_to(messagerie_avis_path(avis_without_answer))
|
expect(response).to redirect_to(messagerie_gestionnaire_avis_path(avis_without_answer))
|
||||||
expect(dossier.commentaires.map(&:body)).to match(['commentaire body'])
|
expect(dossier.commentaires.map(&:body)).to match(['commentaire body'])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ describe NewGestionnaire::AvisController, type: :controller do
|
||||||
it { expect(created_avis.introduction).to eq(intro) }
|
it { expect(created_avis.introduction).to eq(intro) }
|
||||||
it { expect(created_avis.dossier).to eq(previous_avis.dossier) }
|
it { expect(created_avis.dossier).to eq(previous_avis.dossier) }
|
||||||
it { expect(created_avis.claimant).to eq(gestionnaire) }
|
it { expect(created_avis.claimant).to eq(gestionnaire) }
|
||||||
it { expect(response).to redirect_to(instruction_avis_path(previous_avis)) }
|
it { expect(response).to redirect_to(instruction_gestionnaire_avis_path(previous_avis)) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when the user asked for a confidentiel avis' do
|
context 'when the user asked for a confidentiel avis' do
|
||||||
|
@ -179,7 +179,7 @@ describe NewGestionnaire::AvisController, type: :controller do
|
||||||
get :sign_up, params: { id: avis.id, email: invited_email }
|
get :sign_up, params: { id: avis.id, email: invited_email }
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to redirect_to avis_url(avis) }
|
it { is_expected.to redirect_to gestionnaire_avis_url(avis) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when the gestionnaire is not authenticated' do
|
context 'when the gestionnaire is not authenticated' do
|
||||||
|
@ -201,7 +201,7 @@ describe NewGestionnaire::AvisController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
# redirected to dossier but then the gestionnaire gonna be banished !
|
# redirected to dossier but then the gestionnaire gonna be banished !
|
||||||
it { is_expected.to redirect_to avis_url(avis) }
|
it { is_expected.to redirect_to gestionnaire_avis_url(avis) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -243,14 +243,14 @@ describe NewGestionnaire::AvisController, type: :controller do
|
||||||
it { expect(Avis).to have_received(:link_avis_to_gestionnaire) }
|
it { expect(Avis).to have_received(:link_avis_to_gestionnaire) }
|
||||||
|
|
||||||
it { expect(subject.current_gestionnaire).to eq(created_gestionnaire) }
|
it { expect(subject.current_gestionnaire).to eq(created_gestionnaire) }
|
||||||
it { is_expected.to redirect_to avis_index_path }
|
it { is_expected.to redirect_to gestionnaire_avis_index_path }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when the gestionnaire creation fails' do
|
context 'when the gestionnaire creation fails' do
|
||||||
let(:password) { '' }
|
let(:password) { '' }
|
||||||
|
|
||||||
it { expect(created_gestionnaire).to be_nil }
|
it { expect(created_gestionnaire).to be_nil }
|
||||||
it { is_expected.to redirect_to sign_up_avis_path(avis_id, invited_email) }
|
it { is_expected.to redirect_to sign_up_gestionnaire_avis_path(avis_id, invited_email) }
|
||||||
it { expect(flash.alert).to eq(['Password : Le mot de passe est vide']) }
|
it { expect(flash.alert).to eq(['Password : Le mot de passe est vide']) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -54,7 +54,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
it { expect(response).to redirect_to(personnes_impliquees_dossier_url) }
|
it { expect(response).to redirect_to(personnes_impliquees_gestionnaire_dossier_url) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#follow' do
|
describe '#follow' do
|
||||||
|
@ -64,7 +64,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
||||||
|
|
||||||
it { expect(gestionnaire.followed_dossiers).to match([dossier]) }
|
it { expect(gestionnaire.followed_dossiers).to match([dossier]) }
|
||||||
it { expect(flash.notice).to eq('Dossier suivi') }
|
it { expect(flash.notice).to eq('Dossier suivi') }
|
||||||
it { expect(response).to redirect_to(procedures_url) }
|
it { expect(response).to redirect_to(gestionnaire_procedures_url) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#unfollow' do
|
describe '#unfollow' do
|
||||||
|
@ -76,7 +76,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
||||||
|
|
||||||
it { expect(gestionnaire.followed_dossiers).to match([]) }
|
it { expect(gestionnaire.followed_dossiers).to match([]) }
|
||||||
it { expect(flash.notice).to eq("Vous ne suivez plus le dossier nº #{dossier.id}") }
|
it { expect(flash.notice).to eq("Vous ne suivez plus le dossier nº #{dossier.id}") }
|
||||||
it { expect(response).to redirect_to(procedures_url) }
|
it { expect(response).to redirect_to(gestionnaire_procedures_url) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#archive' do
|
describe '#archive' do
|
||||||
|
@ -88,7 +88,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it { expect(dossier.archived).to be true }
|
it { expect(dossier.archived).to be true }
|
||||||
it { expect(response).to redirect_to(procedures_url) }
|
it { expect(response).to redirect_to(gestionnaire_procedures_url) }
|
||||||
it { expect(gestionnaire.followed_dossiers).not_to include(dossier) }
|
it { expect(gestionnaire.followed_dossiers).not_to include(dossier) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it { expect(dossier.archived).to be false }
|
it { expect(dossier.archived).to be false }
|
||||||
it { expect(response).to redirect_to(procedures_url) }
|
it { expect(response).to redirect_to(gestionnaire_procedures_url) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#passer_en_instruction' do
|
describe '#passer_en_instruction' do
|
||||||
|
@ -112,7 +112,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it { expect(dossier.state).to eq('en_instruction') }
|
it { expect(dossier.state).to eq('en_instruction') }
|
||||||
it { is_expected.to redirect_to dossier_path(procedure, dossier) }
|
it { is_expected.to redirect_to gestionnaire_dossier_path(procedure, dossier) }
|
||||||
it { expect(gestionnaire.follow?(dossier)).to be true }
|
it { expect(gestionnaire.follow?(dossier)).to be true }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
||||||
expect(dossier.state).to eq('en_construction')
|
expect(dossier.state).to eq('en_construction')
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to redirect_to dossier_path(procedure, dossier) }
|
it { is_expected.to redirect_to gestionnaire_dossier_path(procedure, dossier) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#terminer' do
|
describe '#terminer' do
|
||||||
|
@ -158,7 +158,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
||||||
subject
|
subject
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to redirect_to redirect_to dossier_path(procedure, dossier) }
|
it { is_expected.to redirect_to redirect_to gestionnaire_dossier_path(procedure, dossier) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with classer_sans_suite" do
|
context "with classer_sans_suite" do
|
||||||
|
@ -184,7 +184,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
||||||
subject
|
subject
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to redirect_to redirect_to dossier_path(procedure, dossier) }
|
it { is_expected.to redirect_to redirect_to gestionnaire_dossier_path(procedure, dossier) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with accepter" do
|
context "with accepter" do
|
||||||
|
@ -233,7 +233,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
||||||
it 'Notification email is sent with the attestation' do
|
it 'Notification email is sent with the attestation' do
|
||||||
subject
|
subject
|
||||||
|
|
||||||
is_expected.to redirect_to redirect_to dossier_path(procedure, dossier)
|
is_expected.to redirect_to redirect_to gestionnaire_dossier_path(procedure, dossier)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -246,7 +246,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
||||||
|
|
||||||
subject
|
subject
|
||||||
|
|
||||||
is_expected.to redirect_to redirect_to dossier_path(procedure, dossier)
|
is_expected.to redirect_to redirect_to gestionnaire_dossier_path(procedure, dossier)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -307,7 +307,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
||||||
expect(saved_commentaire.body).to eq("<p>avant\n<br />apres</p>")
|
expect(saved_commentaire.body).to eq("<p>avant\n<br />apres</p>")
|
||||||
expect(saved_commentaire.email).to eq(gestionnaire.email)
|
expect(saved_commentaire.email).to eq(gestionnaire.email)
|
||||||
expect(saved_commentaire.dossier).to eq(dossier)
|
expect(saved_commentaire.dossier).to eq(dossier)
|
||||||
expect(response).to redirect_to(messagerie_dossier_path(dossier.procedure, dossier))
|
expect(response).to redirect_to(messagerie_gestionnaire_dossier_path(dossier.procedure, dossier))
|
||||||
expect(gestionnaire.followed_dossiers).to include(dossier)
|
expect(gestionnaire.followed_dossiers).to include(dossier)
|
||||||
expect(saved_commentaire.file.present?).to eq(false)
|
expect(saved_commentaire.file.present?).to eq(false)
|
||||||
end
|
end
|
||||||
|
@ -350,7 +350,7 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
||||||
it { expect(saved_avis.confidentiel).to eq(true) }
|
it { expect(saved_avis.confidentiel).to eq(true) }
|
||||||
it { expect(saved_avis.dossier).to eq(dossier) }
|
it { expect(saved_avis.dossier).to eq(dossier) }
|
||||||
it { expect(saved_avis.claimant).to eq(gestionnaire) }
|
it { expect(saved_avis.claimant).to eq(gestionnaire) }
|
||||||
it { expect(response).to redirect_to(avis_dossier_path(dossier.procedure, dossier)) }
|
it { expect(response).to redirect_to(avis_gestionnaire_dossier_path(dossier.procedure, dossier)) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#update_annotations" do
|
describe "#update_annotations" do
|
||||||
|
@ -394,6 +394,6 @@ describe NewGestionnaire::DossiersController, type: :controller do
|
||||||
|
|
||||||
it { expect(champ_multiple_drop_down_list.value).to eq('["un", "deux"]') }
|
it { expect(champ_multiple_drop_down_list.value).to eq('["un", "deux"]') }
|
||||||
it { expect(champ_datetime.value).to eq('21/12/2019 13:17') }
|
it { expect(champ_datetime.value).to eq('21/12/2019 13:17') }
|
||||||
it { expect(response).to redirect_to(annotations_privees_dossier_path(dossier.procedure, dossier)) }
|
it { expect(response).to redirect_to(annotations_privees_gestionnaire_dossier_path(dossier.procedure, dossier)) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -78,7 +78,7 @@ describe NewGestionnaire::ProceduresController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "redirects avis" do
|
it "redirects avis" do
|
||||||
expect(@controller).to have_received(:redirect_to).with(avis_index_path)
|
expect(@controller).to have_received(:redirect_to).with(gestionnaire_avis_index_path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -64,4 +64,43 @@ describe NewUser::DossiersController, type: :controller do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'update_identite' do
|
||||||
|
let(:procedure) { create(:procedure, :for_individual) }
|
||||||
|
let(:dossier) { create(:dossier, user: user, procedure: procedure) }
|
||||||
|
|
||||||
|
subject { post :update_identite, params: { id: dossier.id, individual: individual_params, dossier: dossier_params } }
|
||||||
|
|
||||||
|
before do
|
||||||
|
sign_in(user)
|
||||||
|
subject
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with correct individual and dossier params' do
|
||||||
|
let(:individual_params) { { gender: 'M', nom: 'Mouse', prenom: 'Mickey' } }
|
||||||
|
let(:dossier_params) { { autorisation_donnees: true } }
|
||||||
|
|
||||||
|
it do
|
||||||
|
expect(response).to redirect_to(users_dossier_description_path(dossier))
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'on a procedure with carto' do
|
||||||
|
let(:procedure) { create(:procedure, :for_individual, :with_api_carto) }
|
||||||
|
|
||||||
|
it do
|
||||||
|
expect(response).to redirect_to(users_dossier_carte_path(dossier))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with incorrect individual and dossier params' do
|
||||||
|
let(:individual_params) { { gender: '', nom: '', prenom: '' } }
|
||||||
|
let(:dossier_params) { { autorisation_donnees: nil } }
|
||||||
|
|
||||||
|
it do
|
||||||
|
expect(response).not_to have_http_status(:redirect)
|
||||||
|
expect(flash[:alert]).to include("Civilité doit être rempli", "Nom doit être rempli", "Prénom doit être rempli", "Acceptation des CGU doit être coché")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -21,7 +21,7 @@ describe RootController, type: :controller do
|
||||||
sign_in gestionnaire
|
sign_in gestionnaire
|
||||||
end
|
end
|
||||||
|
|
||||||
it { expect(subject).to redirect_to(procedures_path) }
|
it { expect(subject).to redirect_to(gestionnaire_procedures_path) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when Administrateur is connected' do
|
context 'when Administrateur is connected' do
|
||||||
|
|
|
@ -365,6 +365,8 @@ describe Users::DossiersController, type: :controller do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
sign_in dossier.user
|
sign_in dossier.user
|
||||||
|
dossier.update_columns(autorisation_donnees: nil)
|
||||||
|
dossier.reload
|
||||||
subject
|
subject
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
FactoryBot.define do
|
FactoryBot.define do
|
||||||
factory :dossier do
|
factory :dossier do
|
||||||
|
autorisation_donnees true
|
||||||
state 'brouillon'
|
state 'brouillon'
|
||||||
association :user, factory: [:user]
|
association :user, factory: [:user]
|
||||||
|
|
||||||
|
|
|
@ -10,13 +10,13 @@ feature 'The gestionnaire part' do
|
||||||
scenario 'A gestionnaire can accept a dossier' do
|
scenario 'A gestionnaire can accept a dossier' do
|
||||||
log_in(gestionnaire.email, password)
|
log_in(gestionnaire.email, password)
|
||||||
|
|
||||||
expect(page).to have_current_path(procedures_path)
|
expect(page).to have_current_path(gestionnaire_procedures_path)
|
||||||
|
|
||||||
click_on procedure.libelle
|
click_on procedure.libelle
|
||||||
expect(page).to have_current_path(procedure_path(procedure))
|
expect(page).to have_current_path(gestionnaire_procedure_path(procedure))
|
||||||
|
|
||||||
click_on dossier.user.email
|
click_on dossier.user.email
|
||||||
expect(page).to have_current_path(dossier_path(procedure, dossier))
|
expect(page).to have_current_path(gestionnaire_dossier_path(procedure, dossier))
|
||||||
|
|
||||||
click_on 'Passer en instruction'
|
click_on 'Passer en instruction'
|
||||||
dossier.reload
|
dossier.reload
|
||||||
|
@ -40,16 +40,16 @@ feature 'The gestionnaire part' do
|
||||||
dossier_present?(dossier.id, 'en construction')
|
dossier_present?(dossier.id, 'en construction')
|
||||||
|
|
||||||
click_on 'Suivre le dossier'
|
click_on 'Suivre le dossier'
|
||||||
expect(page).to have_current_path(procedure_path(procedure))
|
expect(page).to have_current_path(gestionnaire_procedure_path(procedure))
|
||||||
test_statut_bar(suivi: 1, tous_les_dossiers: 1)
|
test_statut_bar(suivi: 1, tous_les_dossiers: 1)
|
||||||
expect(page).to have_text('Aucun dossier')
|
expect(page).to have_text('Aucun dossier')
|
||||||
|
|
||||||
click_on 'suivi'
|
click_on 'suivi'
|
||||||
expect(page).to have_current_path(procedure_path(procedure, statut: 'suivis'))
|
expect(page).to have_current_path(gestionnaire_procedure_path(procedure, statut: 'suivis'))
|
||||||
dossier_present?(dossier.id, 'en construction')
|
dossier_present?(dossier.id, 'en construction')
|
||||||
|
|
||||||
click_on 'Ne plus suivre'
|
click_on 'Ne plus suivre'
|
||||||
expect(page).to have_current_path(procedure_path(procedure, statut: 'suivis'))
|
expect(page).to have_current_path(gestionnaire_procedure_path(procedure, statut: 'suivis'))
|
||||||
test_statut_bar(a_suivre: 1, tous_les_dossiers: 1)
|
test_statut_bar(a_suivre: 1, tous_les_dossiers: 1)
|
||||||
expect(page).to have_text('Aucun dossier')
|
expect(page).to have_text('Aucun dossier')
|
||||||
end
|
end
|
||||||
|
@ -63,7 +63,7 @@ feature 'The gestionnaire part' do
|
||||||
click_on dossier.user.email
|
click_on dossier.user.email
|
||||||
|
|
||||||
click_on 'Avis externes'
|
click_on 'Avis externes'
|
||||||
expect(page).to have_current_path(avis_dossier_path(procedure, dossier))
|
expect(page).to have_current_path(avis_gestionnaire_dossier_path(procedure, dossier))
|
||||||
|
|
||||||
expert_email = 'expert@tps.com'
|
expert_email = 'expert@tps.com'
|
||||||
ask_confidential_avis(expert_email, 'a good introduction')
|
ask_confidential_avis(expert_email, 'a good introduction')
|
||||||
|
@ -71,21 +71,21 @@ feature 'The gestionnaire part' do
|
||||||
log_out
|
log_out
|
||||||
|
|
||||||
avis = dossier.avis.first
|
avis = dossier.avis.first
|
||||||
test_mail(expert_email, sign_up_avis_path(avis, expert_email))
|
test_mail(expert_email, sign_up_gestionnaire_avis_path(avis, expert_email))
|
||||||
|
|
||||||
avis_sign_up(avis, expert_email, 'a good password')
|
avis_sign_up(avis, expert_email, 'a good password')
|
||||||
|
|
||||||
expect(page).to have_current_path(avis_index_path)
|
expect(page).to have_current_path(gestionnaire_avis_index_path)
|
||||||
expect(page).to have_text('avis à donner 1')
|
expect(page).to have_text('avis à donner 1')
|
||||||
expect(page).to have_text('avis donnés 0')
|
expect(page).to have_text('avis donnés 0')
|
||||||
|
|
||||||
click_on dossier.user.email
|
click_on dossier.user.email
|
||||||
expect(page).to have_current_path(avis_path(dossier.avis.first))
|
expect(page).to have_current_path(gestionnaire_avis_path(dossier.avis.first))
|
||||||
|
|
||||||
within(:css, '.tabs') do
|
within(:css, '.tabs') do
|
||||||
click_on 'Avis'
|
click_on 'Avis'
|
||||||
end
|
end
|
||||||
expect(page).to have_current_path(instruction_avis_path(dossier.avis.first))
|
expect(page).to have_current_path(instruction_gestionnaire_avis_path(dossier.avis.first))
|
||||||
|
|
||||||
within(:css, '.give-avis') do
|
within(:css, '.give-avis') do
|
||||||
expect(page).to have_text("Demandeur : #{gestionnaire.email}")
|
expect(page).to have_text("Demandeur : #{gestionnaire.email}")
|
||||||
|
@ -115,7 +115,7 @@ feature 'The gestionnaire part' do
|
||||||
click_on dossier.user.email
|
click_on dossier.user.email
|
||||||
|
|
||||||
click_on 'Avis externes'
|
click_on 'Avis externes'
|
||||||
expect(page).to have_current_path(avis_dossier_path(procedure, dossier))
|
expect(page).to have_current_path(avis_gestionnaire_dossier_path(procedure, dossier))
|
||||||
|
|
||||||
expert_email = 'expert@tps.com'
|
expert_email = 'expert@tps.com'
|
||||||
ask_confidential_avis(expert_email, 'a good introduction')
|
ask_confidential_avis(expert_email, 'a good introduction')
|
||||||
|
@ -136,7 +136,7 @@ feature 'The gestionnaire part' do
|
||||||
fill_in 'user_email', with: email
|
fill_in 'user_email', with: email
|
||||||
fill_in 'user_password', with: password
|
fill_in 'user_password', with: password
|
||||||
click_on 'Se connecter'
|
click_on 'Se connecter'
|
||||||
expect(page).to have_current_path(procedures_path)
|
expect(page).to have_current_path(gestionnaire_procedures_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
def log_out
|
def log_out
|
||||||
|
@ -169,10 +169,10 @@ feature 'The gestionnaire part' do
|
||||||
end
|
end
|
||||||
|
|
||||||
def avis_sign_up(avis, email, password)
|
def avis_sign_up(avis, email, password)
|
||||||
visit sign_up_avis_path(avis, email)
|
visit sign_up_gestionnaire_avis_path(avis, email)
|
||||||
fill_in 'gestionnaire_password', with: 'a good password'
|
fill_in 'gestionnaire_password', with: 'a good password'
|
||||||
click_on 'Créer un compte'
|
click_on 'Créer un compte'
|
||||||
expect(page).to have_current_path(avis_index_path)
|
expect(page).to have_current_path(gestionnaire_avis_index_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
def dossier_present?(id, statut)
|
def dossier_present?(id, statut)
|
||||||
|
|
|
@ -11,7 +11,7 @@ feature "procedure filters" do
|
||||||
before do
|
before do
|
||||||
champ.update_attributes(value: "Mon champ rempli")
|
champ.update_attributes(value: "Mon champ rempli")
|
||||||
login_as gestionnaire, scope: :gestionnaire
|
login_as gestionnaire, scope: :gestionnaire
|
||||||
visit procedure_path(procedure)
|
visit gestionnaire_procedure_path(procedure)
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "should display demandeur by default" do
|
scenario "should display demandeur by default" do
|
||||||
|
|
|
@ -13,34 +13,41 @@ feature 'As a User I wanna create a dossier' do
|
||||||
before do
|
before do
|
||||||
login_as user, scope: :user
|
login_as user, scope: :user
|
||||||
visit commencer_path(procedure_path: procedure_for_individual.path)
|
visit commencer_path(procedure_path: procedure_for_individual.path)
|
||||||
fill_in 'dossier_individual_attributes_nom', with: 'Nom'
|
fill_in 'individual_nom', with: 'Nom'
|
||||||
fill_in 'dossier_individual_attributes_prenom', with: 'Prenom'
|
fill_in 'individual_prenom', with: 'Prenom'
|
||||||
find(:css, "#dossier_autorisation_donnees[value='1']").set(true)
|
check "dossier_autorisation_donnees"
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when birthday is asked" do
|
context "when birthday is asked" do
|
||||||
let(:ask_birthday) { true }
|
let(:ask_birthday) { true }
|
||||||
|
|
||||||
scenario "with a proper date input field for birthdate (type='date' supported)" do
|
scenario "with a proper date input field for birthdate (type='date' supported)" do
|
||||||
fill_in 'dossier_individual_attributes_birthdate', with: '1987-10-14'
|
fill_in 'individual_birthdate', with: '1987-10-14'
|
||||||
page.find_by_id('etape_suivante').click
|
click_button('Continuer')
|
||||||
expect(page).to have_current_path(users_dossier_carte_path(procedure_for_individual.dossiers.last.id.to_s))
|
|
||||||
page.find_by_id('etape_suivante').click
|
expect(page).to have_current_path(users_dossier_carte_path(procedure_for_individual.dossiers.last.id))
|
||||||
|
click_button('Etape suivante')
|
||||||
|
|
||||||
|
expect(page).to have_current_path(users_dossier_description_path(procedure_for_individual.dossiers.last.id))
|
||||||
fill_in "champs_#{procedure_for_individual.dossiers.last.champs.first.id}", with: 'contenu du champ 1'
|
fill_in "champs_#{procedure_for_individual.dossiers.last.champs.first.id}", with: 'contenu du champ 1'
|
||||||
find(:css, '[name=submit_action]').set('nouveaux')
|
find(:css, '[name=submit_action]').set('nouveaux')
|
||||||
page.find_by_id('suivant').click
|
click_button('suivant')
|
||||||
|
|
||||||
expect(user.dossiers.first.individual.birthdate).to eq("1987-10-14")
|
expect(user.dossiers.first.individual.birthdate).to eq("1987-10-14")
|
||||||
expect(page).to have_current_path(users_dossier_recapitulatif_path(procedure_for_individual.dossiers.last.id.to_s))
|
expect(page).to have_current_path(users_dossier_recapitulatif_path(procedure_for_individual.dossiers.last.id.to_s))
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "with a basic text input field for birthdate (type='date' unsupported)" do
|
scenario "with a basic text input field for birthdate (type='date' unsupported)" do
|
||||||
fill_in 'dossier_individual_attributes_birthdate', with: '14/10/1987'
|
fill_in 'individual_birthdate', with: '14/10/1987'
|
||||||
page.find_by_id('etape_suivante').click
|
click_button('Continuer')
|
||||||
|
|
||||||
expect(page).to have_current_path(users_dossier_carte_path(procedure_for_individual.dossiers.last.id.to_s))
|
expect(page).to have_current_path(users_dossier_carte_path(procedure_for_individual.dossiers.last.id.to_s))
|
||||||
page.find_by_id('etape_suivante').click
|
click_button('Etape suivante')
|
||||||
|
|
||||||
fill_in "champs_#{procedure_for_individual.dossiers.last.champs.first.id}", with: 'contenu du champ 1'
|
fill_in "champs_#{procedure_for_individual.dossiers.last.champs.first.id}", with: 'contenu du champ 1'
|
||||||
find(:css, '[name=submit_action]').set('nouveaux')
|
find(:css, '[name=submit_action]').set('nouveaux')
|
||||||
page.find_by_id('suivant').click
|
page.find_by_id('suivant').click
|
||||||
|
|
||||||
expect(user.dossiers.first.individual.birthdate).to eq("1987-10-14")
|
expect(user.dossiers.first.individual.birthdate).to eq("1987-10-14")
|
||||||
expect(page).to have_current_path(users_dossier_recapitulatif_path(procedure_for_individual.dossiers.last.id.to_s))
|
expect(page).to have_current_path(users_dossier_recapitulatif_path(procedure_for_individual.dossiers.last.id.to_s))
|
||||||
end
|
end
|
||||||
|
@ -50,12 +57,15 @@ feature 'As a User I wanna create a dossier' do
|
||||||
let(:ask_birthday) { false }
|
let(:ask_birthday) { false }
|
||||||
|
|
||||||
scenario "no need for birthday" do
|
scenario "no need for birthday" do
|
||||||
page.find_by_id('etape_suivante').click
|
click_button('Continuer')
|
||||||
|
|
||||||
expect(page).to have_current_path(users_dossier_carte_path(procedure_for_individual.dossiers.last.id.to_s))
|
expect(page).to have_current_path(users_dossier_carte_path(procedure_for_individual.dossiers.last.id.to_s))
|
||||||
page.find_by_id('etape_suivante').click
|
click_button('Etape suivante')
|
||||||
|
|
||||||
fill_in "champs_#{procedure_for_individual.dossiers.last.champs.first.id}", with: 'contenu du champ 1'
|
fill_in "champs_#{procedure_for_individual.dossiers.last.champs.first.id}", with: 'contenu du champ 1'
|
||||||
find(:css, '[name=submit_action]').set('nouveaux')
|
find(:css, '[name=submit_action]').set('nouveaux')
|
||||||
page.find_by_id('suivant').click
|
click_button('suivant')
|
||||||
|
|
||||||
expect(user.dossiers.first.individual.birthdate).to eq(nil)
|
expect(user.dossiers.first.individual.birthdate).to eq(nil)
|
||||||
expect(page).to have_current_path(users_dossier_recapitulatif_path(procedure_for_individual.dossiers.last.id.to_s))
|
expect(page).to have_current_path(users_dossier_recapitulatif_path(procedure_for_individual.dossiers.last.id.to_s))
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,16 +6,11 @@ feature 'As a User I want to sort and paginate dossiers', js: true do
|
||||||
|
|
||||||
before "Create dossier" do
|
before "Create dossier" do
|
||||||
login_as user, scope: :user
|
login_as user, scope: :user
|
||||||
visit commencer_path(procedure_path: procedure_for_individual.path)
|
|
||||||
fill_in 'dossier_individual_attributes_nom', with: 'Nom'
|
|
||||||
fill_in 'dossier_individual_attributes_prenom', with: 'Prenom'
|
|
||||||
fill_in 'dossier_individual_attributes_birthdate', with: '14/10/1987'
|
|
||||||
find(:css, "#dossier_autorisation_donnees[value='1']").set(true)
|
|
||||||
page.find_by_id('etape_suivante').click
|
|
||||||
page.find_by_id('suivant').click
|
|
||||||
50.times do
|
50.times do
|
||||||
Dossier.create(procedure_id: procedure_for_individual.id, user_id: user.id, state: "en_construction")
|
Dossier.create(procedure_id: procedure_for_individual.id, user_id: user.id, state: "en_construction")
|
||||||
end
|
end
|
||||||
|
|
||||||
visit root_path
|
visit root_path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -25,8 +20,8 @@ feature 'As a User I want to sort and paginate dossiers', js: true do
|
||||||
expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq(user.dossiers.first.id.to_s)
|
expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq(user.dossiers.first.id.to_s)
|
||||||
expect(page.all(:css, '#dossiers-list tr')[2].text.split(" ").first).to eq(user.dossiers.second.id.to_s)
|
expect(page.all(:css, '#dossiers-list tr')[2].text.split(" ").first).to eq(user.dossiers.second.id.to_s)
|
||||||
visit "/users/dossiers?dossiers_smart_listing[sort][id]=desc"
|
visit "/users/dossiers?dossiers_smart_listing[sort][id]=desc"
|
||||||
expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq((user.dossiers.first.id + 50).to_s)
|
expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq((user.dossiers.first.id + 49).to_s)
|
||||||
expect(page.all(:css, '#dossiers-list tr')[2].text.split(" ").first).to eq((user.dossiers.first.id + 49).to_s)
|
expect(page.all(:css, '#dossiers-list tr')[2].text.split(" ").first).to eq((user.dossiers.first.id + 48).to_s)
|
||||||
visit "/users/dossiers?dossiers_smart_listing[sort][id]=asc"
|
visit "/users/dossiers?dossiers_smart_listing[sort][id]=asc"
|
||||||
expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq(user.dossiers.first.id.to_s)
|
expect(page.all(:css, '#dossiers-list tr')[1].text.split(" ").first).to eq(user.dossiers.first.id.to_s)
|
||||||
expect(page.all(:css, '#dossiers-list tr')[2].text.split(" ").first).to eq(user.dossiers.second.id.to_s)
|
expect(page.all(:css, '#dossiers-list tr')[2].text.split(" ").first).to eq(user.dossiers.second.id.to_s)
|
||||||
|
|
|
@ -13,7 +13,7 @@ describe DossierLinkHelper do
|
||||||
|
|
||||||
before { dossier.procedure.gestionnaires << gestionnaire }
|
before { dossier.procedure.gestionnaires << gestionnaire }
|
||||||
|
|
||||||
it { expect(helper.dossier_linked_path(gestionnaire, dossier)).to eq(dossier_path(dossier.procedure, dossier)) }
|
it { expect(helper.dossier_linked_path(gestionnaire, dossier)).to eq(gestionnaire_dossier_path(dossier.procedure, dossier)) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when access as expert" do
|
context "when access as expert" do
|
||||||
|
@ -21,7 +21,7 @@ describe DossierLinkHelper do
|
||||||
let(:gestionnaire) { create(:gestionnaire) }
|
let(:gestionnaire) { create(:gestionnaire) }
|
||||||
let!(:avis) { create(:avis, dossier: dossier, gestionnaire: gestionnaire) }
|
let!(:avis) { create(:avis, dossier: dossier, gestionnaire: gestionnaire) }
|
||||||
|
|
||||||
it { expect(helper.dossier_linked_path(gestionnaire, dossier)).to eq(avis_path(avis)) }
|
it { expect(helper.dossier_linked_path(gestionnaire, dossier)).to eq(gestionnaire_avis_path(avis)) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,7 +7,7 @@ RSpec.describe AutoReceiveDossiersForProcedureJob, type: :job do
|
||||||
before { Timecop.freeze(date) }
|
before { Timecop.freeze(date) }
|
||||||
after { Timecop.return }
|
after { Timecop.return }
|
||||||
|
|
||||||
subject { AutoReceiveDossiersForProcedureJob.new.perform(procedure_id, 'en_instruction') }
|
subject { AutoReceiveDossiersForProcedureJob.new.perform(procedure_id, state) }
|
||||||
|
|
||||||
context "with some dossiers" do
|
context "with some dossiers" do
|
||||||
let(:nouveau_dossier1) { create(:dossier, :en_construction) }
|
let(:nouveau_dossier1) { create(:dossier, :en_construction) }
|
||||||
|
@ -16,19 +16,46 @@ RSpec.describe AutoReceiveDossiersForProcedureJob, type: :job do
|
||||||
let(:dossier_brouillon) { create(:dossier, procedure: dossier_recu.procedure) }
|
let(:dossier_brouillon) { create(:dossier, procedure: dossier_recu.procedure) }
|
||||||
let(:procedure_id) { dossier_brouillon.procedure_id }
|
let(:procedure_id) { dossier_brouillon.procedure_id }
|
||||||
|
|
||||||
it do
|
context "en_construction" do
|
||||||
subject
|
let(:state) { :en_instruction }
|
||||||
expect(nouveau_dossier1.reload.en_instruction?).to be true
|
|
||||||
expect(nouveau_dossier1.reload.en_instruction_at).to eq(date)
|
|
||||||
|
|
||||||
expect(nouveau_dossier2.reload.en_instruction?).to be true
|
it do
|
||||||
expect(nouveau_dossier2.reload.en_instruction_at).to eq(date)
|
subject
|
||||||
|
expect(nouveau_dossier1.reload.en_instruction?).to be true
|
||||||
|
expect(nouveau_dossier1.reload.en_instruction_at).to eq(date)
|
||||||
|
|
||||||
expect(dossier_recu.reload.en_instruction?).to be true
|
expect(nouveau_dossier2.reload.en_instruction?).to be true
|
||||||
expect(dossier_recu.reload.en_instruction_at).to eq(date)
|
expect(nouveau_dossier2.reload.en_instruction_at).to eq(date)
|
||||||
|
|
||||||
expect(dossier_brouillon.reload.brouillon?).to be true
|
expect(dossier_recu.reload.en_instruction?).to be true
|
||||||
expect(dossier_brouillon.reload.en_instruction_at).to eq(nil)
|
expect(dossier_recu.reload.en_instruction_at).to eq(date)
|
||||||
|
|
||||||
|
expect(dossier_brouillon.reload.brouillon?).to be true
|
||||||
|
expect(dossier_brouillon.reload.en_instruction_at).to eq(nil)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context "accepte" do
|
||||||
|
let(:state) { :accepte }
|
||||||
|
|
||||||
|
it do
|
||||||
|
subject
|
||||||
|
expect(nouveau_dossier1.reload.accepte?).to be true
|
||||||
|
expect(nouveau_dossier1.reload.en_instruction_at).to eq(date)
|
||||||
|
expect(nouveau_dossier1.reload.processed_at).to eq(date)
|
||||||
|
|
||||||
|
expect(nouveau_dossier2.reload.accepte?).to be true
|
||||||
|
expect(nouveau_dossier2.reload.en_instruction_at).to eq(date)
|
||||||
|
expect(nouveau_dossier2.reload.processed_at).to eq(date)
|
||||||
|
|
||||||
|
expect(dossier_recu.reload.en_instruction?).to be true
|
||||||
|
expect(dossier_recu.reload.en_instruction_at).to eq(date)
|
||||||
|
expect(dossier_recu.reload.processed_at).to eq(nil)
|
||||||
|
|
||||||
|
expect(dossier_brouillon.reload.brouillon?).to be true
|
||||||
|
expect(dossier_brouillon.reload.en_instruction_at).to eq(nil)
|
||||||
|
expect(dossier_brouillon.reload.processed_at).to eq(nil)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,7 @@ RSpec.describe WeeklyOverviewJob, type: :job do
|
||||||
describe 'perform' do
|
describe 'perform' do
|
||||||
let!(:gestionnaire) { create(:gestionnaire) }
|
let!(:gestionnaire) { create(:gestionnaire) }
|
||||||
let(:overview) { double('overview') }
|
let(:overview) { double('overview') }
|
||||||
let(:mailer_double) { double('mailer', deliver_now: true) }
|
let(:mailer_double) { double('mailer', deliver_later: true) }
|
||||||
|
|
||||||
context 'if the feature is enabled' do
|
context 'if the feature is enabled' do
|
||||||
before { allow(Features).to receive(:weekly_overview).and_return(true) }
|
before { allow(Features).to receive(:weekly_overview).and_return(true) }
|
||||||
|
@ -16,8 +16,8 @@ RSpec.describe WeeklyOverviewJob, type: :job do
|
||||||
WeeklyOverviewJob.new.perform
|
WeeklyOverviewJob.new.perform
|
||||||
end
|
end
|
||||||
|
|
||||||
it { expect(GestionnaireMailer).to have_received(:last_week_overview).with(gestionnaire, overview) }
|
it { expect(GestionnaireMailer).to have_received(:last_week_overview).with(gestionnaire) }
|
||||||
it { expect(mailer_double).to have_received(:deliver_now) }
|
it { expect(mailer_double).to have_received(:deliver_later) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with one gestionnaire with no overviews' do
|
context 'with one gestionnaire with no overviews' do
|
||||||
|
|
Loading…
Add table
Reference in a new issue