Setup wizard: add empty values for language, region (#803)

If the region is not set it would default to Afghanistan (the
first entry). Allow specifying none.

Add placeholder to location input.

Signed-off-by: Yannick Schaus <github@schaus.net>
3.0.x
Yannick Schaus 2021-01-14 15:07:52 +01:00
parent 13f147a357
commit d05701734c
3 changed files with 6 additions and 2 deletions

View File

@ -10,6 +10,7 @@
"setupwizard.location.header1": "Would you like to share your home's location?",
"setupwizard.location.header2": "It will help determining data dependent on your position, like sunrise/sunset times or the weather.",
"setupwizard.location.parameterLabel": "Location of your home",
"setupwizard.location.placeholder": "<latitude>,<longitude>[,<altitude>]",
"setupwizard.location.retrieveFromDevice": "Retrieve from This Device",
"setupwizard.location.retrieveFromDevice.error": "Error while retrieving current position",
"setupwizard.location.retrieveFromDevice.notAvailable.title": "Sorry",

View File

@ -5,6 +5,7 @@
:label="configDescription.label"
:name="configDescription.name"
:value="value"
:placeholder="placeholder"
:required="configDescription.required" validate
:clear-button="!configDescription.required"
@input="updateValue"
@ -23,7 +24,7 @@
import LocationPicker from './location-picker.vue'
export default {
props: ['configDescription', 'value'],
props: ['configDescription', 'value', 'placeholder'],
methods: {
updateValue (event) {
if (event.lat && event.lng) {

View File

@ -12,6 +12,7 @@
:smart-select-params="{openIn: 'popup', searchbar: true, closeOnSelect: true}"
>
<select name="language" @change="(evt) => language = evt.target.value">
<option value="" :selected="!language"></option>
<option
v-for="option in availableLanguages"
:key="option.value"
@ -26,6 +27,7 @@
:smart-select-params="{openIn: 'popup', searchbar: true, closeOnSelect: true}"
>
<select name="region" @change="(evt) => region = evt.target.value">
<option value="" :selected="!region"></option>
<option
v-for="option in availableRegions"
:key="option.value"
@ -75,7 +77,7 @@
</f7-block>
<f7-block strong>{{ $t('setupwizard.location.header1') }}<br />{{ $t('setupwizard.location.header2') }}</f7-block>
<f7-list>
<parameter-location :value="location" :config-description="{ label: $t('setupwizard.location.parameterLabel'), name: 'Location' }" @input="(value) => location = value" />
<parameter-location :value="location" :config-description="{ label: $t('setupwizard.location.parameterLabel'), name: 'Location' }" @input="(value) => location = value" :placeholder="$t('setupwizard.location.placeholder')" />
</f7-list>
<f7-block class="padding">
<f7-row>