Merge branch 'dev'
This commit is contained in:
commit
af7a9b59a6
11 changed files with 78 additions and 10 deletions
|
@ -18,3 +18,9 @@
|
||||||
margin-bottom: -1px;
|
margin-bottom: -1px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mixed-buttons-bar .button {
|
||||||
|
// Needed so that buttons without text
|
||||||
|
// are ligned with those that have text
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
|
@ -93,8 +93,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.icon-only .icon {
|
&.icon-only {
|
||||||
margin-right: 0;
|
padding: 9px 16px;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class Avis < ApplicationRecord
|
class Avis < ApplicationRecord
|
||||||
belongs_to :dossier
|
belongs_to :dossier, touch: true
|
||||||
belongs_to :gestionnaire
|
belongs_to :gestionnaire
|
||||||
belongs_to :claimant, class_name: 'Gestionnaire'
|
belongs_to :claimant, class_name: 'Gestionnaire'
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class Cadastre < ActiveRecord::Base
|
class Cadastre < ActiveRecord::Base
|
||||||
belongs_to :dossier
|
belongs_to :dossier, touch: true
|
||||||
|
|
||||||
def geometry
|
def geometry
|
||||||
JSON.parse(read_attribute(:geometry))
|
JSON.parse(read_attribute(:geometry))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class Cerfa < ActiveRecord::Base
|
class Cerfa < ActiveRecord::Base
|
||||||
belongs_to :dossier
|
belongs_to :dossier, touch: true
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
|
||||||
mount_uploader :content, CerfaUploader
|
mount_uploader :content, CerfaUploader
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class Champ < ActiveRecord::Base
|
class Champ < ActiveRecord::Base
|
||||||
belongs_to :dossier
|
belongs_to :dossier, touch: true
|
||||||
belongs_to :type_de_champ
|
belongs_to :type_de_champ
|
||||||
has_many :commentaires
|
has_many :commentaires
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class Commentaire < ActiveRecord::Base
|
class Commentaire < ActiveRecord::Base
|
||||||
belongs_to :dossier
|
belongs_to :dossier, touch: true
|
||||||
belongs_to :champ
|
belongs_to :champ
|
||||||
|
|
||||||
belongs_to :piece_justificative
|
belongs_to :piece_justificative
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class PieceJustificative < ActiveRecord::Base
|
class PieceJustificative < ActiveRecord::Base
|
||||||
belongs_to :dossier
|
belongs_to :dossier, touch: true
|
||||||
belongs_to :type_de_piece_justificative
|
belongs_to :type_de_piece_justificative
|
||||||
has_one :commentaire
|
has_one :commentaire
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
class QuartierPrioritaire < ActiveRecord::Base
|
class QuartierPrioritaire < ActiveRecord::Base
|
||||||
belongs_to :dossier
|
belongs_to :dossier, touch: true
|
||||||
|
|
||||||
def geometry
|
def geometry
|
||||||
JSON.parse(read_attribute(:geometry))
|
JSON.parse(read_attribute(:geometry))
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
= link_to dossier.procedure.libelle.truncate_words(10), procedure_path(dossier.procedure), title: dossier.procedure.libelle
|
= link_to dossier.procedure.libelle.truncate_words(10), procedure_path(dossier.procedure), title: dossier.procedure.libelle
|
||||||
%li
|
%li
|
||||||
= "Dossier nº #{dossier.id}"
|
= "Dossier nº #{dossier.id}"
|
||||||
%div
|
.mixed-buttons-bar
|
||||||
= link_to print_dossier_path(dossier.procedure, dossier), target: "_blank", class: "button icon-only" do
|
= link_to print_dossier_path(dossier.procedure, dossier), target: "_blank", class: "button icon-only" do
|
||||||
.icon.printer>
|
.icon.printer>
|
||||||
= render partial: "new_gestionnaire/procedures/dossier_actions", locals: { procedure: dossier.procedure, dossier: dossier, dossier_is_followed: current_gestionnaire&.follow?(dossier) }
|
= render partial: "new_gestionnaire/procedures/dossier_actions", locals: { procedure: dossier.procedure, dossier: dossier, dossier_is_followed: current_gestionnaire&.follow?(dossier) }
|
||||||
|
|
|
@ -886,4 +886,62 @@ describe Dossier do
|
||||||
it { expect(dossier.get_value('type_de_champ', @champ_public.type_de_champ.id.to_s)).to eq(dossier.champs.first.value) }
|
it { expect(dossier.get_value('type_de_champ', @champ_public.type_de_champ.id.to_s)).to eq(dossier.champs.first.value) }
|
||||||
it { expect(dossier.get_value('type_de_champ_private', @champ_private.type_de_champ.id.to_s)).to eq(dossier.champs_private.first.value) }
|
it { expect(dossier.get_value('type_de_champ_private', @champ_private.type_de_champ.id.to_s)).to eq(dossier.champs_private.first.value) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'updated_at', focus: true do
|
||||||
|
let!(:dossier) { create(:dossier) }
|
||||||
|
let(:modif_date) { DateTime.parse('01/01/2100') }
|
||||||
|
|
||||||
|
before { Timecop.freeze(modif_date) }
|
||||||
|
|
||||||
|
subject do
|
||||||
|
dossier.reload
|
||||||
|
dossier.updated_at
|
||||||
|
end
|
||||||
|
|
||||||
|
it { is_expected.not_to eq(modif_date) }
|
||||||
|
|
||||||
|
context 'when a cerfa is modified' do
|
||||||
|
before { dossier.cerfa << create(:cerfa) }
|
||||||
|
|
||||||
|
it { is_expected.to eq(modif_date) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when a piece justificative is modified' do
|
||||||
|
before { dossier.pieces_justificatives << create(:piece_justificative, :contrat) }
|
||||||
|
|
||||||
|
it { is_expected.to eq(modif_date) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when a champ is modified' do
|
||||||
|
before { dossier.champs.first.update_attribute('value', 'yop') }
|
||||||
|
|
||||||
|
it { is_expected.to eq(modif_date) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when a quartier_prioritaire is modified' do
|
||||||
|
before { dossier.quartier_prioritaires << create(:quartier_prioritaire) }
|
||||||
|
|
||||||
|
it { is_expected.to eq(modif_date) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when a cadastre is modified' do
|
||||||
|
before { dossier.cadastres << create(:cadastre) }
|
||||||
|
|
||||||
|
it { is_expected.to eq(modif_date) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when a commentaire is modified' do
|
||||||
|
before { dossier.commentaires << create(:commentaire) }
|
||||||
|
|
||||||
|
it { is_expected.to eq(modif_date) }
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when an avis is modified' do
|
||||||
|
before { dossier.avis << create(:avis) }
|
||||||
|
|
||||||
|
it { is_expected.to eq(modif_date) }
|
||||||
|
end
|
||||||
|
|
||||||
|
after { Timecop.return }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue