Merge branch 'develop' into staging
This commit is contained in:
commit
9915e3d372
293 changed files with 951 additions and 926 deletions
11
.editorconfig
Normal file
11
.editorconfig
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.{haml,html,js,scss,rake,rb,yml}]
|
||||||
|
charset = utf-8
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
|
trim_trailing_whitespace = true
|
2
Gemfile
2
Gemfile
|
@ -16,7 +16,7 @@ gem 'therubyracer', platforms: :ruby
|
||||||
# Use jquery as the JavaScript library
|
# Use jquery as the JavaScript library
|
||||||
gem 'jquery-rails'
|
gem 'jquery-rails'
|
||||||
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
|
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
|
||||||
gem 'turbolinks', '~> 2.5'
|
gem 'turbolinks', '~> 5.0'
|
||||||
# bundle exec rake doc:rails generates the API under doc/api.
|
# bundle exec rake doc:rails generates the API under doc/api.
|
||||||
gem 'sdoc', '~> 0.4.0', group: :doc
|
gem 'sdoc', '~> 0.4.0', group: :doc
|
||||||
|
|
||||||
|
|
23
Gemfile.lock
23
Gemfile.lock
|
@ -95,7 +95,7 @@ GEM
|
||||||
bootstrap-wysihtml5-rails (0.3.3.8)
|
bootstrap-wysihtml5-rails (0.3.3.8)
|
||||||
railties (>= 3.0)
|
railties (>= 3.0)
|
||||||
browser (2.3.0)
|
browser (2.3.0)
|
||||||
builder (3.2.2)
|
builder (3.2.3)
|
||||||
byebug (9.0.6)
|
byebug (9.0.6)
|
||||||
capybara (2.11.0)
|
capybara (2.11.0)
|
||||||
addressable
|
addressable
|
||||||
|
@ -120,8 +120,8 @@ GEM
|
||||||
coffee-script (2.4.1)
|
coffee-script (2.4.1)
|
||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.11.1)
|
coffee-script-source (1.12.2)
|
||||||
concurrent-ruby (1.0.2)
|
concurrent-ruby (1.0.5)
|
||||||
connection_pool (2.2.1)
|
connection_pool (2.2.1)
|
||||||
crack (0.4.3)
|
crack (0.4.3)
|
||||||
safe_yaml (~> 1.0.0)
|
safe_yaml (~> 1.0.0)
|
||||||
|
@ -331,7 +331,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.7.0)
|
i18n (0.8.1)
|
||||||
inflecto (0.0.2)
|
inflecto (0.0.2)
|
||||||
ipaddress (0.8.3)
|
ipaddress (0.8.3)
|
||||||
jquery-rails (4.2.1)
|
jquery-rails (4.2.1)
|
||||||
|
@ -452,9 +452,9 @@ GEM
|
||||||
actionpack (~> 5.x)
|
actionpack (~> 5.x)
|
||||||
actionview (~> 5.x)
|
actionview (~> 5.x)
|
||||||
activesupport (~> 5.x)
|
activesupport (~> 5.x)
|
||||||
rails-dom-testing (2.0.1)
|
rails-dom-testing (2.0.2)
|
||||||
activesupport (>= 4.2.0, < 6.0)
|
activesupport (>= 4.2.0, < 6.0)
|
||||||
nokogiri (~> 1.6.0)
|
nokogiri (~> 1.6)
|
||||||
rails-html-sanitizer (1.0.3)
|
rails-html-sanitizer (1.0.3)
|
||||||
loofah (~> 2.0)
|
loofah (~> 2.0)
|
||||||
railties (5.0.0.1)
|
railties (5.0.0.1)
|
||||||
|
@ -585,13 +585,14 @@ GEM
|
||||||
libv8 (~> 3.16.14.0)
|
libv8 (~> 3.16.14.0)
|
||||||
ref
|
ref
|
||||||
thor (0.19.4)
|
thor (0.19.4)
|
||||||
thread_safe (0.3.5)
|
thread_safe (0.3.6)
|
||||||
tilt (2.0.5)
|
tilt (2.0.5)
|
||||||
timecop (0.8.1)
|
timecop (0.8.1)
|
||||||
trollop (2.1.2)
|
trollop (2.1.2)
|
||||||
turbolinks (2.5.3)
|
turbolinks (5.0.1)
|
||||||
coffee-rails
|
turbolinks-source (~> 5)
|
||||||
tzinfo (1.2.2)
|
turbolinks-source (5.0.0)
|
||||||
|
tzinfo (1.2.3)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
uglifier (3.0.4)
|
uglifier (3.0.4)
|
||||||
execjs (>= 0.3.0, < 3)
|
execjs (>= 0.3.0, < 3)
|
||||||
|
@ -707,7 +708,7 @@ DEPENDENCIES
|
||||||
sqlite3
|
sqlite3
|
||||||
therubyracer
|
therubyracer
|
||||||
timecop
|
timecop
|
||||||
turbolinks (~> 2.5)
|
turbolinks (~> 5.0)
|
||||||
uglifier (>= 1.3.0)
|
uglifier (>= 1.3.0)
|
||||||
unicode_utils
|
unicode_utils
|
||||||
unicorn
|
unicorn
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 176 KiB |
Binary file not shown.
Before Width: | Height: | Size: 35 KiB |
Binary file not shown.
Before Width: | Height: | Size: 24 KiB |
Binary file not shown.
Before Width: | Height: | Size: 10 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.2 KiB |
|
@ -1,5 +1,4 @@
|
||||||
$(document).on('page:load', init_action_btn_rules);
|
$(document).on('turbolinks:load', init_action_btn_rules);
|
||||||
$(document).ready(init_action_btn_rules);
|
|
||||||
|
|
||||||
function init_action_btn_rules() {
|
function init_action_btn_rules() {
|
||||||
$('.btn-send').click(function () {
|
$('.btn-send').click(function () {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
$(document).on('page:load', init_admin);
|
$(document).on('turbolinks:load', init_admin);
|
||||||
$(document).ready(init_admin);
|
|
||||||
|
|
||||||
function init_admin(){
|
function init_admin(){
|
||||||
destroy_action();
|
destroy_action();
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
$(document).on('page:load', init_path_modal);
|
$(document).on('turbolinks:load', init_path_modal);
|
||||||
$(document).ready(init_path_modal);
|
|
||||||
|
|
||||||
function init_path_modal() {
|
function init_path_modal() {
|
||||||
path_modal_action();
|
path_modal_action();
|
||||||
|
|
|
@ -33,8 +33,7 @@
|
||||||
//= require typeahead.bundle
|
//= require typeahead.bundle
|
||||||
//= require select2
|
//= require select2
|
||||||
|
|
||||||
$(document).on('page:load', application_init);
|
$(document).on('turbolinks:load', application_init);
|
||||||
$(document).ready(application_init);
|
|
||||||
|
|
||||||
|
|
||||||
function application_init(){
|
function application_init(){
|
||||||
|
@ -55,4 +54,3 @@ function scroll_to() {
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
$(document).on('page:load', buttons_archived);
|
$(document).on('turbolinks:load', buttons_archived);
|
||||||
$(document).ready(buttons_archived);
|
|
||||||
|
|
||||||
function buttons_archived(){
|
function buttons_archived(){
|
||||||
$("button#archive").on('click', function(){
|
$("button#archive").on('click', function(){
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
$(document).ready(wysihtml5_active);
|
$(document).on('turbolinks:load', wysihtml5_active);
|
||||||
$(document).on('page:load', wysihtml5_active);
|
|
||||||
|
|
||||||
function wysihtml5_active (){
|
function wysihtml5_active (){
|
||||||
$('.wysihtml5').each(function(i, elem) {
|
$('.wysihtml5').each(function(i, elem) {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
$(document).on('page:load', buttons_anchor);
|
$(document).on('turbolinks:load', buttons_anchor);
|
||||||
$(document).ready(buttons_anchor);
|
|
||||||
|
|
||||||
function buttons_anchor(){
|
function buttons_anchor(){
|
||||||
$("#cgu_menu_block").on('click', 'a', function(){
|
$("#cgu_menu_block").on('click', 'a', function(){
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
$(document).on('page:load', init_default_data_block);
|
$(document).on('turbolinks:load', init_default_data_block);
|
||||||
$(document).ready(init_default_data_block);
|
|
||||||
|
|
||||||
function init_default_data_block() {
|
function init_default_data_block() {
|
||||||
$('.default_data_block #dossier .body').toggle();
|
$('.default_data_block #dossier .body').toggle();
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
$(document).on('page:load', action_type_de_champs);
|
$(document).on('turbolinks:load', action_type_de_champs);
|
||||||
$(document).ready(action_type_de_champs);
|
|
||||||
|
|
||||||
|
|
||||||
function action_type_de_champs() {
|
function action_type_de_champs() {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
$(document).on('page:load', init_modal_commentaire);
|
$(document).on('turbolinks:load', init_modal_commentaire);
|
||||||
$(document).ready(init_modal_commentaire);
|
|
||||||
|
|
||||||
function init_modal_commentaire() {
|
function init_modal_commentaire() {
|
||||||
var modal = $("#modalCommentairesDossierParChamp");
|
var modal = $("#modalCommentairesDossierParChamp");
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
$(document).on('page:load', the_terms);
|
$(document).on('turbolinks:load', the_terms);
|
||||||
$(document).ready(the_terms);
|
$(document).on('turbolinks:load', pannel_switch);
|
||||||
$(document).on('page:load', pannel_switch);
|
|
||||||
$(document).ready(pannel_switch);
|
|
||||||
|
|
||||||
function pannel_switch() {
|
function pannel_switch() {
|
||||||
$('#switch-notifications').click(function () {
|
$('#switch-notifications').click(function () {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
$(document).on('page:load', filters_init);
|
$(document).on('turbolinks:load', filters_init);
|
||||||
$(document).ready(filters_init);
|
|
||||||
|
|
||||||
function filters_init() {
|
function filters_init() {
|
||||||
$('html').click(function(event) {
|
$('html').click(function(event) {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
$(document).on('page:load', link_init);
|
$(document).on('turbolinks:load', link_init);
|
||||||
$(document).ready(link_init);
|
|
||||||
|
|
||||||
function link_init() {
|
function link_init() {
|
||||||
$('#dossiers_list tr').on('click', function () {
|
$('#dossiers_list tr').on('click', function () {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
$(document).on('page:load', franceconnect_kit);
|
$(document).on('turbolinks:load', franceconnect_kit);
|
||||||
$(document).ready(franceconnect_kit);
|
|
||||||
|
|
||||||
function franceconnect_kit() {
|
function franceconnect_kit() {
|
||||||
franceConnectKit.init()
|
franceConnectKit.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
$(document).on('page:load', modal_action);
|
$(document).on('turbolinks:load', modal_action);
|
||||||
$(document).ready(modal_action);
|
|
||||||
|
|
||||||
function modal_action() {
|
function modal_action() {
|
||||||
$('#PJmodal').on('show.bs.modal', function (event) {
|
$('#PJmodal').on('show.bs.modal', function (event) {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
$(document).on('page:load', pref_list_dossier_actions);
|
$(document).on('turbolinks:load', pref_list_dossier_actions);
|
||||||
$(document).ready(pref_list_dossier_actions);
|
|
||||||
|
|
||||||
function pref_list_dossier_actions() {
|
function pref_list_dossier_actions() {
|
||||||
pref_list_dossier_open_action();
|
pref_list_dossier_open_action();
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
$(document).on('page:load', button_edit_procedure_init);
|
$(document).on('turbolinks:load', button_edit_procedure_init);
|
||||||
$(document).ready(button_edit_procedure_init);
|
|
||||||
|
|
||||||
function button_edit_procedure_init(){
|
function button_edit_procedure_init(){
|
||||||
buttons_api_carto();
|
buttons_api_carto();
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
$(document).on('page:load', init_search_anim);
|
$(document).on('turbolinks:load', init_search_anim);
|
||||||
$(document).ready(init_search_anim);
|
|
||||||
|
|
||||||
function init_search_anim(){
|
function init_search_anim(){
|
||||||
$("#search_area").on('click', search_fadeIn);
|
$("#search_area").on('click', search_fadeIn);
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
$(document).on('page:load', activeSelect2);
|
$(document).on('turbolinks:load', activeSelect2);
|
||||||
$(document).ready(activeSelect2);
|
|
||||||
|
|
||||||
function activeSelect2() {
|
function activeSelect2() {
|
||||||
$('select.select2').select2({ theme: "bootstrap", width: '100%' });
|
$('select.select2').select2({ theme: "bootstrap", width: '100%' });
|
||||||
|
|
5
app/assets/stylesheets/_turbolinks.scss
Normal file
5
app/assets/stylesheets/_turbolinks.scss
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
@import "variables";
|
||||||
|
|
||||||
|
.turbolinks-progress-bar {
|
||||||
|
background-color: $light-blue;
|
||||||
|
}
|
|
@ -1 +1,5 @@
|
||||||
|
// colors
|
||||||
|
$light-blue: #F2F6FA;
|
||||||
|
|
||||||
|
// Bootstrap variables
|
||||||
$font-size-base: 16px;
|
$font-size-base: 16px;
|
|
@ -20,4 +20,3 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
@import "bootstrap";
|
@import "bootstrap";
|
||||||
|
|
||||||
body {
|
body {
|
||||||
background-color: #F2F6FA;
|
background-color: $light-blue;
|
||||||
}
|
}
|
||||||
|
|
||||||
html, body {
|
html, body {
|
||||||
|
@ -63,7 +63,7 @@ form {
|
||||||
}
|
}
|
||||||
|
|
||||||
#footer {
|
#footer {
|
||||||
background-color: #F2F6FA;
|
background-color: $light-blue;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
a, p {
|
a, p {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
@import "variables";
|
||||||
|
|
||||||
.default_data_block {
|
.default_data_block {
|
||||||
font-family: Arial;
|
font-family: Arial;
|
||||||
|
|
||||||
|
@ -53,7 +55,7 @@
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
.action:hover {
|
.action:hover {
|
||||||
color: #F2F6FA;
|
color: $light-blue;
|
||||||
}
|
}
|
||||||
.count {
|
.count {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
@import "variables";
|
||||||
|
|
||||||
#header {
|
#header {
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
@ -185,7 +187,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.button-navbar-action:hover {
|
.button-navbar-action:hover {
|
||||||
color: #F2F6FA;
|
color: $light-blue;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button_navbar:hover, .button-navbar-action:hover {
|
.button_navbar:hover, .button-navbar-action:hover {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
@import "variables";
|
||||||
|
|
||||||
#users_index, #admins_index{
|
#users_index, #admins_index{
|
||||||
margin-left: 2rem;
|
margin-left: 2rem;
|
||||||
margin-right: 2rem;
|
margin-right: 2rem;
|
||||||
|
@ -48,7 +50,7 @@
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
.action:hover {
|
.action:hover {
|
||||||
color: #F2F6FA;
|
color: $light-blue;
|
||||||
}
|
}
|
||||||
.padding-left-30 {
|
.padding-left-30 {
|
||||||
padding-left: 30px;
|
padding-left: 30px;
|
||||||
|
|
|
@ -39,16 +39,13 @@ class Backoffice::DossiersController < Backoffice::DossiersListController
|
||||||
end
|
end
|
||||||
|
|
||||||
def download_dossiers_tps
|
def download_dossiers_tps
|
||||||
if procedure = Procedure.find_by(id: params[:procedure_id])
|
procedure = Procedure.find_by(id: params[:procedure_id])
|
||||||
dossiers = dossiers_list_facade(param_liste).dossiers_to_display
|
export = procedure.generate_export
|
||||||
respond_with Dossier.export_full_generation(dossiers, request.format) unless dossiers.empty?
|
|
||||||
else
|
|
||||||
dossiers = dossiers_list_facade(param_liste).dossiers_to_display
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.xlsx { render xlsx: dossiers }
|
format.csv { send_data(SpreadsheetArchitect.to_csv(data: export[:data], headers: export[:headers]), filename: 'dossiers.csv') }
|
||||||
format.ods { render ods: dossiers }
|
format.xlsx { send_data(SpreadsheetArchitect.to_xlsx(data: export[:data], headers: export[:headers]), filename: 'dossiers.xlsx') }
|
||||||
format.csv { render csv: dossiers }
|
format.ods { send_data(SpreadsheetArchitect.to_ods(data: export[:data], headers: export[:headers]), filename: 'dossiers.ods') }
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ class Users::DossiersController < UsersController
|
||||||
@facade = facade params[:dossier][:id]
|
@facade = facade params[:dossier][:id]
|
||||||
|
|
||||||
if checked_autorisation_donnees?
|
if checked_autorisation_donnees?
|
||||||
unless Dossier.find(@facade.dossier.id).update_attributes update_params
|
unless Dossier.find(@facade.dossier.id).update_attributes update_params_with_formatted_birthdate
|
||||||
flash.alert = @facade.dossier.errors.full_messages.join('<br />').html_safe
|
flash.alert = @facade.dossier.errors.full_messages.join('<br />').html_safe
|
||||||
|
|
||||||
return redirect_to users_dossier_path(id: @facade.dossier.id)
|
return redirect_to users_dossier_path(id: @facade.dossier.id)
|
||||||
|
@ -171,6 +171,25 @@ class Users::DossiersController < UsersController
|
||||||
params.require(:dossier).permit(:id, :autorisation_donnees, individual_attributes: [:gender, :nom, :prenom, :birthdate])
|
params.require(:dossier).permit(:id, :autorisation_donnees, individual_attributes: [:gender, :nom, :prenom, :birthdate])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def update_params_with_formatted_birthdate
|
||||||
|
editable_params = update_params
|
||||||
|
|
||||||
|
# If the user was shown a date input field (if its browser supports it),
|
||||||
|
# the returned param will follow the YYYY-MM-DD pattern, which we need
|
||||||
|
# do convert to the DD/MM/YYYY pattern we use
|
||||||
|
if editable_params &&
|
||||||
|
editable_params[:individual_attributes] &&
|
||||||
|
editable_params[:individual_attributes][:birthdate] &&
|
||||||
|
editable_params[:individual_attributes][:birthdate] =~ /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/
|
||||||
|
|
||||||
|
original_birthdate = editable_params[:individual_attributes][:birthdate]
|
||||||
|
formatted_birthdate = I18n.l(original_birthdate.to_date, format: '%d/%m/%Y')
|
||||||
|
editable_params[:individual_attributes][:birthdate] = formatted_birthdate
|
||||||
|
end
|
||||||
|
|
||||||
|
editable_params
|
||||||
|
end
|
||||||
|
|
||||||
def checked_autorisation_donnees?
|
def checked_autorisation_donnees?
|
||||||
update_params[:autorisation_donnees] == '1'
|
update_params[:autorisation_donnees] == '1'
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
class TypeDePieceJustificativeDecorator < Draper::Decorator
|
class TypeDePieceJustificativeDecorator < Draper::Decorator
|
||||||
delegate_all
|
delegate_all
|
||||||
def button_up params
|
def button_up params
|
||||||
|
|
|
@ -201,6 +201,8 @@ class Dossier < ActiveRecord::Base
|
||||||
|
|
||||||
scope :archived, -> { where(archived: true) }
|
scope :archived, -> { where(archived: true) }
|
||||||
|
|
||||||
|
scope :downloadable, -> { all_state }
|
||||||
|
|
||||||
def cerfa_available?
|
def cerfa_available?
|
||||||
procedure.cerfa_flag? && cerfa.size != 0
|
procedure.cerfa_flag? && cerfa.size != 0
|
||||||
end
|
end
|
||||||
|
@ -261,23 +263,6 @@ class Dossier < ActiveRecord::Base
|
||||||
return headers
|
return headers
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.export_full_generation(dossiers, format)
|
|
||||||
if dossiers && !dossiers.empty?
|
|
||||||
data = []
|
|
||||||
headers = dossiers.first.export_headers
|
|
||||||
dossiers.each do |dossier|
|
|
||||||
data << dossier.convert_specific_array_values_to_string(dossier.data_with_champs)
|
|
||||||
end
|
|
||||||
if ["csv"].include?(format)
|
|
||||||
return SpreadsheetArchitect.to_csv(data: data, headers: headers)
|
|
||||||
elsif ["xlsx"].include?(format)
|
|
||||||
return SpreadsheetArchitect.to_xlsx(data: data, headers: headers)
|
|
||||||
elsif ["ods"].include?(format)
|
|
||||||
return SpreadsheetArchitect.to_ods(data: data, headers: headers)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def followers_gestionnaires_emails
|
def followers_gestionnaires_emails
|
||||||
follows.includes(:gestionnaire).map { |f| f.gestionnaire }.pluck(:email).join(' ')
|
follows.includes(:gestionnaire).map { |f| f.gestionnaire }.pluck(:email).join(' ')
|
||||||
end
|
end
|
||||||
|
|
|
@ -130,4 +130,18 @@ class Procedure < ActiveRecord::Base
|
||||||
self.dossiers.where.not(state: :draft).size
|
self.dossiers.where.not(state: :draft).size
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def generate_export
|
||||||
|
exportable_dossiers = dossiers.downloadable
|
||||||
|
|
||||||
|
headers = exportable_dossiers.any? ? exportable_dossiers.first.export_headers : []
|
||||||
|
data = exportable_dossiers.map do |dossier|
|
||||||
|
dossier.convert_specific_array_values_to_string(dossier.data_with_champs)
|
||||||
|
end
|
||||||
|
|
||||||
|
{
|
||||||
|
headers: headers,
|
||||||
|
data: data
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
- if @procedure.locked?
|
- if @procedure.locked?
|
||||||
.alert.alert-info
|
.alert.alert-info
|
||||||
Cette procédure est publiée, certains éléments de la description ne sont plus modifiables
|
Cette procédure est publiée, certains éléments de la description ne sont plus modifiables
|
||||||
|
@ -85,11 +84,8 @@
|
||||||
%h4 Options avancées
|
%h4 Options avancées
|
||||||
|
|
||||||
%label{ for: :auto_archive_on} Archivage automatique le
|
%label{ for: :auto_archive_on} Archivage automatique le
|
||||||
= f.text_field :auto_archive_on, id: 'auto_archive_on', value: @procedure.auto_archive_on.try{ |d| d.strftime("%d-%m-%Y") }, data: { provide: 'datepicker', 'date-format' => 'dd/mm/yyyy' }
|
= f.text_field :auto_archive_on, id: 'auto_archive_on', value: @procedure.auto_archive_on.try{ |d| d.strftime("%d-%m-%Y") }, data: { provide: 'datepicker', 'date-language' => 'fr', 'date-format' => 'dd/mm/yyyy' }
|
||||||
(à 00h00)
|
(à 00h00)
|
||||||
%p.help-block
|
%p.help-block
|
||||||
%i.fa.fa-info-circle
|
%i.fa.fa-info-circle
|
||||||
L'archivage automatique de la procédure entrainera le passage en instruction de tous les dossiers en construction.
|
L'archivage automatique de la procédure entrainera le passage en instruction de tous les dossiers en construction.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -46,5 +46,3 @@
|
||||||
= link_to("", @types_de_champ_facade.delete_url(ff), method: :delete, remote: true, id: "delete_type_de_champ_#{ff.object.id}", class: %w(form-control btn btn-danger fa fa-trash-o) )
|
= link_to("", @types_de_champ_facade.delete_url(ff), method: :delete, remote: true, id: "delete_type_de_champ_#{ff.object.id}", class: %w(form-control btn btn-danger fa fa-trash-o) )
|
||||||
|
|
||||||
%div{ style: 'background-color: rgb(204, 204, 204); height: 1px; margin: 30px auto;' }
|
%div{ style: 'background-color: rgb(204, 204, 204); height: 1px; margin: 30px auto;' }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,5 +11,3 @@
|
||||||
= follower.email
|
= follower.email
|
||||||
- else
|
- else
|
||||||
Aucune personne ne suit ce dossier
|
Aucune personne ne suit ce dossier
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -44,4 +44,3 @@
|
||||||
= columns.second[:libelle]
|
= columns.second[:libelle]
|
||||||
%button.btn.btn-default.btn-xs{type: :submit, id: "add_pref_list_#{columns.second[:table]}_#{columns.second[:attr]}"}
|
%button.btn.btn-default.btn-xs{type: :submit, id: "add_pref_list_#{columns.second[:table]}_#{columns.second[:attr]}"}
|
||||||
%i.fa.fa-plus
|
%i.fa.fa-plus
|
||||||
|
|
||||||
|
|
|
@ -14,4 +14,3 @@
|
||||||
dossiers
|
dossiers
|
||||||
%div.body
|
%div.body
|
||||||
= smart_listing_render :search
|
= smart_listing_render :search
|
||||||
|
|
||||||
|
|
|
@ -20,4 +20,3 @@
|
||||||
- else
|
- else
|
||||||
%h4.text-primary
|
%h4.text-primary
|
||||||
Pas de fichier dans le flux de commentaires.
|
Pas de fichier dans le flux de commentaires.
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,7 @@
|
||||||
%div.dropdown.pull-right#download-menu
|
.dropdown.pull-right#download-menu
|
||||||
- if @facade_data_view.dossiers_to_display.count > 400
|
%a.dropdown-toggle.button_navbar{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false }
|
||||||
%button.btn.btn-error.dropdown-toggle#dropdownDownloadMenu{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false, class: 'disabled'}
|
|
||||||
%span{'data-toggle' => :tooltip, "data-placement" => :left, title: 'Pour réduire le nombre de dossiers et ne pas dépasser la limite autorisée de 400, merci de bien vouloir appliquer des filtres.'}
|
|
||||||
= t('dynamics.backoffice.limit_excess_download_all_dossiers')
|
|
||||||
- else
|
|
||||||
%a.dropdown-toggle#dropdownDownloadMenu.button_navbar{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false }
|
|
||||||
%i.fa.fa-download
|
%i.fa.fa-download
|
||||||
= t('dynamics.backoffice.download_all_dossiers')
|
Télécharger tous les dossiers
|
||||||
%span.caret
|
%span.caret
|
||||||
%ul.dropdown-menu.dropdown-menu-right
|
%ul.dropdown-menu.dropdown-menu-right
|
||||||
%li
|
%li
|
||||||
|
|
|
@ -57,4 +57,3 @@
|
||||||
%div.col-xs-12.split-hr
|
%div.col-xs-12.split-hr
|
||||||
- unless @facade.entreprise.rna_information.nil?
|
- unless @facade.entreprise.rna_information.nil?
|
||||||
= render partial: '/dossiers/infos_rna'
|
= render partial: '/dossiers/infos_rna'
|
||||||
|
|
||||||
|
|
|
@ -20,4 +20,3 @@
|
||||||
|
|
||||||
%dt Capital déclaration :
|
%dt Capital déclaration :
|
||||||
%dd= @facade.entreprise.rna_information.date_declaration
|
%dd= @facade.entreprise.rna_information.date_declaration
|
||||||
|
|
||||||
|
|
|
@ -15,4 +15,3 @@
|
||||||
= form_tag invites_dossier_path(dossier_id: @facade.dossier.id), method: :post, class: 'form-inline' do
|
= form_tag invites_dossier_path(dossier_id: @facade.dossier.id), method: :post, class: 'form-inline' do
|
||||||
= text_field_tag :email, '', class: 'form-control', placeholder: 'Envoyer une invitation'
|
= text_field_tag :email, '', class: 'form-control', placeholder: 'Envoyer une invitation'
|
||||||
= submit_tag 'Ajouter', class: 'btn btn-success', id: 'send-invitation', data: {confirm: "Envoyer l'invitation ?"}
|
= submit_tag 'Ajouter', class: 'btn btn-success', id: 'send-invitation', data: {confirm: "Envoyer l'invitation ?"}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
%label
|
%label
|
||||||
%h4
|
%h4
|
||||||
Date de naissance *
|
Date de naissance *
|
||||||
= ff.text_field :birthdate, {class: 'form-control', 'data-provide' => 'datepicker', 'data-date-format' => 'dd/mm/yyyy'}
|
= ff.date_field :birthdate, {class: 'form-control', placeholder: 'jj/mm/aaaa'}
|
||||||
|
|
||||||
%p
|
%p
|
||||||
%label{ style:'font-weight:normal' }
|
%label{ style:'font-weight:normal' }
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
<%= link_to "Mot de passe oublié ?", new_password_path(resource_name) %><br />
|
<%= link_to "Mot de passe oublié ?", new_password_path(resource_name) %><br />
|
||||||
|
|
||||||
|
|
|
@ -6,4 +6,3 @@
|
||||||
Votre version d'Internet Explorer est trop ancienne pour être utilisée sur le service TPS. Version minimum : Internet Explorer 10
|
Votre version d'Internet Explorer est trop ancienne pour être utilisée sur le service TPS. Version minimum : Internet Explorer 10
|
||||||
|
|
||||||
="<![endif]-->".html_safe
|
="<![endif]-->".html_safe
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
%html
|
%html
|
||||||
%head
|
%head
|
||||||
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
|
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
|
||||||
|
%meta{ name: "turbolinks-cache-control", content: "no-cache" }
|
||||||
%title
|
%title
|
||||||
=t('dynamics.page_title')
|
=t('dynamics.page_title')
|
||||||
%meta{'http-equiv' => "X-UA-Compatible", :content => "IE=edge"}
|
%meta{'http-equiv' => "X-UA-Compatible", :content => "IE=edge"}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
%div#first-block
|
%div#first-block
|
||||||
%div.en-cours
|
%div.en-cours
|
||||||
-unless @procedure.logo.blank?
|
-unless @procedure.logo.blank?
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
= render partial: 'layouts/left_panels/left_panel_backoffice_dossierscontroller_index'
|
= render partial: 'layouts/left_panels/left_panel_backoffice_dossierscontroller_index'
|
||||||
|
|
||||||
|
|
|
@ -51,4 +51,3 @@
|
||||||
%div.procedure_list_element
|
%div.procedure_list_element
|
||||||
|
|
||||||
%div.procedure_list_element
|
%div.procedure_list_element
|
||||||
|
|
||||||
|
|
|
@ -85,5 +85,3 @@
|
||||||
= link_to 'Demander un accès administrateur', 'https://tps.apientreprise.fr/users/dossiers/new?procedure_id=31', {class: 'btn btn-lg background-tps', target: '_blank'}
|
= link_to 'Demander un accès administrateur', 'https://tps.apientreprise.fr/users/dossiers/new?procedure_id=31', {class: 'btn btn-lg background-tps', target: '_blank'}
|
||||||
|
|
||||||
.split-hr-left
|
.split-hr-left
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
%script{type: 'text/javascript'}
|
%script{type: 'text/javascript'}
|
||||||
="var dossier_id =#{dossier.id}"
|
="var dossier_id =#{dossier.id}"
|
||||||
$(document).on('page:load', initCarto);
|
$(document).on('turbolinks:load', initCarto);
|
||||||
$(document).ready(initCarto);
|
|
||||||
|
|
|
@ -10,4 +10,3 @@
|
||||||
#cadastre.list
|
#cadastre.list
|
||||||
%h3.text-warning Cadastres
|
%h3.text-warning Cadastres
|
||||||
%ul
|
%ul
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
%table.table
|
%table.table
|
||||||
- if dossier.procedure.cerfa_flag
|
- if dossier.procedure.cerfa_flag
|
||||||
%tr
|
%tr
|
||||||
|
|
|
@ -25,6 +25,3 @@
|
||||||
|
|
||||||
- if @user.email != DemoEmails[:gestionnaire] && @user.email != DemoEmails[:admin]
|
- if @user.email != DemoEmails[:gestionnaire] && @user.email != DemoEmails[:admin]
|
||||||
= render "users/shared/links"
|
= render "users/shared/links"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
.container.center#users_siret_index
|
.container.center#users_siret_index
|
||||||
.row
|
.row
|
||||||
= render partial: 'pro'
|
= render partial: 'pro'
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
development:
|
development:
|
||||||
adapter: postgresql
|
adapter: postgresql
|
||||||
encoding: unicode
|
encoding: unicode
|
||||||
|
|
|
@ -85,7 +85,6 @@ set :shared_paths, [
|
||||||
"config/initializers/super_admin.rb",
|
"config/initializers/super_admin.rb",
|
||||||
"config/unicorn.rb",
|
"config/unicorn.rb",
|
||||||
"config/initializers/raven.rb",
|
"config/initializers/raven.rb",
|
||||||
"config/locales/dynamics/fr.yml",
|
|
||||||
'config/france_connect.yml',
|
'config/france_connect.yml',
|
||||||
'config/initializers/mailjet.rb',
|
'config/initializers/mailjet.rb',
|
||||||
'config/initializers/storage_url.rb',
|
'config/initializers/storage_url.rb',
|
||||||
|
|
|
@ -4,4 +4,3 @@ Sidekiq.configure_server do |config|
|
||||||
schedule_file = "config/schedule.yml"
|
schedule_file = "config/schedule.yml"
|
||||||
Sidekiq::Cron::Job.load_from_hash YAML.load_file(schedule_file)
|
Sidekiq::Cron::Job.load_from_hash YAML.load_file(schedule_file)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
fr:
|
fr:
|
||||||
dynamics:
|
dynamics:
|
||||||
page_title: TPS - Téléprocédures simplifiées
|
page_title: 'TPS - Téléprocédures simplifiées'
|
||||||
contact_email: contact@tps.apientreprise.fr
|
contact_email: contact@tps.apientreprise.fr
|
||||||
users:
|
users:
|
||||||
connexion_title: Connexion
|
connexion_title: Connexion
|
||||||
|
@ -12,8 +12,6 @@ fr:
|
||||||
pref_list:
|
pref_list:
|
||||||
title: 'Gestion de colonnes affichées'
|
title: 'Gestion de colonnes affichées'
|
||||||
description: 'Ce menu vous permet de choisir les différentes colonnes que vous souhaitez voir apparaître dans votre interface de suivi des dossiers.'
|
description: 'Ce menu vous permet de choisir les différentes colonnes que vous souhaitez voir apparaître dans votre interface de suivi des dossiers.'
|
||||||
download_all_dossiers: 'Télécharger mes dossiers'
|
|
||||||
limit_excess_download_all_dossiers: 'Limite de dossiers fixée à 400 pour le téléchargement'
|
|
||||||
format_csv: 'Au format CSV'
|
format_csv: 'Au format CSV'
|
||||||
format_xlsx: 'Au format XLSX'
|
format_xlsx: 'Au format XLSX'
|
||||||
format_ods: 'Au format ODS'
|
format_ods: 'Au format ODS'
|
||||||
|
|
|
@ -30,4 +30,3 @@ fr:
|
||||||
blank: 'doit être rempli'
|
blank: 'doit être rempli'
|
||||||
date_previsionnelle:
|
date_previsionnelle:
|
||||||
blank: 'doit être remplie'
|
blank: 'doit être remplie'
|
||||||
|
|
||||||
|
|
|
@ -15,5 +15,3 @@ fr:
|
||||||
blank: 'doit être rempli'
|
blank: 'doit être rempli'
|
||||||
birthdate:
|
birthdate:
|
||||||
blank: 'doit être rempli'
|
blank: 'doit être rempli'
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,4 +28,3 @@ describe UsersController, type: :controller do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe TypeDeChampDecorator do
|
describe TypeDeChampDecorator do
|
||||||
|
|
|
@ -9,21 +9,38 @@ feature 'As a User I wanna create a dossier' do
|
||||||
let(:procedure_with_siret) { create(:procedure, :published, :with_api_carto, :with_type_de_champ, :with_two_type_de_piece_justificative) }
|
let(:procedure_with_siret) { create(:procedure, :published, :with_api_carto, :with_type_de_champ, :with_two_type_de_piece_justificative) }
|
||||||
let(:procedure_for_individual) { create(:procedure, :published, :for_individual, :with_api_carto, :with_type_de_champ, :with_two_type_de_piece_justificative) }
|
let(:procedure_for_individual) { create(:procedure, :published, :for_individual, :with_api_carto, :with_type_de_champ, :with_two_type_de_piece_justificative) }
|
||||||
|
|
||||||
scenario 'Identification for individual' do
|
context 'Identification for individual' 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 'dossier_individual_attributes_nom', with: 'Nom'
|
||||||
fill_in 'dossier_individual_attributes_prenom', with: 'Prenom'
|
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)
|
find(:css, "#dossier_autorisation_donnees[value='1']").set(true)
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario "with a proper date input field for birthdate (type='date' supported)" do
|
||||||
|
fill_in 'dossier_individual_attributes_birthdate', with: '1987-10-14'
|
||||||
page.find_by_id('etape_suivante').click
|
page.find_by_id('etape_suivante').click
|
||||||
expect(page).to have_current_path(users_dossier_carte_path(procedure_for_individual.dossiers.last.id.to_s), only_path: true)
|
expect(page).to have_current_path(users_dossier_carte_path(procedure_for_individual.dossiers.last.id.to_s), only_path: true)
|
||||||
page.find_by_id('etape_suivante').click
|
page.find_by_id('etape_suivante').click
|
||||||
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'
|
||||||
page.find_by_id('suivant').click
|
page.find_by_id('suivant').click
|
||||||
|
expect(user.dossiers.first.individual.birthdate).to eq("14/10/1987")
|
||||||
expect(page).to have_current_path(users_dossier_recapitulatif_path(procedure_for_individual.dossiers.last.id.to_s), only_path: true)
|
expect(page).to have_current_path(users_dossier_recapitulatif_path(procedure_for_individual.dossiers.last.id.to_s), only_path: true)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "with a basic text input field for birthdate (type='date' unsupported)" do
|
||||||
|
fill_in 'dossier_individual_attributes_birthdate', with: '14/10/1987'
|
||||||
|
page.find_by_id('etape_suivante').click
|
||||||
|
expect(page).to have_current_path(users_dossier_carte_path(procedure_for_individual.dossiers.last.id.to_s), only_path: true)
|
||||||
|
page.find_by_id('etape_suivante').click
|
||||||
|
fill_in "champs_#{procedure_for_individual.dossiers.last.champs.first.id}", with: 'contenu du champ 1'
|
||||||
|
page.find_by_id('suivant').click
|
||||||
|
expect(user.dossiers.first.individual.birthdate).to eq("14/10/1987")
|
||||||
|
expect(page).to have_current_path(users_dossier_recapitulatif_path(procedure_for_individual.dossiers.last.id.to_s), only_path: true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
scenario 'Identification through siret', vcr: {cassette_name: 'search_ban_paris'}, js: true do
|
scenario 'Identification through siret', vcr: {cassette_name: 'search_ban_paris'}, js: true do
|
||||||
login_as user, scope: :user
|
login_as user, scope: :user
|
||||||
visit commencer_path(procedure_path: procedure_with_siret.path)
|
visit commencer_path(procedure_path: procedure_with_siret.path)
|
||||||
|
|
|
@ -603,7 +603,6 @@ describe Dossier do
|
||||||
let(:dossier) { create(:dossier, :with_entreprise, user: user, procedure: procedure, follows: [follow], initiated_at: date1, received_at: date2, processed_at: date3) }
|
let(:dossier) { create(:dossier, :with_entreprise, user: user, procedure: procedure, follows: [follow], initiated_at: date1, received_at: date2, processed_at: date3) }
|
||||||
|
|
||||||
describe '#export_headers' do
|
describe '#export_headers' do
|
||||||
|
|
||||||
subject { dossier.export_headers }
|
subject { dossier.export_headers }
|
||||||
|
|
||||||
it { expect(subject).to include(:description) }
|
it { expect(subject).to include(:description) }
|
||||||
|
@ -611,7 +610,6 @@ describe Dossier do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#data_with_champs' do
|
describe '#data_with_champs' do
|
||||||
|
|
||||||
subject { dossier.data_with_champs }
|
subject { dossier.data_with_champs }
|
||||||
|
|
||||||
it { expect(subject[0]).to be_a_kind_of(Integer) }
|
it { expect(subject[0]).to be_a_kind_of(Integer) }
|
||||||
|
@ -670,7 +668,6 @@ describe Dossier do
|
||||||
it { expect(subject[:entreprise_prenom]).to be_nil }
|
it { expect(subject[:entreprise_prenom]).to be_nil }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
describe '#Dossier.to_xlsx' do
|
describe '#Dossier.to_xlsx' do
|
||||||
let!(:procedure) { create(:procedure) }
|
let!(:procedure) { create(:procedure) }
|
||||||
let!(:dossier) { create(:dossier, :with_entreprise, user: user, procedure: procedure) }
|
let!(:dossier) { create(:dossier, :with_entreprise, user: user, procedure: procedure) }
|
||||||
|
@ -966,4 +963,17 @@ describe Dossier do
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '.downloadable' do
|
||||||
|
let(:procedure) { create(:procedure) }
|
||||||
|
let!(:dossier) { create(:dossier, :with_entreprise, procedure: procedure, state: :draft) }
|
||||||
|
let!(:dossier2) { create(:dossier, :with_entreprise, procedure: procedure, state: :initiated) }
|
||||||
|
let!(:dossier3) { create(:dossier, :with_entreprise, procedure: procedure, state: :received) }
|
||||||
|
|
||||||
|
subject { procedure.dossiers.downloadable }
|
||||||
|
|
||||||
|
it { is_expected.not_to include(dossier)}
|
||||||
|
it { is_expected.to include(dossier2)}
|
||||||
|
it { is_expected.to include(dossier3)}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -256,4 +256,29 @@ describe Procedure do
|
||||||
|
|
||||||
it { is_expected.to eq 2 }
|
it { is_expected.to eq 2 }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '#generate_export' do
|
||||||
|
let(:procedure) { create :procedure }
|
||||||
|
subject { procedure.generate_export }
|
||||||
|
|
||||||
|
context 'when there are no dossiers' do
|
||||||
|
it { expect(subject[:data]).to eq([]) }
|
||||||
|
it { expect(subject[:headers]).to eq([]) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when there are some dossiers' do
|
||||||
|
let!(:dossier){ create(:dossier, procedure: procedure, state: 'initiated') }
|
||||||
|
let!(:dossier2){ create(:dossier, procedure: procedure, state: 'closed') }
|
||||||
|
|
||||||
|
it { expect(subject[:data].size).to eq(2) }
|
||||||
|
it { expect(subject[:headers]).to eq(dossier.export_headers) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when there is a draft dossier' do
|
||||||
|
let!(:dossier_not_exportable){ create(:dossier, procedure: procedure, state: 'draft') }
|
||||||
|
|
||||||
|
it { expect(subject[:data]).to eq([]) }
|
||||||
|
it { expect(subject[:headers]).to eq([]) }
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,4 +6,3 @@ describe TypeDeChamp do
|
||||||
|
|
||||||
it_should_behave_like "type_de_champ_spec"
|
it_should_behave_like "type_de_champ_spec"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
# config.include Devise::TestHelpers, type: :controller
|
# config.include Devise::TestHelpers, type: :controller
|
||||||
end
|
end
|
||||||
|
|
1
vendor/assets/javascripts/franceconnect.js
vendored
1
vendor/assets/javascripts/franceconnect.js
vendored
|
@ -147,4 +147,3 @@ var franceConnectKit = {};
|
||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
})(this);
|
})(this);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue