Skip to content
Merged

v2.20.0 #2873

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
3f6a5a7
Prepare 2.20.0-develop
MichMich Apr 1, 2022
b4e75f6
fix problems with non latin fonds caused by updating to fontsource (f…
khassel Apr 5, 2022
439690b
Merge pull request #2836 from khassel/fix-non-latin
MichMich Apr 9, 2022
288a008
Update electron.js
rohitdharavath Apr 20, 2022
df0f048
Added outgoing notification
eouia Apr 26, 2022
58569a6
Added ECMA Version of lint to 2020
eouia Apr 26, 2022
038b676
Change property name clearly
eouia Apr 26, 2022
0f39b77
fix typo jsdom tag returns
eouia Apr 26, 2022
1d90c5e
Add JSDoc description
eouia Apr 26, 2022
d730dd0
Merge pull request #2839 from rohitdharavath/patch-1
MichMich Apr 26, 2022
8578900
update deps
khassel May 2, 2022
6504b5e
Update github actions and tested node versions
May 2, 2022
fe83fe3
Update CHANGELOG
May 2, 2022
bb1d343
Update node test matrix for real
May 2, 2022
c3b2aae
Show endDate for calendar events
rejas May 10, 2022
ed3aceb
Update CHANGELOG
rejas May 10, 2022
3b55886
added a new config option `httpHeaders` used by helmet
khassel May 13, 2022
8e5267d
Merge pull request #2842 from MMRIZE/weather
MichMich May 18, 2022
938619c
Merge pull request #2843 from khassel/update-deps
MichMich May 18, 2022
05621c9
Merge branch 'develop' into actions
MichMich May 18, 2022
3e65ac6
Merge pull request #2844 from rejas/actions
MichMich May 18, 2022
b13414c
Merge branch 'develop' into issue_2192
MichMich May 18, 2022
094881f
Merge pull request #2848 from rejas/issue_2192
MichMich May 18, 2022
e598dbb
Merge branch 'develop' into iframe
MichMich May 18, 2022
cbda20f
Merge pull request #2850 from khassel/iframe
MichMich May 18, 2022
b55b3bd
update dependencies including electron to v19
khassel May 24, 2022
0023c64
use internal fetch function of node instead external `node-fetch` lib…
khassel May 27, 2022
a4c77f0
Merge pull request #2853 from khassel/update_deps
MichMich May 27, 2022
ab7934f
Merge branch 'develop' into fetch
khassel May 27, 2022
ae72ed8
improve startApplication
khassel May 27, 2022
4f1db74
Merge pull request #2855 from khassel/fetch
MichMich May 28, 2022
591f907
fix newsfeedfetcher using correct stream version (changed with node-1…
khassel May 28, 2022
701ce8a
chore: Set permissions for GitHub actions
nathannaveen May 30, 2022
fe7b404
chore: Included githubactions in the dependabot config
naveensrinivasan Jun 2, 2022
c0743ce
Merge pull request #2857 from khassel/fetch
MichMich Jun 4, 2022
70da1d6
Merge pull request #2861 from turrisxyz/Dependabot-GitHub-Actions
MichMich Jun 4, 2022
47aefb0
Merge pull request #2858 from turrisxyz/Pinned-Dependencies-GitHub
MichMich Jun 4, 2022
9b20518
Use .yaml instead of .yml
KristjanESPERANTO Jun 6, 2022
87e011f
Add entry for YAML file extention
KristjanESPERANTO Jun 6, 2022
604a555
Include duplicate events in broadcasts
kolbyjack Jun 9, 2022
c82de1e
Group filters that only apply when limiting for display
kolbyjack Jun 9, 2022
da0489f
Merge pull request #2866 from kolbyjack/broadcast-duplicate-events
MichMich Jun 17, 2022
c411ac8
Merge pull request #2864 from KristjanESPERANTO/develop
MichMich Jun 17, 2022
1435efa
update depencies (before upcoming new release)
khassel Jun 24, 2022
9a76920
Merge pull request #2870 from khassel/update_deps
MichMich Jun 25, 2022
0baf58f
fix regression calendar.maximumEntries not used
sdetweil Jun 28, 2022
1f4ac82
add changelog for #2868
sdetweil Jun 28, 2022
e25209d
Merge pull request #2871 from sdetweil/fix_maxEntries
MichMich Jun 28, 2022
b716ec3
Release v2.20.0
MichMich Jul 2, 2022
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
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2018,
"ecmaVersion": 2020,
"ecmaFeatures": {
"globalReturn": true
}
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@ on:
pull_request:
branches: [master, develop]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
node-version: [14.x, 16.x, 17.x]
node-version: [14.x, 16.x, 18.x]
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This workflow runs the automated test and uploads the coverage results to codecov.io
# For more information see: https://github.com/codecov/codecov-action

name: "Run Codecov Tests"

Expand All @@ -8,13 +9,16 @@ on:
pull_request:
branches: [master, develop]

permissions:
contents: read

jobs:
run-and-upload-coverage-report:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install dependencies and run coverage
run: |
Xvfb :99 -screen 0 1024x768x16 &
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# This workflow enforces the update of a changelog file on every pull request
# For more information see: https://github.com/dangoslen/changelog-enforcer

name: "Enforce Changelog"

Expand All @@ -11,10 +12,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Enforce changelog️
uses: dangoslen/changelog-enforcer@v2
uses: dangoslen/changelog-enforcer@v3
with:
changeLogPath: "CHANGELOG.md"
skipLabels: "Skip Changelog"
27 changes: 25 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,38 @@ This project adheres to [Semantic Versioning](https://semver.org/).

❤️ **Donate:** Enjoying MagicMirror²? [Please consider a donation!](https://magicmirror.builders/donate) With your help we can continue to improve the MagicMirror².

## [2.20.0] - 2022-07-02

Special thanks to the following contributors: @eouia, @khassel, @kolbyjack, @KristjanESPERANTO, @nathannaveen, @naveensrinivasan, @rejas, @rohitdharavath and @sdetweil.

### Added

- Added a new config option `httpHeaders` used by helmet (see https://helmetjs.github.io/). You can now set own httpHeaders which will override the defaults in `js/defauls.js` which is useful e.g. if you want to embed MagicMirror into annother website (solves #2847).
- Show endDate for calendar events when dateHeader is enabled and showEnd is set to true (#2192).
- Added the notification emitting from the weather module on infromation updated.
- Use recommended file extention for YAML files (#2864).

### Updated

- Use latest node 18 when running tests on github actions.
- Update `electron` to v19 and other dependencies.
- Use internal fetch function of node instead external `node-fetch` library if used node version >= `v18`.
- Include duplicate events in broadcasts.

### Fixed

- Fix problems with non latin fonds caused by updating to fontsource (fixes #2835).

## [2.19.0] - 2022-04-01

Special thanks to the following contributors: @10bias, @CFenner, @JHWelch, @k1rd3rf, @khassel, @kolbyjack, @krekos, @KristjanESPERANTO, @Nerfzooka, @oraclesean, @oscarb, @philnagel, @rejas, @sdetweil, @shin10, @SiderealArt and @Tom-Hirschberger.

### Added

- Added a config option under the weather module, `absoluteDates`, providing an option to format weather forecast date output with either absolute or relative dates.
- Added test for new weather forecast `absoluteDates` porperty.
- Added test for new weather forecast `absoluteDates` property.
- The modules get a class hidden added/removed if they get hidden/shown which will also toggle pointer-events.
- Added new config option `showTitleAsUrl` to newsfeed module. If set, the diplayed title is a link to the article which is useful when running in a browser and you want to read this article.
- Added new config option `showTitleAsUrl` to newsfeed module. If set, the displayed title is a link to the article which is useful when running in a browser and you want to read this article.
- Added internal cors proxy to get weather providers working without public proxies (fixes #2714). The new url `http(s)://address:port/cors?url=https://whatever-to-proxy` can be used in other modules too.
- Added a WeatherProvider for Weatherflow.
- Added new env var `ELECTRON_DISABLE_GPU` which disable gpu under electron if set (fixes #2831).
Expand All @@ -39,6 +61,7 @@ Special thanks to the following contributors: @10bias, @CFenner, @JHWelch, @k1rd
- Don't adjust startDate for full day events if endDate is in the past.
- Fix windspeed conversion error in openweathermap provider. (#2812)
- Fix conflicting parms turning off showEnd for full day events. (#2629)
- Fix regression, calendar.maximumEntries not used to filter calendar level entries (#2868)

## [2.18.0] - 2022-01-01

Expand Down
28 changes: 14 additions & 14 deletions fonts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions fonts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"url": "https://github.com/MichMich/MagicMirror/issues"
},
"dependencies": {
"@fontsource/roboto": "^4.5.5",
"@fontsource/roboto-condensed": "^4.5.6"
"@fontsource/roboto": "^4.5.7",
"@fontsource/roboto-condensed": "^4.5.8"
}
}
19 changes: 8 additions & 11 deletions fonts/roboto.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,54 @@
font-family: Roboto;
font-style: normal;
font-weight: 100;
src: local("Roboto Thin"), local("Roboto-Thin"), url("node_modules/@fontsource/roboto/files/roboto-latin-100-normal.woff2") format("woff2"), url("node_modules/@fontsource/roboto/files/roboto-latin-100-normal.woff") format("woff");
src: local("Roboto Thin"), local("Roboto-Thin"), url("node_modules/@fontsource/roboto/files/roboto-all-100-normal.woff") format("woff");
}

@font-face {
font-family: "Roboto Condensed";
font-style: normal;
font-weight: 300;
src: local("Roboto Condensed Light"), local("RobotoCondensed-Light"), url("node_modules/@fontsource/roboto-condensed/files/roboto-condensed-latin-300-normal.woff2") format("woff2"),
url("node_modules/@fontsource/roboto-condensed/files/roboto-condensed-latin-300-normal.woff") format("woff");
src: local("Roboto Condensed Light"), local("RobotoCondensed-Light"), url("node_modules/@fontsource/roboto-condensed/files/roboto-condensed-all-300-normal.woff") format("woff");
}

@font-face {
font-family: "Roboto Condensed";
font-style: normal;
font-weight: 400;
src: local("Roboto Condensed"), local("RobotoCondensed-Regular"), url("node_modules/@fontsource/roboto-condensed/files/roboto-condensed-latin-400-normal.woff2") format("woff2"),
url("node_modules/@fontsource/roboto-condensed/files/roboto-condensed-latin-400-normal.woff") format("woff");
src: local("Roboto Condensed"), local("RobotoCondensed-Regular"), url("node_modules/@fontsource/roboto-condensed/files/roboto-condensed-all-400-normal.woff") format("woff");
}

@font-face {
font-family: "Roboto Condensed";
font-style: normal;
font-weight: 700;
src: local("Roboto Condensed Bold"), local("RobotoCondensed-Bold"), url("node_modules/@fontsource/roboto-condensed/files/roboto-condensed-latin-700-normal.woff2") format("woff2"),
url("node_modules/@fontsource/roboto-condensed/files/roboto-condensed-latin-700-normal.woff") format("woff");
src: local("Roboto Condensed Bold"), local("RobotoCondensed-Bold"), url("node_modules/@fontsource/roboto-condensed/files/roboto-condensed-all-700-normal.woff") format("woff");
}

@font-face {
font-family: Roboto;
font-style: normal;
font-weight: 400;
src: local("Roboto"), local("Roboto-Regular"), url("node_modules/@fontsource/roboto/files/roboto-latin-400-normal.woff2") format("woff2"), url("node_modules/@fontsource/roboto/files/roboto-latin-400-normal.woff") format("woff");
src: local("Roboto"), local("Roboto-Regular"), url("node_modules/@fontsource/roboto/files/roboto-all-400-normal.woff") format("woff");
}

@font-face {
font-family: Roboto;
font-style: normal;
font-weight: 500;
src: local("Roboto Medium"), local("Roboto-Medium"), url("node_modules/@fontsource/roboto/files/roboto-latin-500-normal.woff2") format("woff2"), url("node_modules/@fontsource/roboto/files/roboto-latin-500-normal.woff") format("woff");
src: local("Roboto Medium"), local("Roboto-Medium"), url("node_modules/@fontsource/roboto/files/roboto-all-500-normal.woff") format("woff");
}

@font-face {
font-family: Roboto;
font-style: normal;
font-weight: 700;
src: local("Roboto Bold"), local("Roboto-Bold"), url("node_modules/@fontsource/roboto/files/roboto-latin-700-normal.woff2") format("woff2"), url("node_modules/@fontsource/roboto/files/roboto-latin-700-normal.woff") format("woff");
src: local("Roboto Bold"), local("Roboto-Bold"), url("node_modules/@fontsource/roboto/files/roboto-all-700-normal.woff") format("woff");
}

@font-face {
font-family: Roboto;
font-style: normal;
font-weight: 300;
src: local("Roboto Light"), local("Roboto-Light"), url("node_modules/@fontsource/roboto/files/roboto-latin-300-normal.woff2") format("woff2"), url("node_modules/@fontsource/roboto/files/roboto-latin-300-normal.woff") format("woff");
src: local("Roboto Light"), local("Roboto-Light"), url("node_modules/@fontsource/roboto/files/roboto-all-300-normal.woff") format("woff");
}
3 changes: 3 additions & 0 deletions js/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ const defaults = {
units: "metric",
zoom: 1,
customCss: "css/custom.css",
// httpHeaders used by helmet, see https://helmetjs.github.io/. You can add other/more object values by overriding this in config.js,
// e.g. you need to add `frameguard: false` for embedding MagicMirror in another website, see https://github.com/MichMich/MagicMirror/issues/2847
httpHeaders: { contentSecurityPolicy: false, crossOriginOpenerPolicy: false, crossOriginEmbedderPolicy: false, crossOriginResourcePolicy: false, originAgentCluster: false },

modules: [
{
Expand Down
2 changes: 1 addition & 1 deletion js/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Log = require("logger");
let config = process.env.config ? JSON.parse(process.env.config) : {};
// Module to control application life.
const app = electron.app;
// If ELECTRON_DISABLE_GPU is set electron is startet with --disable-gpu flag.
// If ELECTRON_DISABLE_GPU is set electron is started with --disable-gpu flag.
// See https://www.electronjs.org/docs/latest/tutorial/offscreen-rendering for more info.
if (process.env.ELECTRON_DISABLE_GPU !== undefined) {
app.disableHardwareAcceleration();
Expand Down
20 changes: 20 additions & 0 deletions js/fetch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* fetch
*
* @param {string} url to be fetched
* @param {object} options object e.g. for headers
* @class
*/
async function fetch(url, options) {
const nodeVersion = process.version.match(/^v(\d+)\.*/)[1];
if (nodeVersion >= 18) {
// node version >= 18
return global.fetch(url, options);
} else {
// node version < 18
const nodefetch = require("node-fetch");
return nodefetch(url, options);
}
}

module.exports = fetch;
4 changes: 2 additions & 2 deletions js/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const path = require("path");
const ipfilter = require("express-ipfilter").IpFilter;
const fs = require("fs");
const helmet = require("helmet");
const fetch = require("node-fetch");
const fetch = require("fetch");

const Log = require("logger");
const Utils = require("./utils.js");
Expand Down Expand Up @@ -69,7 +69,7 @@ function Server(config, callback) {
res.status(403).send("This device is not allowed to access your mirror. <br> Please check your config.js or config.js.sample to change this.");
});
});
app.use(helmet({ contentSecurityPolicy: false, crossOriginOpenerPolicy: false, crossOriginEmbedderPolicy: false, crossOriginResourcePolicy: false, originAgentCluster: false }));
app.use(helmet(config.httpHeaders));

app.use("/js", express.static(__dirname));

Expand Down
26 changes: 15 additions & 11 deletions modules/default/calendar/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,12 @@ Module.register("calendar", {
timeWrapper.className = "time light align-left " + this.timeClassForUrl(event.url);
timeWrapper.style.paddingLeft = "2px";
timeWrapper.innerHTML = moment(event.startDate, "x").format("LT");

// Add endDate to dataheaders if showEnd is enabled
if (this.config.showEnd) {
timeWrapper.innerHTML += " - " + moment(event.endDate, "x").format("LT");
}

eventWrapper.appendChild(timeWrapper);
titleWrapper.classList.add("align-right");
}
Expand Down Expand Up @@ -381,7 +387,7 @@ Module.register("calendar", {
}
}
} else if (event.startDate - now < this.config.getRelative * oneHour) {
// If event is within getRelative hours, display 'in xxx' time format or moment.fromNow()
// If event is within getRelative hours, display 'in xxx' time format or moment.fromNow()
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow());
}
} else {
Expand Down Expand Up @@ -490,22 +496,20 @@ Module.register("calendar", {
for (const e in calendar) {
const event = JSON.parse(JSON.stringify(calendar[e])); // clone object

if (event.endDate < now && limitNumberOfEntries) {
if (this.config.hidePrivate && event.class === "PRIVATE") {
// do not add the current event, skip it
continue;
}
if (this.config.hidePrivate) {
if (event.class === "PRIVATE") {
// do not add the current event, skip it
if (limitNumberOfEntries) {
if (event.endDate < now) {
continue;
}
}
if (this.config.hideOngoing && limitNumberOfEntries) {
if (event.startDate < now) {
if (this.config.hideOngoing && event.startDate < now) {
continue;
}
if (this.listContainsEvent(events, event)) {
continue;
}
}
if (this.listContainsEvent(events, event)) {
continue;
}
event.url = calendarUrl;
event.today = event.startDate >= today && event.startDate < today + 24 * 60 * 60 * 1000;
Expand Down
2 changes: 1 addition & 1 deletion modules/default/calendar/calendarfetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const CalendarUtils = require("./calendarutils");
const Log = require("logger");
const NodeHelper = require("node_helper");
const ical = require("node-ical");
const fetch = require("node-fetch");
const fetch = require("fetch");
const digest = require("digest-fetch");
const https = require("https");

Expand Down
3 changes: 2 additions & 1 deletion modules/default/calendar/calendarutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,8 @@ const CalendarUtils = {
return a.startDate - b.startDate;
});

return newEvents;
let maxEvents = newEvents.slice(0, config.maximumEntries);
return maxEvents;
},

/**
Expand Down
Loading