Skip to content

Commit

Permalink
Merge pull request #124 from HS-OS-AG-Intelligente-Agrarsysteme/front…
Browse files Browse the repository at this point in the history
…end/59027_edit_case

Edit Case
  • Loading branch information
MGRLMIS authored Nov 15, 2023
2 parents efe9075 + e798f2d commit 8d56b27
Show file tree
Hide file tree
Showing 10 changed files with 634 additions and 165 deletions.
9 changes: 7 additions & 2 deletions frontend/app/assets/localization/de-DE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ general:
problem: "Problem"
repair: "Reparatur"
save: "Speichern"
saveChanges: "Änderungen speichern"
service: "Service"
sort: "Sortieren"
status: "Status"
Expand All @@ -35,12 +36,16 @@ cases:
title: "Fälle"
actions:
addCase: "Neuen Fall anlegen"
updateCase: "Fall bearbeiten"
sortCases: "@:general.sort"
filterCases: "@:general.filter"
occasions:
notSpecified: "@:general.notSpecified"
service: "@:general.service"
problem: "@:general.repair"
status:
open: "Offen"
closed: "Geschlossen"
filterDialog:
title: "Fälle filtern"
toggleShared: "Fälle aus allen Werkstätten anzeigen"
Expand All @@ -56,8 +61,8 @@ cases:
deleteCaseErrorMessage: "Der Fall konnte nicht gelöscht werden."
occasion:
unknown: "Unbekannt"
service_routine: "Service"
problem_defect: "Reparatur"
service_routine: "@:general.service"
problem_defect: "@:general.repair"
status:
open: "Offen"
closed: "Geschlossen"
Expand Down
9 changes: 7 additions & 2 deletions frontend/app/assets/localization/en-GB.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ general:
problem: "Problem"
repair: "Repair"
save: "Save"
saveChanges: "Save changes"
service: "Service"
sort: "Sort"
status: "Status"
Expand All @@ -35,12 +36,16 @@ cases:
title: "Cases"
actions:
addCase: "Add case"
updateCase: "Update case"
sortCases: "@:general.sort"
filterCases: "@:general.filter"
occasions:
notSpecified: "@:general.notSpecified"
service: "@:general.service"
problem: "@:general.repair"
status:
open: "Open"
closed: "Closed"
filterDialog:
title: "Filter cases"
toggleShared: "Show cases from all workshops"
Expand All @@ -56,8 +61,8 @@ cases:
deleteCaseErrorMessage: "The case could not be deleted."
occasion:
unknown: "Unknown"
service_routine: "Service"
problem_defect: "Repair"
service_routine: "@:general.service"
problem_defect: "@:general.repair"
status:
open: "Open"
closed: "Closed"
Expand Down
41 changes: 22 additions & 19 deletions frontend/app/lib/dialogs/add_case_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -224,25 +224,28 @@ class AddDialogForm extends StatelessWidget {
EnumToString.convertToString(newValue);
},
builder: (FormFieldState<CaseOccasion> field) {
return SegmentedButton(
emptySelectionAllowed: true,
segments: <ButtonSegment<CaseOccasion>>[
ButtonSegment<CaseOccasion>(
value: CaseOccasion.service_routine,
label: Text(tr("cases.occasions.service")),
),
ButtonSegment<CaseOccasion>(
value: CaseOccasion.problem_defect,
label: Text(tr("cases.occasions.problem")),
),
],
selected: {field.value},
onSelectionChanged: (p0) {
final CaseOccasion newVal =
p0.isEmpty ? CaseOccasion.unknown : p0.first!;
// newCaseDto.occasion = newVal;
field.didChange(newVal);
},
return SizedBox(
width: 275,
child: SegmentedButton(
emptySelectionAllowed: true,
segments: <ButtonSegment<CaseOccasion>>[
ButtonSegment<CaseOccasion>(
value: CaseOccasion.service_routine,
label: Text(tr("cases.occasions.service")),
),
ButtonSegment<CaseOccasion>(
value: CaseOccasion.problem_defect,
label: Text(tr("cases.occasions.problem")),
),
],
selected: {field.value},
onSelectionChanged: (p0) {
final CaseOccasion newVal =
p0.isEmpty ? CaseOccasion.unknown : p0.first!;
// newCaseDto.occasion = newVal;
field.didChange(newVal);
},
),
);
},
),
Expand Down
Loading

0 comments on commit 8d56b27

Please sign in to comment.