diff --git a/.github/workflows/automated-tests.yaml b/.github/workflows/automated-tests.yaml index 6fbc816d..05ce5e45 100644 --- a/.github/workflows/automated-tests.yaml +++ b/.github/workflows/automated-tests.yaml @@ -23,7 +23,7 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: "npm" @@ -31,7 +31,7 @@ jobs: run: | Xvfb :99 -screen 0 1024x768x16 & export DISPLAY=:99 - npm install + npm run install-mm:dev touch css/custom.css npm run test:prettier npm run test:js diff --git a/.github/workflows/codecov-test-suites.yaml b/.github/workflows/codecov-test-suites.yaml index c7f0195d..b46a4724 100644 --- a/.github/workflows/codecov-test-suites.yaml +++ b/.github/workflows/codecov-test-suites.yaml @@ -27,7 +27,7 @@ jobs: touch css/custom.css npm run test:coverage - name: Upload coverage results to codecov - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 with: files: ./coverage/lcov.info fail_ci_if_error: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c55d53c..8a498358 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,12 +12,17 @@ _This release is scheduled to be released on 2022-10-01._ ## Added - Possibility to fetch calendars through socket notifications. +- New scripts `install-mm` (and `install-mm:dev`) for simplifying mm installation (now: `npm run install-mm`) and adding params `--no-audit --no-fund --no-update-notifier` for less noise. +- New `showTimeToday` option in calendar module shows time for current-day events even if `timeFormat` is `"relative"` ## Updated +- Removed DAYAFTERTOMORROW from English + ## Fixed - Broadcast all calendar events while still honoring global and per-calendar maximumEntries. +- Respect rss ttl provided by newsfeed (#2883). ## [2.20.0] - 2022-07-02 diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index ec137d26..bd4a9a78 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -37,6 +37,7 @@ Module.register("calendar", { hidePrivate: false, hideOngoing: false, hideTime: false, + showTimeToday: false, colored: false, coloredSymbolOnly: false, customEvents: [], // Array of {keyword: "", symbol: "", color: ""} where Keyword is a regexp and symbol/color are to be applied for matched @@ -372,7 +373,7 @@ Module.register("calendar", { } else { timeWrapper.innerHTML = this.capFirst( moment(event.startDate, "x").calendar(null, { - sameDay: "[" + this.translate("TODAY") + "]", + sameDay: this.config.showTimeToday ? "LT" : "[" + this.translate("TODAY") + "]", nextDay: "[" + this.translate("TOMORROW") + "]", nextWeek: "dddd", sameElse: event.fullDayEvent ? this.config.fullDayEventDateFormat : this.config.dateFormat diff --git a/modules/default/newsfeed/newsfeedfetcher.js b/modules/default/newsfeed/newsfeedfetcher.js index a4d48ccd..85a2136d 100644 --- a/modules/default/newsfeed/newsfeedfetcher.js +++ b/modules/default/newsfeed/newsfeedfetcher.js @@ -78,6 +78,19 @@ const NewsfeedFetcher = function (url, reloadInterval, encoding, logFeedWarnings scheduleTimer(); }); + parser.on("ttl", (minutes) => { + try { + // 86400000 = 24 hours is mentioned in the docs as maximum value: + const ttlms = Math.min(minutes * 60 * 1000, 86400000); + if (ttlms > reloadInterval) { + reloadInterval = ttlms; + Log.info("Newsfeed-Fetcher: reloadInterval set to ttl=" + reloadInterval + " for url " + url); + } + } catch (error) { + Log.warn("Newsfeed-Fetcher: feed ttl is no valid integer=" + minutes + " for url " + url); + } + }); + const nodeVersion = Number(process.version.match(/^v(\d+\.\d+)/)[1]); const headers = { "User-Agent": "Mozilla/5.0 (Node.js " + nodeVersion + ") MagicMirror/" + global.version, diff --git a/package.json b/package.json index 277eb0ac..aea63ed0 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,11 @@ "start": "DISPLAY=\"${DISPLAY:=:0}\" ./node_modules/.bin/electron js/electron.js", "start:dev": "DISPLAY=\"${DISPLAY:=:0}\" ./node_modules/.bin/electron js/electron.js dev", "server": "node ./serveronly", - "install": "echo \"Installing vendor files ...\n\" && cd vendor && npm install --loglevel=error", - "install-fonts": "echo \"Installing fonts ...\n\" && cd fonts && npm install --loglevel=error", - "postinstall": "npm run install-fonts && echo \"MagicMirror² installation finished successfully! \n\"", + "install-mm": "npm install --no-audit --no-fund --no-update-notifier --only=prod --omit=dev", + "install-mm:dev": "npm install --no-audit --no-fund --no-update-notifier", + "install-vendor": "echo \"Installing vendor files ...\n\" && cd vendor && npm install --loglevel=error --no-audit --no-fund --no-update-notifier", + "install-fonts": "echo \"Installing fonts ...\n\" && cd fonts && npm install --loglevel=error --no-audit --no-fund --no-update-notifier", + "postinstall": "npm run install-vendor && npm run install-fonts && echo \"MagicMirror² installation finished successfully! \n\"", "test": "NODE_ENV=test jest -i --forceExit", "test:coverage": "NODE_ENV=test nyc --reporter=lcov --reporter=text jest -i --forceExit", "test:electron": "NODE_ENV=test jest --selectProjects electron -i --forceExit", diff --git a/tests/e2e/translations_spec.js b/tests/e2e/translations_spec.js index d05837cd..89ae60d9 100644 --- a/tests/e2e/translations_spec.js +++ b/tests/e2e/translations_spec.js @@ -164,7 +164,7 @@ describe("Translations", function () { dom.window.onload = function () { const { Translator } = dom.window; - Translator.load(mmm, translations.en, false, function () { + Translator.load(mmm, translations.de, false, function () { base = Object.keys(Translator.translations[mmm.name]).sort(); done(); }); @@ -175,8 +175,10 @@ describe("Translations", function () { console.log(missing); }); + // Using German as the base rather than English, since + // at least one translated word doesn't exist in English. for (let language in translations) { - if (language === "en") { + if (language === "de") { continue; } diff --git a/translations/en.json b/translations/en.json index 43ba9c74..60217b96 100644 --- a/translations/en.json +++ b/translations/en.json @@ -3,7 +3,6 @@ "TODAY": "Today", "TOMORROW": "Tomorrow", - "DAYAFTERTOMORROW": "In 2 days", "RUNNING": "Ends in", "EMPTY": "No upcoming events.", "WEEK": "Week {weekNumber}",