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
parent
13f147a357
commit
d05701734c
|
@ -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",
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue