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') }}
</a>
</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>
<p
v-else
@ -84,10 +92,7 @@
<span class="icon is-small">
<i class="tainacan-icon has-text-secondary tainacan-icon-add"/>
</span>
&nbsp;{{ $i18n.get('label_add_value') }}&nbsp;
<span class="icon">
<i class="tainacan-icon has-text-secondary tainacan-icon-loading"/>
</span>
&nbsp;{{ $i18n.get('label_add_value') }}
</a>
</div>
@ -209,7 +214,6 @@
}
currentChildItemMetadataGroups.push(existingChildItemMetadata)
}
}
}

View File

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