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

@ -118,24 +118,22 @@ export default {
</style>
<template>
<div>
<div class="new-relation" v-for="(instance, ri) in instances" :key="ri">
<b>{{ model.name }} -&gt; {{ related_model.name }}
<select v-model="instance.related">
<option v-for="(name, id) in object_names" :value="id">{{name}}</option>
</select>
</b>
<a href="#" v-if="model.multiple || model.optional && instances.length > 0"
style="margin-left: 5px"
@click="removeInstance(ri)">X</a>
<table v-if="properties">
<property v-for="(property, id) in properties" :model="property" :values="instance.values[id]" :key="id"></property>
</table>
</div>
<a href="#" v-if="model.multiple || model.optional && instances.length==0"
@click="addInstance">Add {{ model.name }} -&gt; {{ related_model.name }}</a>
<div class="new-relation" v-for="(instance, ri) in instances" :key="ri">
<b>{{ model.name }} -&gt; {{ related_model.name }}
<select v-model="instance.related">
<option v-for="(name, id) in object_names" :value="id">{{name}}</option>
</select>
</b>
<a href="#" v-if="model.multiple || model.optional && instances.length > 0"
style="margin-left: 5px"
@click="removeInstance(ri)">X</a>
<table v-if="properties">
<property v-for="(property, id) in properties" :model="property" :values="instance.values[id]" :key="id"></property>
</table>
</div>
<a href="#" v-if="model.multiple || model.optional && instances.length==0"
@click="addInstance">Add {{ model.name }} -&gt; {{ related_model.name }}</a><br>
</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