From a9de893ccaf8ff2a3f3c1ab2be977ea28e3496e9 Mon Sep 17 00:00:00 2001 From: liushuyu Date: Fri, 6 Nov 2020 18:46:37 -0700 Subject: [PATCH] ui: show error if no package is selected --- ui/src/locales/en.json | 4 +++- ui/src/views/SelectPackages.vue | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ui/src/locales/en.json b/ui/src/locales/en.json index b1b6c1f..6cc8da1 100644 --- a/ui/src/locales/en.json +++ b/ui/src/locales/en.json @@ -23,7 +23,9 @@ "location_placeholder":"Enter a install path here", "select":"Select", "overwriting": "Overwriting", - "overwriting_warning": "Directory {path} already exists.
Are you sure you want to overwrite the contents inside?" + "overwriting_warning": "Directory {path} already exists.
Are you sure you want to overwrite the contents inside?", + "nothing_picked": "Nothing selected", + "nothing_picked_warning": "Please select at least one package to install!" }, "install_packages":{ "check_for_update":"Checking for updates...", diff --git a/ui/src/views/SelectPackages.vue b/ui/src/views/SelectPackages.vue index 0ef16e4..e152153 100644 --- a/ui/src/views/SelectPackages.vue +++ b/ui/src/views/SelectPackages.vue @@ -92,7 +92,20 @@ export default { onConfirm: confirmCallback }) }, + show_nothing_picked_dialog: function () { + this.$buefy.dialog.alert({ + title: this.$t('select_packages.nothing_picked'), + message: this.$t('select_packages.nothing_picked_warning', { path: this.$root.$data.install_location }), + confirmText: this.$t('cancel'), + type: 'is-danger', + hasIcon: true + }) + }, install: function () { + if (!this.$root.config.packages.some(function (x) { return x.default })) { + this.show_nothing_picked_dialog() + return + } // maintenance + repair if (this.repair) { this.$router.push('/install/repair')