-
Notifications
You must be signed in to change notification settings - Fork 2
Bug fix/standardize status texts #256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
774890a
fix: correct typos and update labels for consistency in AdminDashboar…
annikaholmqvist94 f034c94
fix: replace action text formatting with getActionLabel for consisten…
annikaholmqvist94 5cf346a
fix: use ACTIVE_STATUS_KEYS for dynamic status dropdown options in Ca…
annikaholmqvist94 ea60582
fix: add localized display labels to RecordStatus for activity logs
annikaholmqvist94 49ab8c9
fix: add comprehensive status and action label mappings for consisten…
annikaholmqvist94 25e027b
fix: use localized display labels for status in activity logs to matc…
annikaholmqvist94 a8eab58
test: update MedicalRecordServiceTest to use localized display labels…
annikaholmqvist94 6e12f82
Merge branch 'main' into bugFix/standardize-status-texts
annikaholmqvist94 921f1b1
fix: add release case functionality for assigned vets in CaseDetail
annikaholmqvist94 c658302
fix: add localized display label for unassigned case status in status…
annikaholmqvist94 fcfc848
fix: update AuditLogView to use localized action labels and remove re…
annikaholmqvist94 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,34 @@ | ||
| // src/utils/statusHelper.js | ||
| // | ||
| // Gemensam mappning från backend-enum till svenska visningstexter. | ||
| // Används överallt där status eller aktivitetsloggar visas i UI:t så att | ||
| // texterna förblir konsekventa. Motsvarighet finns i backend | ||
| // (RecordStatus.displayLabel()) för loggrader som skrivs till databasen. | ||
|
|
||
| export const STATUS_MAP = { | ||
| 'OPEN': { label: 'Inskickat', color: 'bg-blue-50 text-blue-700 border-blue-100' }, | ||
| 'IN_PROGRESS': { label: 'Under behandling', color: 'bg-yellow-50 text-yellow-700 border-yellow-100' }, | ||
| 'AWAITING_INFO': { label: 'Väntar på svar', color: 'bg-purple-50 text-purple-700 border-purple-100' }, | ||
| 'CLOSED': { label: 'Avslutat', color: 'bg-slate-50 text-slate-500 border-slate-100' } | ||
| }; | ||
| 'OPEN': { label: 'Öppen', color: 'bg-blue-50 text-blue-700 border-blue-100' }, | ||
| 'IN_PROGRESS': { label: 'Under behandling', color: 'bg-yellow-50 text-yellow-700 border-yellow-100' }, | ||
| 'AWAITING_INFO': { label: 'Väntar på svar', color: 'bg-purple-50 text-purple-700 border-purple-100' }, | ||
| 'CLOSED': { label: 'Avslutad', color: 'bg-slate-50 text-slate-500 border-slate-100' } | ||
| }; | ||
|
|
||
| // Statusar som VET kan välja i dropdown. CLOSED utesluts — stängning sker | ||
| // via "Slutför & Stäng"-modalen för att tvinga fram en slutnotering. | ||
| export const ACTIVE_STATUS_KEYS = ['OPEN', 'IN_PROGRESS', 'AWAITING_INFO']; | ||
|
|
||
| // Svensk label för en status, med fallback till raw-värdet om enum-värdet | ||
| // inte känns igen (t.ex. nytt värde tillagt i backend men inte här). | ||
| export const getStatusLabel = (status) => STATUS_MAP[status]?.label ?? status; | ||
|
|
||
| // Mappning för ActivityType-enum → svensk rubrik. | ||
| // Används av AuditLogView i admin-vyn där log.action visas direkt. | ||
| export const ACTION_LABELS = { | ||
| 'CASE_CREATED': 'Ärende skapat', | ||
| 'STATUS_CHANGED': 'Status ändrad', | ||
| 'COMMENT_ADDED': 'Kommentar tillagd', | ||
| 'ASSIGNED': 'Veterinär tilldelad', | ||
| 'UNASSIGNED': 'Ärende släppt', | ||
| 'UPDATED': 'Ärende uppdaterat' | ||
| }; | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| export const getActionLabel = (action) => ACTION_LABELS[action] ?? action; | ||
18 changes: 17 additions & 1 deletion
18
src/main/java/org/example/vet1177/entities/RecordStatus.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.