fix the relations bug

master
Ondřej Hruška 4 years ago
parent 61d5791479
commit b24a8b2805
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 3
      yopa-web/resources/src/components/NewObjectForm.vue
  2. 4
      yopa-web/resources/src/components/NewRelationForm.vue
  3. 2
      yopa-web/resources/static/bundle.js
  4. 2
      yopa-web/resources/static/bundle.js.map

@ -36,6 +36,7 @@ export default {
model, model,
properties, properties,
relations, relations,
haveRelations: !isEmpty(relations),
model_names, model_names,
values, values,
name: '', name: '',
@ -132,7 +133,7 @@ export default {
<property v-for="(property, pi) in properties" :model="property" :values="values[property.id]" :key="pi"></property> <property v-for="(property, pi) in properties" :model="property" :values="values[property.id]" :key="pi"></property>
</table> </table>
<div v-if="relations.length > 0"> <div v-if="haveRelations">
<h3>Relations</h3> <h3>Relations</h3>
<new-relation <new-relation

@ -118,7 +118,6 @@ export default {
</style> </style>
<template> <template>
<div>
<div class="new-relation" v-for="(instance, ri) in instances" :key="ri"> <div class="new-relation" v-for="(instance, ri) in instances" :key="ri">
<b>{{ model.name }} -&gt; {{ related_model.name }} <b>{{ model.name }} -&gt; {{ related_model.name }}
<select v-model="instance.related"> <select v-model="instance.related">
@ -136,6 +135,5 @@ export default {
</div> </div>
<a href="#" v-if="model.multiple || model.optional && instances.length==0" <a href="#" v-if="model.multiple || model.optional && instances.length==0"
@click="addInstance">Add {{ model.name }} -&gt; {{ related_model.name }}</a> @click="addInstance">Add {{ model.name }} -&gt; {{ related_model.name }}</a><br>
</div>
</template> </template>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save