build: v1.5.1; feat: added basic confirmation prompt when resetting settings to default (closes #16); feat: added toast when resetting settings to default

This commit is contained in:
Roberto Tonino 2020-11-28 19:08:01 +01:00
parent 04554b60d7
commit 919498f31c
5 changed files with 22 additions and 12 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "deemix-webui", "name": "deemix-webui",
"version": "1.5.0", "version": "1.5.1",
"scripts": { "scripts": {
"clean": "rimraf public/js/bundle.js public/js/bundle.temp.js public/js/bundle.js.map", "clean": "rimraf public/js/bundle.js public/js/bundle.temp.js public/js/bundle.js.map",
"clean-temp": "rimraf public/js/bundle.temp.js", "clean-temp": "rimraf public/js/bundle.temp.js",

File diff suppressed because one or more lines are too long

View File

@ -46,13 +46,14 @@
</button> </button>
</div> </div>
<RouterLink :to="{ name: 'ARL' }"> <RouterLink :to="{ name: 'ARL' }" class="block">
{{ $t('settings.login.arl.question') }} {{ $t('settings.login.arl.question') }}
</RouterLink> </RouterLink>
<a v-if="clientMode" href="#" @click="appLogin"> <a v-if="clientMode" href="#" class="block" @click="appLogin">
{{ $t('settings.login.login') }} {{ $t('settings.login.login') }}
</a> </a>
<button class="btn btn-primary" @click="login" style="width: 100%"> <button class="btn btn-primary" @click="login" style="width: 100%">
{{ $t('settings.login.arl.update') }} {{ $t('settings.login.arl.update') }}
</button> </button>
@ -651,7 +652,7 @@
</BaseAccordion> </BaseAccordion>
<footer class="bg-background-main"> <footer class="bg-background-main">
<button class="mr-2 btn btn-primary" @click="resetSettings">{{ $t('settings.reset') }}</button> <button class="mr-2 btn btn-primary" @click="resetToDefault">{{ $t('settings.reset') }}</button>
<button class="btn btn-primary" @click="saveSettings">{{ $t('settings.save') }}</button> <button class="btn btn-primary" @click="saveSettings">{{ $t('settings.save') }}</button>
</footer> </footer>
</div> </div>
@ -967,8 +968,13 @@ export default {
toast(this.$t('settings.toasts.update'), 'settings') toast(this.$t('settings.toasts.update'), 'settings')
}, },
resetSettings() { resetToDefault() {
const wantsToReset = confirm(this.$t('settings.resetMessage'))
if (!wantsToReset) return
this.settings = JSON.parse(JSON.stringify(this.defaultSettings)) this.settings = JSON.parse(JSON.stringify(this.defaultSettings))
toast(this.$t('settings.toasts.reset'), 'settings')
} }
} }
} }

View File

@ -376,10 +376,12 @@ const en = {
question: 'How do I enable Spotify Features?' question: 'How do I enable Spotify Features?'
}, },
reset: 'Reset to Default', reset: 'Reset to Default',
resetMessage: 'Are you sure you want to go back to default settings?',
save: 'Save', save: 'Save',
toasts: { toasts: {
init: 'Settings loaded!', init: 'Settings loaded!',
update: 'Settings updated!', update: 'Settings updated!',
reset: 'Settings reset to default!',
ARLcopied: 'ARL copied to clipboard' ARLcopied: 'ARL copied to clipboard'
} }
}, },

View File

@ -379,10 +379,12 @@ const it = {
question: 'Come attivo le Spotify Features?' question: 'Come attivo le Spotify Features?'
}, },
reset: 'Reimposta Default', reset: 'Reimposta Default',
resetMessage: 'Sei sicuro di voler tornare alle impostazioni di default?',
save: 'Salva', save: 'Salva',
toasts: { toasts: {
init: 'Impostazioni caricate!', init: 'Impostazioni caricate!',
update: 'Impostazioni aggiornate!', update: 'Impostazioni aggiornate!',
reset: 'Impostazioni di default ripristinate!',
ARLcopied: 'ARL copiato negli appunti' ARLcopied: 'ARL copiato negli appunti'
} }
}, },