Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: type multi language controls (#1489)
- Loading branch information
1 parent
4e99390
commit 42d5112
Showing
12 changed files
with
118 additions
and
57 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
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
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
5 changes: 5 additions & 0 deletions
5
libs/vre/shared/app-string-literal/src/lib/dash-language.type.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export type DaschLanguage = 'de' | 'fr' | 'it' | 'en' | 'rm'; | ||
|
||
export function isDaschLanguage(value: string): value is DaschLanguage { | ||
return ['de', 'fr', 'it', 'en', 'rm'].includes(value); | ||
} |
9 changes: 9 additions & 0 deletions
9
libs/vre/shared/app-string-literal/src/lib/multi-language-form-array.type.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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { FormArray, FormControl, FormGroup } from '@angular/forms'; | ||
import { DaschLanguage } from './dash-language.type'; | ||
|
||
type MultiLanguageFormControl = FormGroup<{ | ||
language: FormControl<DaschLanguage>; | ||
value: FormControl<string>; | ||
}>; | ||
|
||
export type MultiLanguageFormArray = FormArray<MultiLanguageFormControl>; |
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.