after_id -> after_stable_id

This commit is contained in:
simon lehericey 2022-07-02 16:17:50 +02:00
parent 5dd5bd90ce
commit 1342356651
4 changed files with 6 additions and 4 deletions

View file

@ -34,7 +34,7 @@ class TypesDeChampEditor::AddChampButtonComponent < ApplicationComponent
type_champ: TypeDeChamp.type_champs.fetch(:text), type_champ: TypeDeChamp.type_champs.fetch(:text),
private: annotations? ? true : nil, private: annotations? ? true : nil,
parent_id: @parent&.stable_id, parent_id: @parent&.stable_id,
after_id: '' after_stable_id: ''
}.compact }.compact
} }
} }

View file

@ -55,7 +55,7 @@ module Administrateurs
def type_de_champ_create_params def type_de_champ_create_params
params params
.required(:type_de_champ) .required(:type_de_champ)
.permit(:type_champ, :parent_id, :private, :libelle, :after_id) .permit(:type_champ, :parent_id, :private, :libelle, :after_stable_id)
end end
def type_de_champ_update_params def type_de_champ_update_params

View file

@ -139,7 +139,7 @@ export class TypeDeChampEditorController extends ApplicationController {
? '.add-to-block' ? '.add-to-block'
: '.add-to-root'; : '.add-to-root';
const input = parent.querySelector<HTMLInputElement>( const input = parent.querySelector<HTMLInputElement>(
`${selector} ${AFTER_ID_INPUT_SELECTOR}` `${selector} ${AFTER_STABLE_ID_INPUT_SELECTOR}`
); );
if (input) { if (input) {
input.value = this.typeDeChampIdValue; input.value = this.typeDeChampIdValue;
@ -148,7 +148,8 @@ export class TypeDeChampEditorController extends ApplicationController {
} }
} }
const AFTER_ID_INPUT_SELECTOR = 'input[name="type_de_champ[after_id]"]'; const AFTER_STABLE_ID_INPUT_SELECTOR =
'input[name="type_de_champ[after_stable_id]"]';
function createForm(action: string, method: string) { function createForm(action: string, method: string) {
const form = document.createElement('form'); const form = document.createElement('form');

View file

@ -45,6 +45,7 @@ class ProcedureRevision < ApplicationRecord
def add_type_de_champ(params) def add_type_de_champ(params)
parent_stable_id = params.delete(:parent_id) parent_stable_id = params.delete(:parent_id)
after_stable_id = params.delete(:after_id) after_stable_id = params.delete(:after_id)
after_stable_id = params.delete(:after_stable_id)
coordinate = {} coordinate = {}