Skip to content

Commit 1dcd913

Browse files
authored
Merge pull request home-assistant#5481 from home-assistant/dev
20200407.0
2 parents ec95000 + 471a5f8 commit 1dcd913

File tree

20 files changed

+191
-262
lines changed

20 files changed

+191
-262
lines changed

build-scripts/gulp/entry-html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ gulp.task("gen-index-gallery-dev", (done) => {
222222
// In dev mode we don't mangle names, so we hardcode urls. That way we can
223223
// run webpack as last in watch mode, which blocks output.
224224
const content = renderGalleryTemplate("index", {
225-
latestGalleryJS: "./entrypoint.js",
225+
latestGalleryJS: "./frontend_latest/entrypoint.js",
226226
});
227227

228228
fs.outputFileSync(path.resolve(config.gallery_root, "index.html"), content);

build-scripts/gulp/webpack.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,8 @@ gulp.task(
150150

151151
gulp.task("webpack-dev-server-gallery", () => {
152152
runDevServer({
153-
compiler: webpack(
154-
createGalleryConfig({ latestBuild: true, isProdBuild: false })
155-
),
153+
// We don't use the es5 build, but the dev server will fuck up the publicPath if we don't
154+
compiler: webpack(bothBuilds(createGalleryConfig, { isProdBuild: false })),
156155
contentBase: paths.gallery_root,
157156
port: 8100,
158157
});

build-scripts/webpack.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,6 @@ const createHassioConfig = ({ isProdBuild, latestBuild }) => {
245245
};
246246

247247
const createGalleryConfig = ({ isProdBuild, latestBuild }) => {
248-
if (!latestBuild) {
249-
throw new Error("Gallery only supports latest build!");
250-
}
251248
const config = createWebpackConfig({
252249
entry: {
253250
entrypoint: path.resolve(paths.gallery_dir, "src/entrypoint.js"),

gallery/src/components/demo-card.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ class DemoCard extends PolymerElement {
5757
};
5858
}
5959

60+
ready() {
61+
super.ready();
62+
this.addEventListener("ll-rebuild", () => {
63+
this._configChanged(this.config);
64+
});
65+
}
66+
6067
_configChanged(config) {
6168
const card = this.$.card;
6269
while (card.lastChild) {

gallery/src/demos/demo-hui-media-control-card.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { PolymerElement } from "@polymer/polymer/polymer-element";
44
import { provideHass } from "../../../src/fake_data/provide_hass";
55
import "../components/demo-cards";
66
import { createMediaPlayerEntities } from "../data/media_players";
7-
import "../../../src/panels/lovelace/cards/hui-media-control-card";
87

98
const CONFIGS = [
109
{

gallery/webpack.config.js

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,5 @@
1-
const path = require("path");
2-
const CopyWebpackPlugin = require("copy-webpack-plugin");
31
const { createGalleryConfig } = require("../build-scripts/webpack.js");
4-
const { babelLoaderConfig } = require("../build-scripts/babel.js");
5-
6-
const isProd = process.env.NODE_ENV === "production";
7-
const chunkFilename = isProd ? "chunk.[chunkhash].js" : "[name].chunk.js";
8-
const buildPath = path.resolve(__dirname, "dist");
9-
const publicPath = isProd ? "./" : "http://localhost:8080/";
10-
const latestBuild = true;
112

123
module.exports = createGalleryConfig({
134
latestBuild: true,
145
});
15-
16-
const bla = () => {
17-
const oldExports = {
18-
mode: isProd ? "production" : "development",
19-
// Disabled in prod while we make Home Assistant able to serve the right files.
20-
// Was source-map
21-
devtool: isProd ? "none" : "inline-source-map",
22-
entry: "./src/entrypoint.js",
23-
module: {
24-
rules: [
25-
babelLoaderConfig({ latestBuild }),
26-
{
27-
test: /\.css$/,
28-
use: "raw-loader",
29-
},
30-
{
31-
test: /\.(html)$/,
32-
use: {
33-
loader: "html-loader",
34-
options: {
35-
exportAsEs6Default: true,
36-
},
37-
},
38-
},
39-
],
40-
},
41-
optimization: webpackBase.optimization(latestBuild),
42-
plugins: [
43-
new CopyWebpackPlugin([
44-
"public",
45-
{ from: "../public", to: "static" },
46-
{ from: "../build-translations/output", to: "static/translations" },
47-
{
48-
from: "../node_modules/leaflet/dist/leaflet.css",
49-
to: "static/images/leaflet/",
50-
},
51-
{
52-
from: "../node_modules/roboto-fontface/fonts/roboto/*.woff2",
53-
to: "static/fonts/roboto/",
54-
},
55-
{
56-
from: "../node_modules/leaflet/dist/images",
57-
to: "static/images/leaflet/",
58-
},
59-
]),
60-
].filter(Boolean),
61-
resolve: webpackBase.resolve,
62-
output: {
63-
filename: "[name].js",
64-
chunkFilename: chunkFilename,
65-
path: buildPath,
66-
publicPath,
67-
},
68-
devServer: {
69-
contentBase: "./public",
70-
},
71-
};
72-
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
"web-component-tester": "^6.9.2",
179179
"webpack": "^4.40.2",
180180
"webpack-cli": "^3.3.9",
181-
"webpack-dev-server": "^3.8.1",
181+
"webpack-dev-server": "^3.10.3",
182182
"webpack-manifest-plugin": "^2.0.4",
183183
"workbox-webpack-plugin": "^4.1.1",
184184
"workerize-loader": "^1.1.0"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="home-assistant-frontend",
5-
version="20200406.0",
5+
version="20200407.0",
66
description="The Home Assistant frontend",
77
url="https://github.com/home-assistant/home-assistant-polymer",
88
author="The Home Assistant Authors",

src/panels/config/devices/ha-config-device-page.ts

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,47 @@
1+
import "@polymer/paper-tooltip/paper-tooltip";
12
import {
2-
property,
3-
LitElement,
4-
html,
5-
customElement,
63
css,
74
CSSResult,
5+
customElement,
6+
html,
7+
LitElement,
8+
property,
89
} from "lit-element";
9-
10+
import { ifDefined } from "lit-html/directives/if-defined";
1011
import memoizeOne from "memoize-one";
11-
12-
import "@polymer/paper-tooltip/paper-tooltip";
13-
14-
import "../../../layouts/hass-tabs-subpage";
15-
import "../../../layouts/hass-error-screen";
16-
import "../ha-config-section";
17-
18-
import "./device-detail/ha-device-info-card";
19-
import "./device-detail/ha-device-card-mqtt";
20-
import "./device-detail/ha-device-entities-card";
21-
import { HomeAssistant, Route } from "../../../types";
12+
import { isComponentLoaded } from "../../../common/config/is_component_loaded";
13+
import { computeStateName } from "../../../common/entity/compute_state_name";
14+
import { createValidEntityId } from "../../../common/entity/valid_entity_id";
15+
import { compare } from "../../../common/string/compare";
16+
import "../../../components/ha-icon-next";
17+
import "../../../components/entity/ha-state-icon";
18+
import { AreaRegistryEntry } from "../../../data/area_registry";
2219
import { ConfigEntry } from "../../../data/config_entries";
2320
import {
24-
EntityRegistryEntry,
25-
updateEntityRegistryEntry,
26-
findBatteryEntity,
27-
} from "../../../data/entity_registry";
28-
import {
29-
DeviceRegistryEntry,
3021
computeDeviceName,
22+
DeviceRegistryEntry,
3123
updateDeviceRegistryEntry,
3224
} from "../../../data/device_registry";
33-
import { AreaRegistryEntry } from "../../../data/area_registry";
25+
import {
26+
EntityRegistryEntry,
27+
findBatteryEntity,
28+
updateEntityRegistryEntry,
29+
} from "../../../data/entity_registry";
30+
import { SceneEntities, showSceneEditor } from "../../../data/scene";
31+
import { findRelated, RelatedResult } from "../../../data/search";
3432
import {
3533
loadDeviceRegistryDetailDialog,
3634
showDeviceRegistryDetailDialog,
3735
} from "../../../dialogs/device-registry-detail/show-dialog-device-registry-detail";
38-
import "../../../components/ha-icon-next";
39-
import { compare } from "../../../common/string/compare";
40-
import { computeStateName } from "../../../common/entity/compute_state_name";
41-
import { createValidEntityId } from "../../../common/entity/valid_entity_id";
36+
import "../../../layouts/hass-error-screen";
37+
import "../../../layouts/hass-tabs-subpage";
38+
import { HomeAssistant, Route } from "../../../types";
39+
import "../ha-config-section";
4240
import { configSections } from "../ha-panel-config";
43-
import { RelatedResult, findRelated } from "../../../data/search";
44-
import { SceneEntities, showSceneEditor } from "../../../data/scene";
41+
import "./device-detail/ha-device-card-mqtt";
42+
import "./device-detail/ha-device-entities-card";
43+
import "./device-detail/ha-device-info-card";
4544
import { showDeviceAutomationDialog } from "./device-detail/show-dialog-device-automation";
46-
import { isComponentLoaded } from "../../../common/config/is_component_loaded";
47-
import { ifDefined } from "lit-html/directives/if-defined";
4845

4946
export interface EntityRegistryStateEntry extends EntityRegistryEntry {
5047
stateName?: string;

src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
RowClickedEvent,
1616
} from "../../../../components/data-table/ha-data-table";
1717
import "../../../../components/ha-icon";
18+
import "../../../../components/ha-fab";
1819
import "../../../../layouts/hass-loading-screen";
1920
import "../../../../layouts/hass-tabs-subpage-data-table";
2021
import { HomeAssistant, Route } from "../../../../types";

src/panels/config/lovelace/resources/ha-config-lovelace-resources.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
RowClickedEvent,
2121
} from "../../../../components/data-table/ha-data-table";
2222
import "../../../../components/ha-icon";
23+
import "../../../../components/ha-fab";
2324
import "../../../../layouts/hass-loading-screen";
2425
import "../../../../layouts/hass-tabs-subpage-data-table";
2526
import { HomeAssistant, Route } from "../../../../types";

src/panels/logbook/ha-logbook.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,14 @@ class HaLogbook extends LitElement {
3939
protected render(): TemplateResult {
4040
if (!this.entries?.length) {
4141
return html`
42-
${this.hass.localize("ui.panel.logbook.entries_not_found")}
42+
<div class="container">
43+
${this.hass.localize("ui.panel.logbook.entries_not_found")}
44+
</div>
4345
`;
4446
}
4547

4648
return html`
47-
<div>
49+
<div class="container">
4850
${scroll({
4951
items: this.entries,
5052
renderItem: (item: LogbookEntry, index?: number) =>
@@ -154,13 +156,16 @@ class HaLogbook extends LitElement {
154156
color: var(--primary-color);
155157
}
156158
159+
.container {
160+
padding: 0 16px;
161+
}
162+
157163
.uni-virtualizer-host {
158164
display: block;
159165
position: relative;
160166
contain: strict;
161167
height: 100%;
162168
overflow: auto;
163-
padding: 0 16px;
164169
}
165170
166171
.uni-virtualizer-host > * {

0 commit comments

Comments
 (0)