Skip to content
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

Convert hui-weblink-row to TypeScript/LitElement #1898

Merged
merged 3 commits into from
Oct 28, 2018

Conversation

iantrich
Copy link
Member

No description provided.

@ghost ghost assigned iantrich Oct 28, 2018
@ghost ghost added the in progress label Oct 28, 2018
}

public setConfig(config): void {
if (!config || !config.icon || !config.name || !config.url) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why we make icon mandatory, can't we default to one?

Same with name, if no name, use url?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, we should add a type for this config.

* Made name and icon fields optional. Will create a corresponding PR to the docs to update them as Optional
* Updated entities-card to not check weblink config as that is the job of the element (entities-card should be updated to not check service-call config either as that is the job of the row element as well)
iantrich added a commit to home-assistant/home-assistant.io that referenced this pull request Oct 28, 2018
throw new Error("Invalid Configuration: 'url' required");
}

config.icon = config.icon || "hass:link";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should never change the passed in value. Instead do this:

this._config = {
  icon: 'hass:link',
  name: config.url,
  ...config
}

@balloob balloob merged commit 4f6bae1 into home-assistant:dev Oct 28, 2018
@ghost ghost removed the in progress label Oct 28, 2018
frenck pushed a commit to home-assistant/home-assistant.io that referenced this pull request Oct 29, 2018
* weblink parameters `name` and `icon` optional

This will coincide with home-assistant/frontend#1898

* 🚑 Fixes build error
zsarnett pushed a commit to zsarnett/home-assistant.io that referenced this pull request Oct 30, 2018
* weblink parameters `name` and `icon` optional

This will coincide with home-assistant/frontend#1898

* 🚑 Fixes build error
@iantrich iantrich deleted the ts-weblink-row branch November 16, 2018 19:18
@github-actions github-actions bot locked and limited conversation to collaborators Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants