<commit_before>- external = params[:external].to_s
- if external == "true"
  = f.input(:external, value: true, as: :hidden)
  = f.referenced_association(:initial_owner)
- elsif external == "false"
  = f.referenced_association(:initial_owner, as: :hidden, value: Entity.of_company)
- else
  = f.referenced_association(:initial_owner)
  = f.referenced_association(:initial_container, label: Product.human_attribute_name(:container), source: {scope: {can: "store(#{f.object.variety})"}}, input_html: { data: {product_of_delivery_item: {url: backend_product_path("RECORD_ID", format: :json)}}})

- unless f.object.population_counting_unitary?
  = f.input(:initial_population, wrapper: :append, class: :inline, label: Product.human_attribute_name(:population)) do
    = f.input_field(:initial_population, as: :string)
    %span.add-on= f.object.variant.unit_name

- if f.object.indicators_list.include? :shape
  = f.shape(:initial_shape, label: Product.human_attribute_name(:shape), input_html: { data: { "when-item": :shape, "when-set-value": "RECORD_VALUE" }})

- if f.object.indicators_list.include? :geolocation
  = f.geolocation(:initial_geolocation, label: Product.human_attribute_name(:geolocation))<commit_msg>Add shape reading's error messages to initial_shape instead since the shape reading is not displayed in the form<commit_after>- external = params[:external].to_s
- if external == "true"
  = f.input(:external, value: true, as: :hidden)
  = f.referenced_association(:initial_owner)
- elsif external == "false"
  = f.referenced_association(:initial_owner, as: :hidden, value: Entity.of_company)
- else
  = f.referenced_association(:initial_owner)
  = f.referenced_association(:initial_container, label: Product.human_attribute_name(:container), source: {scope: {can: "store(#{f.object.variety})"}}, input_html: { data: {product_of_delivery_item: {url: backend_product_path("RECORD_ID", format: :json)}}})

- unless f.object.population_counting_unitary?
  = f.input(:initial_population, wrapper: :append, class: :inline, label: Product.human_attribute_name(:population)) do
    = f.input_field(:initial_population, as: :string)
    %span.add-on= f.object.variant.unit_name

- if f.object.indicators_list.include? :shape
  - shape_reading = f.object.readings.find { |reading| reading.indicator_name.to_s == 'shape' }
  - if shape_reading
    - errors = shape_reading.errors.messages.values.flatten
    - errors.each do |error|
      - f.object.errors.add(:initial_shape, error)
  = f.shape(:initial_shape, label: Product.human_attribute_name(:shape), input_html: { data: { "when-item": :shape, "when-set-value": "RECORD_VALUE" }})

- if f.object.indicators_list.include? :geolocation
  = f.geolocation(:initial_geolocation, label: Product.human_attribute_name(:geolocation))
{'fraction_non_alphanumeric': 0.14701653486700217, 'fraction_numerical': 0.0, 'mean_word_length': 6.099489795918367, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1885454', 'n_tokens_mistral': 931, 'n_tokens_neox': 917, 'n_words': 168}