gamebrary/src/components/Settings/BoardSettings.vue

138 lines
3.2 KiB
Vue
Raw Normal View History

2020-08-15 00:02:34 +00:00
<template lang="html">
<b-dropdown-item v-b-modal:board-settings>
<b-icon-kanban class="mr-1" />
Board settings
<b-modal
id="board-settings"
title="Board settings"
body-class="p-0"
2020-08-24 17:22:01 +00:00
@show="getSettings"
2020-08-15 00:02:34 +00:00
>
<b-list-group flush>
<b-list-group-item>
<wallpaper-upload />
</b-list-group-item>
<b-list-group-item>
<label for="theme">Theme</label>
<b-form-select
id="theme"
disabled
2020-08-15 00:02:34 +00:00
>
<b-form-select-option
v-for="{ id, name } in themes"
:key="id"
:value="id"
>
{{ name }}
</b-form-select-option>
</b-form-select>
<b-alert show variant="warning" class="mt-3">
Themes are temporarily disabled
</b-alert>
2020-08-15 00:02:34 +00:00
</b-list-group-item>
</b-list-group>
<template v-slot:modal-footer>
<b-button
:title="$t('list.delete')"
variant="danger"
@click="promptDeleteBoard"
>
Delete board
</b-button>
</template>
2020-08-15 00:02:34 +00:00
</b-modal>
</b-dropdown-item>
</template>
<script>
import { mapState } from 'vuex';
import themes from '@/themes';
import WallpaperUpload from '@/components/WallpaperUpload';
export default {
components: {
WallpaperUpload,
},
data() {
return {
themes,
saving: false,
};
},
computed: {
...mapState(['user', 'platform', 'gameLists']),
},
methods: {
getSettings() {
// console.log('get settings bitdch!');
// const { sortOrder } = this.gameLists[this.platform.code][this.listIndex];
//
// this.sortOrder = sortOrder || 'sortByCustom';
},
promptDeleteBoard() {
this.$bvModal.msgBoxConfirm('All your data will be removed', {
title: 'Are you sure you want to delete this board?',
okVariant: 'danger',
okTitle: 'Yes, delete board! Hahaha!',
})
.then((value) => {
if (value) {
this.deleteBoard();
}
});
},
deleteBoard() {
2020-08-18 22:01:16 +00:00
this.$store.commit('REMOVE_PLATFORM_LEGACY');
2020-08-15 00:02:34 +00:00
this.$store.dispatch('SAVE_LIST_NO_MERGE_LEGACY', this.gameLists)
2020-08-15 00:02:34 +00:00
.then(() => {
this.$router.push({ name: 'platforms' });
})
.catch(() => {
this.$bvToast.toast('Authentication error', { title: 'Error', variant: 'danger' });
});
},
// async save() {
// this.saving = true;
//
// const gameLists = JSON.parse(JSON.stringify(this.gameLists));
//
// gameLists[this.platform.code][this.listIndex].sortOrder = this.sortOrder;
//
// await this.$store.dispatch('SAVE_LIST_LEGACY', gameLists)
2020-08-15 00:02:34 +00:00
// .catch(() => {
// this.saving = false;
//
// this.$bvToast.toast('There was an error renaming list', {
// title: 'Error',
// variant: 'danger',
// });
// });
//
// this.saving = false;
//
// this.$bvToast.toast('List renamed', {
// title: 'Saved',
// variant: 'success',
// });
//
// this.$bvModal.hide('board-settings');
// },
},
};
</script>
<style lang="scss" rel="stylesheet/scss" scoped>
</style>