Skip to content
Snippets Groups Projects
Commit ab168e9a authored by Leah Tacke genannt Unterberg's avatar Leah Tacke genannt Unterberg
Browse files

added functionality to clear all existing mappings

parent ecfe1de7
Branches
No related tags found
No related merge requests found
Pipeline #476618 skipped
...@@ -239,6 +239,11 @@ function recreate(cmEntry: ConceptMappingEntry) { ...@@ -239,6 +239,11 @@ function recreate(cmEntry: ConceptMappingEntry) {
concept.value = cm.concept concept.value = cm.concept
} }
function clearMappings() {
mappings.clearMappings()
console.log('Cleared all mappings')
}
const expanded = ref([0]) const expanded = ref([0])
</script> </script>
...@@ -252,6 +257,7 @@ const expanded = ref([0]) ...@@ -252,6 +257,7 @@ const expanded = ref([0])
<v-expansion-panel title="Created Mappings"> <v-expansion-panel title="Created Mappings">
<template v-slot:text> <template v-slot:text>
<MappingsTable show-view @showMapping="recreate"></MappingsTable> <MappingsTable show-view @showMapping="recreate"></MappingsTable>
<v-btn size="small" @click="clearMappings">Clear All Mappings</v-btn>
</template> </template>
</v-expansion-panel> </v-expansion-panel>
</v-expansion-panels> </v-expansion-panels>
......
...@@ -50,9 +50,17 @@ export const useMappingStore = defineStore('mappings', () => { ...@@ -50,9 +50,17 @@ export const useMappingStore = defineStore('mappings', () => {
} }
} }
function $reset() { function clearMappings() {
currentMappings.value = [] currentMappings.value = []
} }
return {currentMappings, saveMapping, saveMappings, removeMapping, downloadMapping, $reset} return {
currentMappings,
saveMapping,
saveMappings,
removeMapping,
downloadMapping,
clearMappings,
$reset: clearMappings
}
}, {persist: {pick: ['currentMappings']}}) }, {persist: {pick: ['currentMappings']}})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment