Loading while creating group and variable error name fix on store

This commit is contained in:
mateuswetah 2020-05-07 17:46:56 -03:00
parent 8e830fb9d3
commit e68e034b09
2 changed files with 16 additions and 11 deletions

View File

@ -70,6 +70,14 @@
 {{ $i18n.get('label_remove_value') }}  {{ $i18n.get('label_remove_value') }}
</a> </a>
</template> </template>
<transition name="filter-item">
<span
v-if="isCreatingGroup"
style="width: 100%;"
class="icon has-text-success loading-icon">
<div class="control has-icons-right is-loading is-clearfix" />
</span>
</transition>
</div> </div>
<p <p
v-else v-else
@ -84,10 +92,7 @@
<span class="icon is-small"> <span class="icon is-small">
<i class="tainacan-icon has-text-secondary tainacan-icon-add"/> <i class="tainacan-icon has-text-secondary tainacan-icon-add"/>
</span> </span>
&nbsp;{{ $i18n.get('label_add_value') }}&nbsp; &nbsp;{{ $i18n.get('label_add_value') }}
<span class="icon">
<i class="tainacan-icon has-text-secondary tainacan-icon-loading"/>
</span>
</a> </a>
</div> </div>
@ -209,7 +214,6 @@
} }
currentChildItemMetadataGroups.push(existingChildItemMetadata) currentChildItemMetadataGroups.push(existingChildItemMetadata)
} }
} }
} }

View File

@ -94,9 +94,9 @@ export const setSingleMetadatum = (state, itemMetadatum) => {
}); });
if (currentChildMetadataGroupIndex >= 0) { if (currentChildMetadataGroupIndex >= 0) {
let currrentChildMetadatumIndex = currentParentValues[currentChildMetadataGroupIndex].findIndex((metadatumValue) => metadatumValue.parent_meta_id == itemMetadatum.parent_meta_id && metadatumValue.metadatum_id == itemMetadatum.metadatum.id); let currentChildMetadatumIndex = currentParentValues[currentChildMetadataGroupIndex].findIndex((metadatumValue) => metadatumValue.parent_meta_id == itemMetadatum.parent_meta_id && metadatumValue.metadatum_id == itemMetadatum.metadatum.id);
if (currrentChildMetadatumIndex >= 0) if (currentChildMetadatumIndex >= 0)
currentParentValues[currentChildMetadataGroupIndex].splice(currrentChildMetadatumIndex, 1, childMetadatumValue); currentParentValues[currentChildMetadataGroupIndex].splice(currentChildMetadatumIndex, 1, childMetadatumValue);
else else
currentParentValues[currentChildMetadataGroupIndex].push(childMetadatumValue); currentParentValues[currentChildMetadataGroupIndex].push(childMetadatumValue);
} else { } else {
@ -104,9 +104,10 @@ export const setSingleMetadatum = (state, itemMetadatum) => {
} }
} else { } else {
let currrentChildMetadatumIndex = currentParentValues.findIndex((metadatumValue) => metadatumValue.parent_meta_id == itemMetadatum.parent_meta_id && metadatumValue.metadatum_id == itemMetadatum.metadatum.id); let currentChildMetadatumIndex = currentParentValues.findIndex((metadatumValue) => metadatumValue.parent_meta_id == itemMetadatum.parent_meta_id && metadatumValue.metadatum_id == itemMetadatum.metadatum.id);
if (currrentChildMetadatumIndex >= 0)
currentParentValues.splice(currrentChildMetadatumIndex, 1, childMetadatumValue); if (currentChildMetadatumIndex >= 0)
currentParentValues.splice(currentChildMetadatumIndex, 1, childMetadatumValue);
else else
currentParentValues.push(childMetadatumValue); currentParentValues.push(childMetadatumValue);
} }