Skip to content

Commit

Permalink
Reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
zsarnett committed Feb 14, 2022
1 parent 39e7ad1 commit cafec15
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
1 change: 1 addition & 0 deletions src/components/ha-form/ha-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export class HaForm extends LitElement implements HaFormElement {
.selector=${item.selector}
.value=${getValue(this.data, item)}
.label=${this._computeLabel(item, this.data)}
.disabled=${this.disabled}
.helper=${this._computeHelper(item)}
.required=${item.required}
></ha-selector>`
Expand Down
3 changes: 1 addition & 2 deletions src/components/ha-selector/ha-selector-icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ export class HaIconSelector extends LitElement {
.label=${this.label}
.value=${this.value}
@value-changed=${this._valueChanged}
>
</ha-icon-picker>
></ha-icon-picker>
`;
}

Expand Down
36 changes: 16 additions & 20 deletions src/panels/config/script/ha-script-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,6 @@ import "../ha-config-section";
import { configSections } from "../ha-panel-config";
import "./blueprint-script-editor";

const BASE_GUI_SCHEMA: HaFormSelector[] = [
{
name: "alias",
selector: {
text: {
type: "text",
},
},
},
{
name: "icon",
selector: {
icon: {},
},
},
];

export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {
@property({ attribute: false }) public hass!: HomeAssistant;

Expand Down Expand Up @@ -104,7 +87,22 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {

private _schema = memoizeOne(
(hasID: boolean, useBluePrint?: boolean, currentMode?: string) => {
const schema: HaFormSchema[] = [];
const schema: HaFormSchema[] = [
{
name: "alias",
selector: {
text: {
type: "text",
},
},
},
{
name: "icon",
selector: {
icon: {},
},
},
];

if (!hasID) {
schema!.push({
Expand Down Expand Up @@ -146,8 +144,6 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {
});
}

schema.unshift(...BASE_GUI_SCHEMA);

return schema;
}
);
Expand Down

0 comments on commit cafec15

Please sign in to comment.