-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add better localize keys typings for config pages #17815
Conversation
5b9375f
to
2d63913
Compare
src/panels/config/automation/trigger/types/ha-automation-trigger-calendar.ts
Outdated
Show resolved
Hide resolved
…er-calendar.ts Co-authored-by: Bram Kragten <mail@bramkragten.nl>
@@ -59,7 +68,7 @@ export class HaConfigLovelaceDashboards extends LitElement { | |||
"ui.panel.config.lovelace.dashboards.picker.headers.icon" | |||
), | |||
type: "icon", | |||
template: (icon, dashboard) => | |||
template: (icon: DataTableItem["icon"], dashboard: DataTableItem) => |
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.
Instead, set the type of columns
to DataTableColumnContainer<DataTableItem>
, it makes the extra typing of dashboard unneeded
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 tried to infer the first parameter by improving the DataTableColumnContainer
type but I did not succeed because we can have custom key and this parameter can be undefined
. I wonder if we can just drop the first one and keep the second one only (DataTableItem
). I will be less confusing to use.
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.
Yeah, agree
This reverts commit f12f9c0.
Proposed change
Improve typings for come config pages :
I also dropped thingtalk unused files and removed some not needed localize exclusions.
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: