encourage legacy board deletion after conversion

This commit is contained in:
Gamebrary 2020-08-31 14:34:04 -07:00
parent 700e77c14e
commit 9b49eedfa5

View file

@ -52,7 +52,14 @@
they will eventually be removed</p>
<b-button @click="changePlatform(tempPlatform)">
View platform
View legacy board
</b-button>
<b-button
variant="danger"
@click="deleteLegacyPlatform(tempPlatform)"
>
Delete legacy board
</b-button>
<!-- <pre>{{ tempPlatform }}</pre> -->
@ -119,13 +126,20 @@ export default {
this.saving = false;
this.$bvToast.toast('Board converted', { title: 'Success', variant: 'success' });
this.$bvModal.hide('deprecation-warning');
this.showDeleteMessage();
this.showDeleteMessage(tempPlatform);
},
showDeleteMessage() {
showDeleteMessage(tempPlatform) {
this.$bvModal.msgBoxConfirm('You can now safely delete your legacy platform', {
title: 'Board converted',
okVariant: 'success',
okVariant: 'danger',
cancelTitle: 'Dismiss',
okTitle: 'Delete legacy board',
})
.then((value) => {
if (value) {
this.deleteLegacyPlatform(tempPlatform);
}
});
},
@ -144,6 +158,21 @@ export default {
this.$store.commit('SET_PLATFORM_LEGACY', platform);
this.$router.push({ name: 'legacy-board' });
},
deleteLegacyPlatform(platform) {
this.$store.commit('SET_PLATFORM_LEGACY', platform);
this.$store.commit('REMOVE_PLATFORM_LEGACY');
this.$store.dispatch('SAVE_LIST_NO_MERGE_LEGACY', this.gameLists)
.then(() => {
this.$bvModal.hide('deprecation-warning');
this.$bvToast.toast('Legacy board deleted', { title: 'Success', variant: 'success' });
})
.catch(() => {
this.$bvToast.toast('Authentication error', { title: 'Error', variant: 'danger' });
});
},
},
};
</script>