feat(revision): list updated placeholder option for generic type de champ
This commit is contained in:
parent
93d18e2f53
commit
fe0282e904
4 changed files with 26 additions and 1 deletions
|
@ -379,6 +379,18 @@ class ProcedureRevision < ApplicationRecord
|
||||||
stable_id: from_type_de_champ.stable_id
|
stable_id: from_type_de_champ.stable_id
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
if from_type_de_champ.placeholder != to_type_de_champ.placeholder
|
||||||
|
changes << {
|
||||||
|
model: :type_de_champ,
|
||||||
|
op: :update,
|
||||||
|
attribute: :placeholder,
|
||||||
|
label: from_type_de_champ.libelle,
|
||||||
|
private: from_type_de_champ.private?,
|
||||||
|
from: from_type_de_champ.placeholder,
|
||||||
|
to: to_type_de_champ.placeholder,
|
||||||
|
stable_id: from_type_de_champ.stable_id
|
||||||
|
}
|
||||||
|
end
|
||||||
if to_type_de_champ.drop_down_list?
|
if to_type_de_champ.drop_down_list?
|
||||||
if from_type_de_champ.drop_down_list_options != to_type_de_champ.drop_down_list_options
|
if from_type_de_champ.drop_down_list_options != to_type_de_champ.drop_down_list_options
|
||||||
changes << {
|
changes << {
|
||||||
|
|
|
@ -44,6 +44,8 @@
|
||||||
%li.mb-1= t("administrateurs.revision_changes.update_drop_down_other#{postfix}.enabled", label: change[:label])
|
%li.mb-1= t("administrateurs.revision_changes.update_drop_down_other#{postfix}.enabled", label: change[:label])
|
||||||
- else
|
- else
|
||||||
%li.mb-1= t("administrateurs.revision_changes.update_drop_down_other#{postfix}.disabled", label: change[:label])
|
%li.mb-1= t("administrateurs.revision_changes.update_drop_down_other#{postfix}.disabled", label: change[:label])
|
||||||
|
- when :placeholder
|
||||||
|
%li.mb-1= t("update_placeholder#{postfix}", label: change[:label], to: change[:to], scope: [:administrateurs, :revision_changes])
|
||||||
- when :carte_layers
|
- when :carte_layers
|
||||||
- added = change[:to].sort - change[:from].sort
|
- added = change[:to].sort - change[:from].sort
|
||||||
- removed = change[:from].sort - change[:to].sort
|
- removed = change[:from].sort - change[:to].sort
|
||||||
|
|
|
@ -28,6 +28,7 @@ fr:
|
||||||
enabled: Le champ « %{label} » comporte maintenant un choix « Autre »
|
enabled: Le champ « %{label} » comporte maintenant un choix « Autre »
|
||||||
disabled: Le champ « %{label} » ne comporte plus de choix « Autre »
|
disabled: Le champ « %{label} » ne comporte plus de choix « Autre »
|
||||||
update_carte_layers: Les référentiels cartographiques du champ « %{label} » ont été modifiés
|
update_carte_layers: Les référentiels cartographiques du champ « %{label} » ont été modifiés
|
||||||
|
update_placeholder: Le spécimen de saisie du champ « %{label} » a été modifié. Le nouveau spécimen est « %{to} ».
|
||||||
add_private: L’annotation privée « %{label} » a été ajoutée
|
add_private: L’annotation privée « %{label} » a été ajoutée
|
||||||
remove_private: L’annotation privée « %{label} » a été supprimée
|
remove_private: L’annotation privée « %{label} » a été supprimée
|
||||||
move_private:
|
move_private:
|
||||||
|
|
|
@ -329,7 +329,7 @@ describe ProcedureRevision do
|
||||||
before do
|
before do
|
||||||
updated_tdc = new_draft.find_and_ensure_exclusive_use(first_tdc.stable_id)
|
updated_tdc = new_draft.find_and_ensure_exclusive_use(first_tdc.stable_id)
|
||||||
|
|
||||||
updated_tdc.update(libelle: 'modifier le libelle', description: 'une description', mandatory: !updated_tdc.mandatory)
|
updated_tdc.update(libelle: 'modifier le libelle', description: 'une description', mandatory: !updated_tdc.mandatory, placeholder: "new placeholder")
|
||||||
end
|
end
|
||||||
|
|
||||||
it do
|
it do
|
||||||
|
@ -363,6 +363,16 @@ describe ProcedureRevision do
|
||||||
from: false,
|
from: false,
|
||||||
to: true,
|
to: true,
|
||||||
stable_id: first_tdc.stable_id
|
stable_id: first_tdc.stable_id
|
||||||
|
},
|
||||||
|
{
|
||||||
|
model: :type_de_champ,
|
||||||
|
op: :update,
|
||||||
|
attribute: :placeholder,
|
||||||
|
label: first_tdc.libelle,
|
||||||
|
private: false,
|
||||||
|
from: first_tdc.placeholder,
|
||||||
|
to: "new placeholder",
|
||||||
|
stable_id: first_tdc.stable_id
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue