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;
}

View File

@@ -149,6 +149,8 @@
},
"name": "Name",
"salary": "Gehalt",
"income": "Einkommen",
"incomeUpdated": "Gehalt wurde erfolgreich aktualisiert.",
"satisfaction": "Zufriedenheit",
"fire": "Feuern",
"teach": "Weiterbilden",
@@ -838,6 +840,7 @@
"governor": "Gouverneur",
"super-state-administrator": "Oberstaatsverwalter",
"state-administrator": "Staatsverwalter",
"consultant": "Berater",
"ruler-consultant": "Berater des Herrschers",
"territorial-council-speaker": "Sprecher des Territorialrats",
"territorial-council": "Territorialrat",

View File

@@ -98,6 +98,10 @@
"selectedcity": "Selected City",
"weather": "Current Weather"
},
"director": {
"income": "Income",
"incomeUpdated": "Salary has been successfully updated."
},
"vehicles": {
"cargo_cart": "Cargo cart",
"ox_cart": "Ox cart",
@@ -113,6 +117,74 @@
},
"branchProduction": {
"storageAvailable": "Free storage"
},
"politics": {
"title": "Politics",
"tabs": {
"current": "Current Position",
"upcoming": "Upcoming Positions",
"elections": "Elections"
},
"current": {
"office": "Office",
"region": "Region",
"termEnds": "Term Ends",
"income": "Income",
"none": "No current position available.",
"holder": "Holder"
},
"open": {
"office": "Office",
"region": "Region",
"date": "Date",
"candidacy": "Candidacy",
"none": "No open positions.",
"apply": "Apply for selected positions"
},
"upcoming": {
"office": "Office",
"region": "Region",
"postDate": "Date",
"none": "No upcoming positions."
},
"elections": {
"office": "Office",
"region": "Region",
"date": "Date",
"posts": "Posts to Fill",
"none": "No elections available.",
"choose": "Candidates",
"vote": "Vote",
"voteAll": "Vote All",
"candidates": "Candidates",
"action": "Action"
},
"offices": {
"chancellor": "Chancellor",
"minister": "Minister",
"ministry-helper": "Ministry Helper",
"governor": "Governor",
"super-state-administrator": "Super State Administrator",
"state-administrator": "State Administrator",
"consultant": "Consultant",
"ruler-consultant": "Ruler's Consultant",
"territorial-council-speaker": "Territorial Council Speaker",
"territorial-council": "Territorial Council",
"hangman": "Hangman",
"treasurer": "Treasurer",
"sheriff": "Sheriff",
"taxman": "Tax Collector",
"bailif": "Bailiff",
"judge": "Judge",
"village-major": "Village Major",
"master-builder": "Master Builder",
"mayor": "Mayor",
"town-clerk": "Town Clerk",
"beadle": "Beadle",
"council": "Council Member",
"councillor": "Councillor",
"assessor": "Assessor"
}
}
}
}