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

Fix add application credential keyboard handling #21205

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import "@material/mwc-button";
import "@material/mwc-list/mwc-list-item";
import { mdiOpenInNew } from "@mdi/js";
import { ComboBoxLitRenderer } from "@vaadin/combo-box/lit";
Expand All @@ -11,6 +10,7 @@ import "../../../components/ha-combo-box";
import { createCloseHeading } from "../../../components/ha-dialog";
import "../../../components/ha-markdown";
import "../../../components/ha-textfield";
import "../../../components/ha-button";
import {
Copy link
Contributor

Choose a reason for hiding this comment

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

Refactor: Avoid non-null assertions for safer code.

The non-null assertions used in the properties like hass can lead to runtime errors if not properly initialized. Consider using TypeScript's strict null checks or optional chaining for better safety.

- public hass!: HomeAssistant;
+ public hass?: HomeAssistant;
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import "../../../components/ha-button";
import "../../../components/ha-button";
public hass?: HomeAssistant;

ApplicationCredential,
ApplicationCredentialsConfig,
Expand Down Expand Up @@ -231,10 +231,10 @@ export class DialogAddApplicationCredential extends LitElement {
</div>
`
: html`
<mwc-button slot="primaryAction" @click=${this._abortDialog}>
<ha-button slot="secondaryAction" @click=${this._abortDialog}>
${this.hass.localize("ui.common.cancel")}
</mwc-button>
<mwc-button
</ha-button>
<ha-button
slot="primaryAction"
.disabled=${!this._domain ||
!this._clientId ||
Expand All @@ -244,7 +244,7 @@ export class DialogAddApplicationCredential extends LitElement {
${this.hass.localize(
"ui.panel.config.application_credentials.editor.add"
)}
</mwc-button>
</ha-button>
`}
</ha-dialog>
`;
Expand Down
Loading