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:
@@ -68,6 +68,9 @@
|
|||||||
({{ $t('falukant.director.wishedIncome') }}:
|
({{ $t('falukant.director.wishedIncome') }}:
|
||||||
{{ director.wishedIncome }})
|
{{ director.wishedIncome }})
|
||||||
</span>
|
</span>
|
||||||
|
<div v-if="incomeUpdateSuccess" class="income-update-success">
|
||||||
|
{{ $t('falukant.branch.director.incomeUpdated') }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
@@ -192,6 +195,7 @@ export default {
|
|||||||
director: null,
|
director: null,
|
||||||
showNewDirectorDialog: false,
|
showNewDirectorDialog: false,
|
||||||
editIncome: null,
|
editIncome: null,
|
||||||
|
incomeUpdateSuccess: false,
|
||||||
emptyTransportForm: {
|
emptyTransportForm: {
|
||||||
vehicleTypeId: null,
|
vehicleTypeId: null,
|
||||||
targetBranchId: null,
|
targetBranchId: null,
|
||||||
@@ -264,6 +268,12 @@ export default {
|
|||||||
income: this.editIncome,
|
income: this.editIncome,
|
||||||
});
|
});
|
||||||
await this.loadDirector();
|
await this.loadDirector();
|
||||||
|
// Erfolgsnachricht anzeigen
|
||||||
|
this.incomeUpdateSuccess = true;
|
||||||
|
// Nach 3 Sekunden automatisch ausblenden
|
||||||
|
setTimeout(() => {
|
||||||
|
this.incomeUpdateSuccess = false;
|
||||||
|
}, 3000);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error updating director:', error);
|
console.error('Error updating director:', error);
|
||||||
}
|
}
|
||||||
@@ -462,6 +472,16 @@ export default {
|
|||||||
gap: 0.5rem;
|
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 {
|
.toggles label {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,6 +149,8 @@
|
|||||||
},
|
},
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
"salary": "Gehalt",
|
"salary": "Gehalt",
|
||||||
|
"income": "Einkommen",
|
||||||
|
"incomeUpdated": "Gehalt wurde erfolgreich aktualisiert.",
|
||||||
"satisfaction": "Zufriedenheit",
|
"satisfaction": "Zufriedenheit",
|
||||||
"fire": "Feuern",
|
"fire": "Feuern",
|
||||||
"teach": "Weiterbilden",
|
"teach": "Weiterbilden",
|
||||||
@@ -838,6 +840,7 @@
|
|||||||
"governor": "Gouverneur",
|
"governor": "Gouverneur",
|
||||||
"super-state-administrator": "Oberstaatsverwalter",
|
"super-state-administrator": "Oberstaatsverwalter",
|
||||||
"state-administrator": "Staatsverwalter",
|
"state-administrator": "Staatsverwalter",
|
||||||
|
"consultant": "Berater",
|
||||||
"ruler-consultant": "Berater des Herrschers",
|
"ruler-consultant": "Berater des Herrschers",
|
||||||
"territorial-council-speaker": "Sprecher des Territorialrats",
|
"territorial-council-speaker": "Sprecher des Territorialrats",
|
||||||
"territorial-council": "Territorialrat",
|
"territorial-council": "Territorialrat",
|
||||||
|
|||||||
@@ -98,6 +98,10 @@
|
|||||||
"selectedcity": "Selected City",
|
"selectedcity": "Selected City",
|
||||||
"weather": "Current Weather"
|
"weather": "Current Weather"
|
||||||
},
|
},
|
||||||
|
"director": {
|
||||||
|
"income": "Income",
|
||||||
|
"incomeUpdated": "Salary has been successfully updated."
|
||||||
|
},
|
||||||
"vehicles": {
|
"vehicles": {
|
||||||
"cargo_cart": "Cargo cart",
|
"cargo_cart": "Cargo cart",
|
||||||
"ox_cart": "Ox cart",
|
"ox_cart": "Ox cart",
|
||||||
@@ -113,6 +117,74 @@
|
|||||||
},
|
},
|
||||||
"branchProduction": {
|
"branchProduction": {
|
||||||
"storageAvailable": "Free storage"
|
"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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user