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

Migrate more-info-dialog to mwc and Lit #6345

Merged
merged 7 commits into from
Jul 8, 2020
Merged

Migrate more-info-dialog to mwc and Lit #6345

merged 7 commits into from
Jul 8, 2020

Conversation

bramkragten
Copy link
Member

Proposed change

Migrates the more-info dialog to mwc elements and Lit.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

const domain = computeDomain(entityId);

return html`
<ha-dialog open @closed=${this._close} .heading=${true} hideActions>
Copy link
Member

Choose a reason for hiding this comment

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

Can we make heading a boolean attribute so we can just make this

Suggested change
<ha-dialog open @closed=${this._close} .heading=${true} hideActions>
<ha-dialog open @closed=${this._close} heading hideActions>

I think we might also want to rename it to something that better describes what it does. renderHeading ?

Copy link
Member Author

Choose a reason for hiding this comment

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

it is a hack, it is from mwc-dialog it should be a string they only call renderHeading when heading is truthy, but we want to use the slot...

Copy link
Member

Choose a reason for hiding this comment

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

lol ok

src/components/ha-dialog.ts Outdated Show resolved Hide resolved
<ha-svg-icon .path=${mdiClose}></ha-svg-icon>
</mwc-icon-button>
<div class="main-title" main-title @click=${this._enlarge}>
${stateObj ? computeStateName(stateObj) : ""}
Copy link
Member

Choose a reason for hiding this comment

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

Should we even render all of this when there is no stateObj ? I think we only did that in Polymer because it was so difficult to not do it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Should we no render the dialog at all?

Copy link
Member

Choose a reason for hiding this comment

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

Nope. No state object means we hide the dialog.

bramkragten and others added 2 commits July 8, 2020 08:59
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
@bramkragten bramkragten merged commit b429fe8 into dev Jul 8, 2020
@bramkragten bramkragten deleted the more-info-mwc branch July 8, 2020 09:38
@bramkragten bramkragten mentioned this pull request Jul 14, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 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.

None yet

4 participants