Merge remote-tracking branch 'origin/develop' into tests-404-vendors

This commit is contained in:
Rodrigo Ramírez Norambuena 2019-08-09 01:46:11 -04:00
commit ce10e91a60
14 changed files with 75 additions and 26 deletions

View File

@ -1,3 +1,4 @@
dist: trusty
language: node_js
node_js:
- "8"

View File

@ -12,12 +12,18 @@ This project adheres to [Semantic Versioning](http://semver.org/).
*This release is scheduled to be released on 2019-10-01.*
### Added
- Spanish translation for "PRECIP"
- Adding a Malay (Malaysian) translation for MagicMirror²
- Add test check URLs of vendors 200 and 404 HTTP CODE.
### Updated
- Updatenotification module: Display update notification for a limited (configurable) time.
- Enabled e2e/vendor_spec.js tests
### Updated
- Updatenotification module: Display update notification for a limited (configurable) time.
- The css/custom.css will be rename after the next release. We've add into `run-start.sh` a instruction by GIT to ignore with `--skip-worktree` and `rm --cached`. The history about this change [#1540].
### Fixed
- Updatenotification module: Properly handle race conditions, prevent crash.
- Send `NEWS_FEED` notification also for the first news messages which are shown

View File

@ -1,7 +1,7 @@
The MIT License (MIT)
=====================
Copyright © 2016-2017 Michael Teeuw
Copyright © 2016-2019 Michael Teeuw
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation

View File

@ -130,13 +130,6 @@ if $NPM_INSTALL; then
echo -e "\e[96mInstalling npm ...\e[90m"
# Fetch the latest version of npm from the selected branch
# The NODE_STABLE_BRANCH variable will need to be manually adjusted when a new branch is released. (e.g. 7.x)
# Only tested (stable) versions are recommended as newer versions could break MagicMirror.
#NODE_STABLE_BRANCH="9.x"
#curl -sL https://deb.nodesource.com/setup_$NODE_STABLE_BRANCH | sudo -E bash -
#
sudo apt-get install -y npm
echo -e "\e[92mnpm installation Done!\e[0m"
fi

View File

@ -203,7 +203,7 @@ var MM = (function() {
*/
var updateModuleContent = function(module, newHeader, newContent) {
var moduleWrapper = document.getElementById(module.identifier);
if (moduleWrapper === null) return;
if (moduleWrapper === null) {return;}
var headerWrapper = moduleWrapper.getElementsByClassName("module-header");
var contentWrapper = moduleWrapper.getElementsByClassName("module-content");

View File

@ -273,7 +273,7 @@ Module.register("currentweather",{
if (this.config.useLocationAsHeader && this.config.location !== false) {
return this.config.location;
}
return this.data.header;
},

View File

@ -18,7 +18,7 @@ module.exports = NodeHelper.create({
configureModules: function(modules) {
// Push MagicMirror itself , biggest chance it'll show up last in UI and isn't overwritten
// others will be added in front, asynchronously
// others will be added in front, asynchronously
simpleGits.push({"module": "default", "git": SimpleGit(path.normalize(__dirname + "/../../../"))});
for (moduleName in modules) {

View File

@ -6,12 +6,12 @@ Module.register("updatenotification", {
},
suspended: false,
moduleList: {},
moduleList: {},
start: function () {
var self = this;
var self = this;
Log.log("Start updatenotification");
setInterval( () => { self.moduleList = {};self.updateDom(2) } , self.config.refreshInterval)
setInterval( () => { self.moduleList = {};self.updateDom(2); } , self.config.refreshInterval);
},
notificationReceived: function (notification, payload, sender) {
@ -38,15 +38,15 @@ Module.register("updatenotification", {
self.updateDom(2);
}
//self.show(1000, { lockString: self.identifier });
} else if (payload && payload.behind == 0){
// if the module WAS in the list, but shouldn't be
if(this.moduleList[payload.module] != undefined){
// remove it
delete this.moduleList[payload.module]
self.updateDom(2);
}
}
// if the module WAS in the list, but shouldn't be
if(this.moduleList[payload.module] != undefined){
// remove it
delete this.moduleList[payload.module];
self.updateDom(2);
}
}
},
diffLink: function(module, text) {
@ -66,7 +66,7 @@ Module.register("updatenotification", {
if(this.suspended==false){
// process the hash of module info found
for(key of Object.keys(this.moduleList)){
let m= this.moduleList[key]
let m= this.moduleList[key];
var message = document.createElement("div");
message.className = "small bright";

View File

@ -7,7 +7,7 @@
"start": "sh run-start.sh",
"install": "cd vendor && npm install",
"install-fonts": "cd fonts && npm install",
"postinstall": "sh installers/postinstall/postinstall.sh && npm run install-fonts",
"postinstall": "sh untrack-css.sh && sh installers/postinstall/postinstall.sh && npm run install-fonts",
"test": "NODE_ENV=test ./node_modules/mocha/bin/mocha tests --recursive",
"test:unit": "NODE_ENV=test ./node_modules/mocha/bin/mocha tests/unit --recursive",
"test:e2e": "NODE_ENV=test ./node_modules/mocha/bin/mocha tests/e2e --recursive",

View File

@ -1,3 +1,6 @@
./untrack-css.sh
if [ -z "$DISPLAY" ]; then #If not set DISPLAY is SSH remote or tty
export DISPLAY=:0 # Set by default display
fi

View File

@ -31,5 +31,6 @@
"UPDATE_INFO_SINGLE": "Tu actual instalación está {COMMIT_COUNT} commit cambios detrás de la rama {BRANCH_NAME}.",
"UPDATE_INFO_MULTIPLE": "Tu actual instalación está {COMMIT_COUNT} commits cambios detrás de la rama {BRANCH_NAME}.",
"FEELS": "Sensación térmica de"
"FEELS": "Sensación térmica de",
"PRECIP": "Precipitación"
}

33
translations/ms-my.json Normal file
View File

@ -0,0 +1,33 @@
{
"LOADING": "Tunggu Sebentar …",
"TODAY": "Hari ini",
"TOMORROW": "Esok",
"DAYAFTERTOMORROW": "Lusa",
"RUNNING": "Berakhir dalam",
"EMPTY": "Tidak ada agenda",
"WEEK": "Minggu ke-{weekNumber}",
"N": "U",
"NNE": "UUT",
"NE": "TL",
"ENE": "TTL",
"E": "T",
"ESE": "TT",
"SE": "T",
"SSE": "ST",
"S": "S",
"SSW": "SBD",
"SW": "BD",
"WSW": "BBD",
"W": "B",
"WNW": "BBL",
"NW": "BL",
"NNW": "UBL",
"UPDATE_NOTIFICATION": "MagicMirror² mempunyai update terkini.",
"UPDATE_NOTIFICATION_MODULE": "Modul {MODULE_NAME} mempunyai update terkini.",
"UPDATE_INFO_SINGLE": "Pemasangan MagicMirror² ini mempunyai {COMMIT_COUNT} commit terkebelakang dari branch {BRANCH_NAME}.",
"UPDATE_INFO_MULTIPLE": "Pemasangan MagicMirror² ini mempunyai {COMMIT_COUNT} commit terkebelakang dari branch {BRANCH_NAME}."
}

View File

@ -40,7 +40,8 @@ var translations = {
"cs" : "translations/cs.json", // Czech
"hr" : "translations/hr.json", // Croatian
"sk" : "translations/sk.json", // Slovak
"tlh" : "translations/tlh.json" // Klingon
"tlh" : "translations/tlh.json", // Klingon
"ms-my" : "translations/ms-my.json" // Malay
};
if (typeof module !== "undefined") {module.exports = translations;}

11
untrack-css.sh Executable file
View File

@ -0,0 +1,11 @@
# Long history here
# https://github.com/MichMich/MagicMirror/pull/1540
STATUS_CUSTOM_CSS=$(git ls-files -v css/custom.css|cut -f 1 --delimiter=" ")
if [ "$STATUS_CUSTOM_CSS" = "H" ]; then
echo "We'll remove from the repository the css/custom.css"
echo "This script apply git update-index --skip-worktree css/custom.css"
git update-index --skip-worktree css/custom.css
git rm --cached css/custom.css
fi