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

Conversation

jeremyf
Copy link
Contributor

@jeremyf jeremyf commented Oct 10, 2023

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][].

Before removing partial ```
Date Created

The date on which the work was created.

```
After removing partial ```
Date Created

The date on which the collection was created.

  • Remove previous
  • Remove previous
  •   </ul><button type="button" class="btn btn-link add"><span class="glyphicon glyphicon-plus"></span><span class="controls-add-text">Add another</span></button>
    
```

Related to:

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 jeremyf merged commit b4c2a45 into main Oct 10, 2023
7 checks passed
@jeremyf jeremyf deleted the remove-date-created-edit-field branch October 10, 2023 16:13
@laritakr laritakr mentioned this pull request Oct 11, 2023
1 task
laritakr added a commit that referenced this pull request Oct 12, 2023
Ref:
- https://github.com/scientist-softserv/adventist-dl/issues/632
Related to:
- #77

Property date_created was defined inconsistently, which broke creation
and editing of Image and GenericWork types.

This pull request adds a partial with a date picker for date_created and
removes `multiple: false` from the definition for GenericWork and
Image work types.

Additionally, several unused view partials are being removed, as they
were in the wrong path location and would never be hit.
jeremyf pushed a commit that referenced this pull request Oct 12, 2023
Ref:
- https://github.com/scientist-softserv/adventist-dl/issues/632
Related to:
- #77

Property date_created was defined inconsistently, which broke creation
and editing of Image and GenericWork types.

This pull request adds a partial with a date picker for date_created and
removes `multiple: false` from the definition for GenericWork and
Image work types.

Additionally, several unused view partials are being removed, as they
were in the wrong path location and would never be hit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants