-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: enums can have a logic ordering (#1349)
Co-authored-by: Simon <simon@aam-digital.com>
- Loading branch information
1 parent
0e162ec
commit be13fd9
Showing
17 changed files
with
267 additions
and
136 deletions.
There are no files selected for viewing
This file contains 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
102 changes: 52 additions & 50 deletions
102
src/app/child-dev-project/children/aser/model/skill-levels.ts
This file contains 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,57 +1,59 @@ | ||
import { | ||
ConfigurableEnumConfig, | ||
ConfigurableEnumValue, | ||
EMPTY, | ||
} from "../../../../core/configurable-enum/configurable-enum.interface"; | ||
import { Ordering } from "../../../../core/configurable-enum/configurable-enum-ordering"; | ||
|
||
export type SkillLevel = ConfigurableEnumValue & { passed?: boolean }; | ||
export type SkillLevel = Ordering.EnumValue & { passed?: boolean }; | ||
|
||
export const readingLevels: ConfigurableEnumConfig<SkillLevel> = [ | ||
EMPTY, | ||
{ | ||
id: "Nothing", | ||
label: $localize`:Label reading level:Nothing`, | ||
}, | ||
{ | ||
id: "Read Letters", | ||
label: $localize`:Label reading level:Read Letters`, | ||
}, | ||
{ | ||
id: "Read Words", | ||
label: $localize`:Label reading level:Read Words`, | ||
}, | ||
{ | ||
id: "Read Sentence", | ||
label: $localize`:Label reading level:Read Sentence`, | ||
}, | ||
{ | ||
id: "Read Paragraph", | ||
label: $localize`:Label reading level:Read Paragraph`, | ||
passed: true, | ||
}, | ||
]; | ||
export const readingLevels: ConfigurableEnumConfig<SkillLevel> = | ||
Ordering.imposeTotalOrdering([ | ||
EMPTY, | ||
{ | ||
id: "Nothing", | ||
label: $localize`:Label reading level:Nothing`, | ||
}, | ||
{ | ||
id: "Read Letters", | ||
label: $localize`:Label reading level:Read Letters`, | ||
}, | ||
{ | ||
id: "Read Words", | ||
label: $localize`:Label reading level:Read Words`, | ||
}, | ||
{ | ||
id: "Read Sentence", | ||
label: $localize`:Label reading level:Read Sentence`, | ||
}, | ||
{ | ||
id: "Read Paragraph", | ||
label: $localize`:Label reading level:Read Paragraph`, | ||
passed: true, | ||
}, | ||
]); | ||
|
||
export const mathLevels: ConfigurableEnumConfig<SkillLevel> = [ | ||
EMPTY, | ||
{ | ||
id: "Nothing", | ||
label: $localize`:Label math level:Nothing`, | ||
}, | ||
{ | ||
id: "Numbers 1-9", | ||
label: $localize`:Label math level:Numbers 1-9`, | ||
}, | ||
{ | ||
id: "Numbers 10-99", | ||
label: $localize`:Label math level:Numbers 10-99`, | ||
}, | ||
{ | ||
id: "Subtraction", | ||
label: $localize`:Label math level:Subtraction`, | ||
}, | ||
{ | ||
id: "Division", | ||
label: $localize`:Label math level:Division`, | ||
passed: true, | ||
}, | ||
]; | ||
export const mathLevels: ConfigurableEnumConfig<SkillLevel> = | ||
Ordering.imposeTotalOrdering([ | ||
EMPTY, | ||
{ | ||
id: "Nothing", | ||
label: $localize`:Label math level:Nothing`, | ||
}, | ||
{ | ||
id: "Numbers 1-9", | ||
label: $localize`:Label math level:Numbers 1-9`, | ||
}, | ||
{ | ||
id: "Numbers 10-99", | ||
label: $localize`:Label math level:Numbers 10-99`, | ||
}, | ||
{ | ||
id: "Subtraction", | ||
label: $localize`:Label math level:Subtraction`, | ||
}, | ||
{ | ||
id: "Division", | ||
label: $localize`:Label math level:Division`, | ||
passed: true, | ||
}, | ||
]); |
This file contains 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 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 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 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 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,20 +1,22 @@ | ||
import { ConfigurableEnumValue } from "../core/configurable-enum/configurable-enum.interface"; | ||
import { Ordering } from "../core/configurable-enum/configurable-enum-ordering"; | ||
|
||
export const warningLevels: ConfigurableEnumValue[] = [ | ||
{ | ||
id: "", | ||
label: "", | ||
}, | ||
{ | ||
id: "OK", | ||
label: $localize`:Label warning level:Solved`, | ||
}, | ||
{ | ||
id: "WARNING", | ||
label: $localize`:Label warning level:Needs Follow-Up`, | ||
}, | ||
{ | ||
id: "URGENT", | ||
label: $localize`:Label warning level:Urgent Follow-Up`, | ||
}, | ||
]; | ||
export const warningLevels: ConfigurableEnumValue[] = | ||
Ordering.imposeTotalOrdering([ | ||
{ | ||
id: "", | ||
label: "", | ||
}, | ||
{ | ||
id: "OK", | ||
label: $localize`:Label warning level:Solved`, | ||
}, | ||
{ | ||
id: "WARNING", | ||
label: $localize`:Label warning level:Needs Follow-Up`, | ||
}, | ||
{ | ||
id: "URGENT", | ||
label: $localize`:Label warning level:Urgent Follow-Up`, | ||
}, | ||
]); |
This file contains 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 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
Oops, something went wrong.