Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Remove partial to enable editing #77

Merged
merged 1 commit into from
Oct 10, 2023

Commits on Oct 10, 2023

  1. 🐛 Remove partial to enable editing

    Prior to this commit, when I'd create a Collection via the UI, I had a
    different control element for dates.  The value was an
    `ActiveTriple::Relation`, which is a tell tale sign of things going
    wrong.  Further, the name of the HTML `input` was
    `collection[date_created]` when it should've been `collection[date_created][]`.
    
    <details><summary>Before removing partial</summary>
    ```
    <div class="form-group optional nil_class_date_created">
      <label class="string optional" for="collection_date_created">Date Created</label>
      <br>
      <p class="help-block">The date on which the work was created.</p>
      <ul class="listing" aria-live="polite" style="padding: 0;">
        <li class="field-wrapper input-group input-append">
          <input value="#<ActiveTriples::Relation:0x0000ffff760e7240>" class="form-control" input_html="{:class=>&quot;form-control&quot;, :multiple=>false}" type="date" name="collection[date_created]" id="collection_date_created">
        </li>
      </ul>
    </div>
    ```
    </details>
    
    <details><summary>After removing partial</summary>
    ```
    <div class="form-group multi_value optional collection_date_created managed"><label class="control-label multi_value optional" for="collection_date_created">Date Created</label><p class="help-block">The date on which the collection was created.</p>    <ul class="listing" aria-live="polite">
                      <li class="field-wrapper input-group input-append">
                <input class="string multi_value optional form-control collection_date_created form-control multi-text-field" name="collection[date_created][]" value="07/04/1776" id="collection_date_created" aria-labelledby="collection_date_created_label" type="text">
              <span class="input-group-btn field-controls"><button type="button" class="btn btn-link remove"><span class="glyphicon glyphicon-remove"></span><span class="controls-remove-text">Remove</span> <span class="sr-only"> previous <span class="controls-field-name-text"></span></span></button></span></li>
              <li class="field-wrapper input-group input-append">
                <input class="string multi_value optional form-control collection_date_created form-control multi-text-field" name="collection[date_created][]" value="" aria-labelledby="collection_date_created_label" type="text">
              <span class="input-group-btn field-controls"><button type="button" class="btn btn-link remove"><span class="glyphicon glyphicon-remove"></span><span class="controls-remove-text">Remove</span> <span class="sr-only"> previous <span class="controls-field-name-text"></span></span></button></span></li>
    
          </ul><button type="button" class="btn btn-link add"><span class="glyphicon glyphicon-plus"></span><span class="controls-add-text">Add another</span></button>
    </div>
    ```
    </details>
    
    Related to:
    
    - https://github.com/scientist-softserv/adventist-dl/issues/620
    jeremyf committed Oct 10, 2023
    Configuration menu
    Copy the full SHA
    3344d79 View commit details
    Browse the repository at this point in the history