Skip to content

Commit

Permalink
Fixed +1 nested form level visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
yassilah committed Dec 18, 2018
1 parent a59377e commit 17de30d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 28 deletions.
2 changes: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

55 changes: 28 additions & 27 deletions resources/js/components/NestedFormField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,34 @@
</div>
</div>
<!-- HEADING -->

<!-- ERROR ON ATTACHED RESOURCE -->
<help-text class="error-text text-danger text-center m-4"
v-if="hasError">
{{ firstError }}
</help-text>
<!-- ERROR ON ATTACHED RESOURCE -->

<!-- ACTUAL FIELDS -->
<component v-for="subfield in child.fields"
:field="subfield"
:key="subfield.attribute"
:errors="errors"
:resource-name="field.resourceName"
:via-resource="field.viaResource"
:via-resource-id="field.viaResourceId"
:via-relationship="field.viaRelationship"
:is="`form-${getComponent(subfield)}`"
v-show="subfield.opened" />
<!-- ACTUAL FIELDS -->

<!-- DELETION MODAL -->
<DeleteModal :resourceSingularName="field.singularLabel"
@submit="remove"
@close="showDeleteModal = false"
v-if="showDeleteModal" />
<!-- DELETION MODAL -->
<div v-show="child.opened">

<!-- ERROR ON ATTACHED RESOURCE -->
<help-text class="error-text text-danger text-center m-4"
v-if="hasError">
{{ firstError }}
</help-text>
<!-- ERROR ON ATTACHED RESOURCE -->

<!-- ACTUAL FIELDS -->
<component v-for="subfield in child.fields"
:field="subfield"
:key="subfield.attribute"
:errors="errors"
:resource-name="field.resourceName"
:via-resource="field.viaResource"
:via-resource-id="field.viaResourceId"
:via-relationship="field.viaRelationship"
:is="`form-${getComponent(subfield)}`" />
<!-- ACTUAL FIELDS -->

<!-- DELETION MODAL -->
<DeleteModal :resourceSingularName="field.singularLabel"
@submit="remove"
@close="showDeleteModal = false"
v-if="showDeleteModal" />
<!-- DELETION MODAL -->
</div>

</div>
</template>
Expand Down

0 comments on commit 17de30d

Please sign in to comment.