Enhance branch selection with weather information and localization updates
- Updated FalukantService to include weather data in branch retrieval, enhancing user context. - Modified BranchSelection component to display current weather for selected branches, improving user experience. - Added weather translations in both English and German localization files for better accessibility. - Improved styling for weather information display in the frontend.
This commit is contained in:
@@ -1,15 +1,21 @@
|
||||
<template>
|
||||
<div class="branch-selection">
|
||||
<h3>{{ $t('falukant.branch.selection.title') }}</h3>
|
||||
<div>
|
||||
<FormattedDropdown
|
||||
:key="branchesKey"
|
||||
:options="branches"
|
||||
:columns="branchColumns"
|
||||
v-model="localSelectedBranch"
|
||||
:placeholder="$t('falukant.branch.selection.placeholder')"
|
||||
@update:modelValue="updateSelectedBranch"
|
||||
/>
|
||||
<div class="selection-row">
|
||||
<div class="dropdown-wrapper">
|
||||
<FormattedDropdown
|
||||
:key="branchesKey"
|
||||
:options="branches"
|
||||
:columns="branchColumns"
|
||||
v-model="localSelectedBranch"
|
||||
:placeholder="$t('falukant.branch.selection.placeholder')"
|
||||
@update:modelValue="updateSelectedBranch"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="selectedBranchWeather" class="weather-info">
|
||||
<span class="weather-label">{{ $t('falukant.branch.selection.weather') }}:</span>
|
||||
<span class="weather-value">{{ $t(`falukant.weather.${selectedBranchWeather}`) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button @click="openCreateBranchDialog">
|
||||
@@ -60,6 +66,9 @@ export default {
|
||||
branchesKey() {
|
||||
return this.branches.map(b => b.id).join('-');
|
||||
},
|
||||
selectedBranchWeather() {
|
||||
return this.localSelectedBranch?.weather || null;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
selectedBranch(newVal) {
|
||||
@@ -91,7 +100,35 @@ export default {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.selection-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.dropdown-wrapper {
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
button {
|
||||
margin: 5px;
|
||||
}
|
||||
|
||||
.weather-info {
|
||||
padding: 8px 12px;
|
||||
background-color: #f0f0f0;
|
||||
border-radius: 4px;
|
||||
font-size: 0.9em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.weather-label {
|
||||
font-weight: bold;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.weather-value {
|
||||
text-transform: capitalize;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user