-
Notifications
You must be signed in to change notification settings - Fork 397
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
fix: add types to edgeconfig.ts #2699
fix: add types to edgeconfig.ts #2699
Conversation
@@ -20,7 +20,7 @@ | |||
"module": "es2020", | |||
"noImplicitOverride": true, | |||
"lib": [ | |||
"es2018", | |||
"es2022", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lib es version is bumped to es2022 to use .flat()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally target es version is lower than lib es version to compatibility.
but this project target es is higher than lib es version. ??
anyway, it is not change of target es version, so I think no effect browser compatibility.
ui/src/app/shared/edge/edgeconfig.ts
Outdated
public readonly description!: string; | ||
public readonly type!: string; | ||
public readonly isRequired!: boolean; | ||
public readonly isPassword!: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems type and isPassword is mssing so I added these field.
ui/src/app/shared/edge/edgeconfig.ts
Outdated
public readonly level: "INFO" | "OK" | "WARNING" | "FAULT"; | ||
public readonly persistencePriority: PersistencePriority; | ||
public readonly text: string; | ||
public readonly type!: "BOOLEAN" | "SHORT" | "INTEGER" | "LONG" | "FLOAT" | "DOUBLE" | "STRING"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added Non-Null Assertion !
to the mandatory fields.
ui/src/app/shared/edge/edgeconfig.ts
Outdated
@@ -413,7 +412,7 @@ export class EdgeConfig { | |||
* Lists all available Factories, grouped by category. | |||
*/ | |||
public static listAvailableFactories(factories: { [id: string]: EdgeConfig.Factory }): CategorizedFactories[] { | |||
const allFactories = [ | |||
const allFactories: CategorizedFactories[] = [ | |||
{ | |||
category: { title: 'Simulatoren', icon: 'flask-outline' }, | |||
factories: Object.entries(factories) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allFactories.factories was mixing flat list([]) and nested list([[]]). this is not type first. I rewrite flat-style because this is easily expected from the name factories
.
Codecov ReportAttention: Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #2699 +/- ##
=============================================
+ Coverage 56.03% 56.04% +0.01%
- Complexity 8041 8044 +3
=============================================
Files 2059 2059
Lines 87513 87513
Branches 6418 6418
=============================================
+ Hits 49032 49037 +5
+ Misses 36797 36792 -5
Partials 1684 1684 |
7a27dc4
to
9e68f08
Compare
9e68f08
to
61563e9
Compare
rebased! |
npx tsc --strict: 3646 -> 3622 errors