Client - add help + change order (default 1st) on raw speed preferences

This commit is contained in:
Sam 2023-05-28 15:19:56 +02:00
parent 137c844160
commit 1eff000617
4 changed files with 52 additions and 15 deletions

View File

@ -20,9 +20,31 @@
<dt>{{ $t('user.PROFILE.ASCENT_DATA') }}:</dt> <dt>{{ $t('user.PROFILE.ASCENT_DATA') }}:</dt>
<dd>{{ $t(`common.${display_ascent}`) }}</dd> <dd>{{ $t(`common.${display_ascent}`) }}</dd>
<dt>{{ $t('user.PROFILE.ELEVATION_CHART_START.LABEL') }}:</dt> <dt>{{ $t('user.PROFILE.ELEVATION_CHART_START.LABEL') }}:</dt>
<dd>{{ $t(`user.PROFILE.ELEVATION_CHART_START.${user.start_elevation_at_zero ? 'ZERO' : 'MIN_ALT'}`) }}</dd> <dd>
{{
$t(
`user.PROFILE.ELEVATION_CHART_START.${
user.start_elevation_at_zero ? 'ZERO' : 'MIN_ALT'
}`
)
}}
</dd>
<dt>{{ $t('user.PROFILE.USE_RAW_GPX_SPEED.LABEL') }}:</dt> <dt>{{ $t('user.PROFILE.USE_RAW_GPX_SPEED.LABEL') }}:</dt>
<dd>{{ $t(`user.PROFILE.USE_RAW_GPX_SPEED.${user.use_raw_gpx_speed ? 'RAW_SPEED' : 'FILTERED_SPEED'}`) }}</dd> <dd>
{{
$t(
`user.PROFILE.USE_RAW_GPX_SPEED.${
user.use_raw_gpx_speed ? 'RAW_SPEED' : 'FILTERED_SPEED'
}`
)
}}
</dd>
<div class="info-box raw-speed-help">
<span>
<i class="fa fa-info-circle" aria-hidden="true" />
{{ $t('user.PROFILE.USE_RAW_GPX_SPEED.HELP') }}
</span>
</div>
</dl> </dl>
<div class="profile-buttons"> <div class="profile-buttons">
<button @click="$router.push('/profile/edit/preferences')"> <button @click="$router.push('/profile/edit/preferences')">

View File

@ -104,7 +104,10 @@
{{ $t('user.PROFILE.ELEVATION_CHART_START.LABEL') }} {{ $t('user.PROFILE.ELEVATION_CHART_START.LABEL') }}
</span> </span>
<div class="checkboxes"> <div class="checkboxes">
<label v-for="status in startElevationAtZeroData" :key="status.label"> <label
v-for="status in startElevationAtZeroData"
:key="status.label"
>
<input <input
type="radio" type="radio"
:id="status.label" :id="status.label"
@ -138,6 +141,12 @@
</span> </span>
</label> </label>
</div> </div>
<div class="info-box raw-speed-help">
<span>
<i class="fa fa-info-circle" aria-hidden="true" />
{{ $t('user.PROFILE.USE_RAW_GPX_SPEED.HELP') }}
</span>
</div>
</div> </div>
<div class="form-buttons"> <div class="form-buttons">
<button class="confirm" type="submit"> <button class="confirm" type="submit">
@ -213,22 +222,22 @@
const startElevationAtZeroData = [ const startElevationAtZeroData = [
{ {
label: 'ZERO', label: 'ZERO',
value: true value: true,
}, },
{ {
label: 'MIN_ALT', label: 'MIN_ALT',
value: false value: false,
} },
] ]
const useRawGpxSpeed = [ const useRawGpxSpeed = [
{ {
label: 'RAW_SPEED', label: 'FILTERED_SPEED',
value: true value: false,
}, },
{ {
label: 'FILTERED_SPEED', label: 'RAW_SPEED',
value: false value: true,
} },
] ]
const loading = computed( const loading = computed(
() => store.getters[AUTH_USER_STORE.GETTERS.USER_LOADING] () => store.getters[AUTH_USER_STORE.GETTERS.USER_LOADING]
@ -252,8 +261,12 @@
function updateUserForm(user: IAuthUserProfile) { function updateUserForm(user: IAuthUserProfile) {
userForm.display_ascent = user.display_ascent userForm.display_ascent = user.display_ascent
userForm.start_elevation_at_zero = user.start_elevation_at_zero ? user.start_elevation_at_zero : false userForm.start_elevation_at_zero = user.start_elevation_at_zero
userForm.use_raw_gpx_speed = user.use_raw_gpx_speed ? user.use_raw_gpx_speed : false ? user.start_elevation_at_zero
: false
userForm.use_raw_gpx_speed = user.use_raw_gpx_speed
? user.use_raw_gpx_speed
: false
userForm.imperial_units = user.imperial_units ? user.imperial_units : false userForm.imperial_units = user.imperial_units ? user.imperial_units : false
userForm.language = user.language ? user.language : 'en' userForm.language = user.language ? user.language : 'en'
userForm.timezone = user.timezone ? user.timezone : 'Europe/Paris' userForm.timezone = user.timezone ? user.timezone : 'Europe/Paris'

View File

@ -120,7 +120,8 @@
"USE_RAW_GPX_SPEED": { "USE_RAW_GPX_SPEED": {
"LABEL": "GPX max speed strategy", "LABEL": "GPX max speed strategy",
"RAW_SPEED": "Raw", "RAW_SPEED": "Raw",
"FILTERED_SPEED": "Filtered" "FILTERED_SPEED": "Filtered",
"HELP": "If filtered, it excludes extreme values (which may be GPS errors) when calculating the maximum speed."
} }
}, },
"READ_AND_ACCEPT_PRIVACY_POLICY": "I have read and agree to the {0}.", "READ_AND_ACCEPT_PRIVACY_POLICY": "I have read and agree to the {0}.",

View File

@ -120,7 +120,8 @@
"USE_RAW_GPX_SPEED": { "USE_RAW_GPX_SPEED": {
"LABEL": "Stratégie de vitesse maximale", "LABEL": "Stratégie de vitesse maximale",
"RAW_SPEED": "Brut", "RAW_SPEED": "Brut",
"FILTERED_SPEED": "Filtré" "FILTERED_SPEED": "Filtré",
"HELP": "Si filtré, les valeurs extrêmes (qui peuvent être des erreurs GPS) sont exclues lors du calcul de la vitesse maximale."
} }
}, },
"READ_AND_ACCEPT_PRIVACY_POLICY": "J'ai lu et accepte la {0}.", "READ_AND_ACCEPT_PRIVACY_POLICY": "J'ai lu et accepte la {0}.",