Add income update success message in DirectorInfo component

- Implemented a success message display for income updates in the DirectorInfo component, enhancing user feedback after successful updates.
- Added a timeout to automatically hide the success message after 3 seconds.
- Updated localization files to include new translations for income-related messages in both German and English, improving user experience for multilingual users.
This commit is contained in:
Torsten Schulz (local)
2025-12-08 11:30:31 +01:00
parent 4dbcebfab8
commit 274c2a3292
3 changed files with 95 additions and 0 deletions

View File

@@ -68,6 +68,9 @@
({{ $t('falukant.director.wishedIncome') }}:
{{ director.wishedIncome }})
</span>
<div v-if="incomeUpdateSuccess" class="income-update-success">
{{ $t('falukant.branch.director.incomeUpdated') }}
</div>
</div>
<div class="field">
@@ -192,6 +195,7 @@ export default {
director: null,
showNewDirectorDialog: false,
editIncome: null,
incomeUpdateSuccess: false,
emptyTransportForm: {
vehicleTypeId: null,
targetBranchId: null,
@@ -264,6 +268,12 @@ export default {
income: this.editIncome,
});
await this.loadDirector();
// Erfolgsnachricht anzeigen
this.incomeUpdateSuccess = true;
// Nach 3 Sekunden automatisch ausblenden
setTimeout(() => {
this.incomeUpdateSuccess = false;
}, 3000);
} catch (error) {
console.error('Error updating director:', error);
}
@@ -462,6 +472,16 @@ export default {
gap: 0.5rem;
}
.income-update-success {
margin-top: 0.5rem;
padding: 0.5rem;
background-color: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
border-radius: 4px;
font-size: 0.9em;
}
.toggles label {
display: block;
}