Skip to content

Commit

Permalink
fix agent form not filling saved identifier values
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Aug 4, 2024
1 parent 109083c commit 73aff2a
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions app/views/agents/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
%th
= t("agents.form.identifiers")
%td.top
%div.agents-identifiers{'data-form-options-display-target':"option1", class: affiliation?(agent) && 'd-none'}
%div.agents-identifiers{'data-form-options-display-target':"option1", class: is_organization?(agent) && 'd-none'}
= render NestedFormInputsComponent.new do |c|
- c.template do
%div.d-flex{id: 'NEW_RECORD'}
Expand All @@ -67,8 +67,15 @@

- c.empty_state do
= hidden_field_tag agent_field_name('', name_prefix+"[#{Array(agent.identifiers).size}]")
- Array(agent.identifiers).each_with_index do |identifier, i|
- c.row do
%div.d-flex{id: 'NEW_RECORD'}
%div.w-100
= hidden_field_tag agent_identifier_name(i.to_s.upcase, :creator, name_prefix), session[:user].id
= inline_svg_tag 'orcid.svg', class: 'agent-input-icon'
= text_field_tag agent_identifier_name(i.to_s.upcase, :notation, name_prefix), identifier.notation, class: "agent-input-with-icon"

%div.agents-identifiers{'data-form-options-display-target':"option2", class: !affiliation?(agent) && 'd-none'}
%div.agents-identifiers{'data-form-options-display-target':"option2", class: !is_organization?(agent) && 'd-none'}
= render NestedFormInputsComponent.new do |c|
- c.template do
%div.d-flex{id: 'NEW_RECORD'}
Expand All @@ -78,6 +85,15 @@
= text_field_tag agent_identifier_name('NEW_RECORD' , :notation, name_prefix), '', class: "agent-input-with-icon"
- c.empty_state do
= hidden_field_tag agent_field_name('', name_prefix+"[#{Array(agent.identifiers).size}]")
- Array(agent.identifiers).each_with_index do |identifier, i|
- c.row do
%div.d-flex{id: 'NEW_RECORD'}
%div.w-100
= hidden_field_tag agent_identifier_name(i.to_s.upcase, :creator, name_prefix), session[:user].id
= inline_svg_tag 'icons/ror.svg', class: 'agent-input-icon'
= text_field_tag agent_identifier_name(i.to_s.upcase, :notation, name_prefix), identifier.notation, class: "agent-input-with-icon"



- if show_affiliations
%tr{'data-form-options-display-target':"option1", class: is_organization?(agent) && 'd-none'}
Expand Down

0 comments on commit 73aff2a

Please sign in to comment.