Compare commits
9 commits
2.11.1
...
tcef-maste
| Author | SHA1 | Date | |
|---|---|---|---|
| 39415808bf | |||
| 9d92ec4f88 | |||
| 2a31435135 | |||
| 8281fa3427 | |||
|
|
ee7af168d6 | ||
|
|
4cbbe65fa3 | ||
|
|
b9457fe141 | ||
|
|
c4cb52abaf | ||
|
|
423dbc5ed9 |
16 changed files with 529 additions and 620 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -12,3 +12,8 @@ public/locales/undefined/
|
||||||
.screenshots
|
.screenshots
|
||||||
.vscode
|
.vscode
|
||||||
output.json
|
output.json
|
||||||
|
|
||||||
|
# fase-0 higiene: variantes de settings con secretos (no versionar)
|
||||||
|
settings-production-*.json
|
||||||
|
settings-tests.json
|
||||||
|
*.json~
|
||||||
|
|
|
||||||
|
|
@ -33,11 +33,11 @@ TEST_PORT=3000 TEST_WATCH=1 TEST_CLIENT=0 MONGO_URL=mongodb://localhost:27017/fu
|
||||||
|
|
||||||
# and
|
# and
|
||||||
|
|
||||||
chimp --watch --ddp=http://localhost:3000 --path=cucumber
|
node_modules/.bin/chimp --watch --ddp=http://localhost:3000 --path=cucumber
|
||||||
|
|
||||||
# and
|
# and
|
||||||
|
|
||||||
chimp --ddp=http://localhost:3000 --path=cucumber
|
node_modules/.bin/chimp --ddp=http://localhost:3000 --path=cucumber
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
29
cucumber/chimp-config.js
Normal file
29
cucumber/chimp-config.js
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
module.exports = {
|
||||||
|
// - - - - CHIMP - - - -
|
||||||
|
/* watch: false,
|
||||||
|
* watchTags: '@watch',
|
||||||
|
* offline: false,
|
||||||
|
*/
|
||||||
|
// - - - - CUCUMBER - - - -
|
||||||
|
/* path: './features',
|
||||||
|
* jsonOutput: 'output.json', */
|
||||||
|
|
||||||
|
// '- - - - DEBUGGING - - - -
|
||||||
|
log: 'info',
|
||||||
|
debug: false,
|
||||||
|
seleniumDebug: false,
|
||||||
|
webdriverLogLevel: false,
|
||||||
|
// debugBrkCucumber: 5858,
|
||||||
|
// - - - - WEBDRIVER-IO - - - -
|
||||||
|
webdriverio: {
|
||||||
|
waitforTimeout: 10000,
|
||||||
|
waitforInterval: 250, // KEEP SMALL (!!!) this is the INTERVAL in which waitFor* is looped fo
|
||||||
|
desiredCapabilities: {
|
||||||
|
chromeOptions: {
|
||||||
|
// args: ["headless", "disable-gpu"]
|
||||||
|
args: ['--disable-gpu', '--no-sandbox', '--headless']
|
||||||
|
},
|
||||||
|
isHeadless: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -67,12 +67,14 @@ Meteor.publish('activefiresunionmyloc', function activeInMyLoc(northEastLng, nor
|
||||||
check(northEastLat, NumberBetween(-90, 90));
|
check(northEastLat, NumberBetween(-90, 90));
|
||||||
check(withMarks, Boolean);
|
check(withMarks, Boolean);
|
||||||
|
|
||||||
if (!Meteor.isDevelopment) return this.ready(); // empty
|
// I use this for fire stats
|
||||||
|
// if (!Meteor.isDevelopment) return this.ready(); // empty
|
||||||
return activeFiresUnion(northEastLng, northEastLat, southWestLng, southWestLat, withMarks);
|
return activeFiresUnion(northEastLng, northEastLat, southWestLng, southWestLat, withMarks);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Warning: this increase always by one the fire stats
|
// Warning: this increase always by one the fire stats
|
||||||
Meteor.publish('lastFireUnionDetected', function lastFireDetected() {
|
Meteor.publish('lastFireUnionDetected', function lastFireDetected() {
|
||||||
if (!Meteor.isDevelopment) return this.ready(); // empty
|
// I use this for fire stats
|
||||||
|
// if (!Meteor.isDevelopment) return this.ready(); // empty
|
||||||
return ActiveFiresUnion.find({}, { limit: 1, sort: { when: -1 } });
|
return ActiveFiresUnion.find({}, { limit: 1, sort: { when: -1 } });
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@
|
||||||
import { Meteor } from 'meteor/meteor';
|
import { Meteor } from 'meteor/meteor';
|
||||||
import { check } from 'meteor/check';
|
import { check } from 'meteor/check';
|
||||||
import { NumberBetween } from '/imports/modules/server/other-checks';
|
import { NumberBetween } from '/imports/modules/server/other-checks';
|
||||||
import L from 'leaflet-headless';
|
import '/imports/startup/server/leaflet-workaround.js';
|
||||||
|
import L from 'leaflet';
|
||||||
import calcUnion from '/imports/ui/components/Maps/SubsUnion/Unify';
|
import calcUnion from '/imports/ui/components/Maps/SubsUnion/Unify';
|
||||||
import Industries from '/imports/api/Industries/Industries';
|
import Industries from '/imports/api/Industries/Industries';
|
||||||
import FalsePositives from '../FalsePositives';
|
import FalsePositives from '../FalsePositives';
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,18 @@ function imgUrl(lat, lng) {
|
||||||
return `<img src="${imgUrl(lat, lng)}" width="640" height="480"/>`;
|
return `<img src="${imgUrl(lat, lng)}" width="640" height="480"/>`;
|
||||||
} */
|
} */
|
||||||
|
|
||||||
|
// Cutover flag (fase 1a): channels listed in
|
||||||
|
// Meteor.settings.private.notifDisabledChannels (e.g. ['mobile','web']) are
|
||||||
|
// handled by the tcef-notifications microservice, so the old observer/cron must
|
||||||
|
// NOT send them. Mutual exclusion per channel — reversible by editing settings,
|
||||||
|
// no code deploy needed. ES5-compatible on purpose (Meteor 1.6 / Node 8).
|
||||||
|
const notifDisabledChannels = (Meteor.settings.private && Meteor.settings.private.notifDisabledChannels) || [];
|
||||||
|
|
||||||
const processNotif = (notif) => {
|
const processNotif = (notif) => {
|
||||||
|
if (notifDisabledChannels.indexOf(notif.type) !== -1) {
|
||||||
|
// This channel was migrated to tcef-notifications; do nothing here.
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (isMailServerMaster && validFcmSender && notif.type === 'mobile' && notif.notified !== true) {
|
if (isMailServerMaster && validFcmSender && notif.type === 'mobile' && notif.notified !== true) {
|
||||||
const fcmSender = new gcm.Sender(Meteor.settings.private.fcmApiToken);
|
const fcmSender = new gcm.Sender(Meteor.settings.private.fcmApiToken);
|
||||||
const user = Meteor.users.findOne({ _id: notif.userId });
|
const user = Meteor.users.findOne({ _id: notif.userId });
|
||||||
|
|
|
||||||
|
|
@ -17,5 +17,4 @@ import './prerender';
|
||||||
import './feedback';
|
import './feedback';
|
||||||
import './cron';
|
import './cron';
|
||||||
import './isMaster';
|
import './isMaster';
|
||||||
import './segfaults';
|
|
||||||
import './rest';
|
import './rest';
|
||||||
|
|
|
||||||
19
imports/startup/server/leaflet-workaround.js
Normal file
19
imports/startup/server/leaflet-workaround.js
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
// imports/startup/server/leaflet-workaround.js
|
||||||
|
global.window = {
|
||||||
|
screen: {
|
||||||
|
deviceXDPI: 1,
|
||||||
|
logicalXDPI: 1
|
||||||
|
}
|
||||||
|
};
|
||||||
|
global.document = {
|
||||||
|
documentElement: {
|
||||||
|
style: {}
|
||||||
|
},
|
||||||
|
createElement: () => {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
global.navigator = {
|
||||||
|
userAgent: 'foo',
|
||||||
|
platform: 'bar'
|
||||||
|
};
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
import SegfaultHandler from 'segfault-handler';
|
|
||||||
import moment from 'moment';
|
|
||||||
// import ravenLogger from './ravenLogger';
|
|
||||||
|
|
||||||
// https://github.com/ddopson/node-segfault-handler
|
|
||||||
|
|
||||||
const dateFileFormat = moment().format('YYYYMMDD_HH:mm:ss');
|
|
||||||
|
|
||||||
SegfaultHandler.registerHandler(`/var/tmp/tcef-stacktrace-${dateFileFormat}.log`);
|
|
||||||
|
|
||||||
|
|
||||||
// This callaback does not work:
|
|
||||||
// https://github.com/ddopson/node-segfault-handler/issues/49
|
|
||||||
|
|
||||||
/* SegfaultHandler.registerHandler('/var/tmp/tcef-crash.log', (signal, address, stack) => {
|
|
||||||
* // Do what you want with the signal, address, or stack (array)
|
|
||||||
* // This callback will execute before the signal is forwarded on.
|
|
||||||
* ravenLogger.log(stack, signal);
|
|
||||||
* }); */
|
|
||||||
|
|
||||||
// Only uncomment for segv tests
|
|
||||||
// SegfaultHandler.causeSegfault();
|
|
||||||
|
|
||||||
// Or this for normal error (should go to raven in configured)
|
|
||||||
// throw new Error('This is just a test of error in server');
|
|
||||||
|
|
@ -4,7 +4,8 @@ import { Meteor } from 'meteor/meteor';
|
||||||
import Subscriptions from '/imports/api/Subscriptions/Subscriptions';
|
import Subscriptions from '/imports/api/Subscriptions/Subscriptions';
|
||||||
import SiteSettings from '/imports/api/SiteSettings/SiteSettings';
|
import SiteSettings from '/imports/api/SiteSettings/SiteSettings';
|
||||||
import Perlin from 'loms.perlin';
|
import Perlin from 'loms.perlin';
|
||||||
import L from 'leaflet-headless';
|
import './leaflet-workaround';
|
||||||
|
import L from 'leaflet';
|
||||||
import calcUnion from '/imports/ui/components/Maps/SubsUnion/Unify';
|
import calcUnion from '/imports/ui/components/Maps/SubsUnion/Unify';
|
||||||
import { isMailServerMaster } from '/imports/startup/server/email';
|
import { isMailServerMaster } from '/imports/startup/server/email';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,8 @@ class DefMapLayers extends Component {
|
||||||
<TileLayer
|
<TileLayer
|
||||||
opacity={defOpacity}
|
opacity={defOpacity}
|
||||||
attribution="© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors"
|
attribution="© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors"
|
||||||
url="https://tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png"
|
// url="https://tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png"
|
||||||
|
url="https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"
|
||||||
/>
|
/>
|
||||||
</BaseLayer>);
|
</BaseLayer>);
|
||||||
const osmlayer = (
|
const osmlayer = (
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ class FireCircleMark extends Component {
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const rect = rectangleAround({ lat, lon }, track, track);
|
const rect = rectangleAround({ lat, lon }, track, track);
|
||||||
return (
|
return (
|
||||||
<GeoJSON data={rect} color="red" stroke width="1" opacity=".4" fillOpacity=".3">
|
<GeoJSON data={rect} color="red" stroke width="1" opacity=".4" fillOpacity="1">
|
||||||
<FirePopup t={t} history={history} id={id} nasa={nasa} lat={lat} lon={lon} when={when} />
|
<FirePopup t={t} history={history} id={id} nasa={nasa} lat={lat} lon={lon} when={when} />
|
||||||
</GeoJSON>
|
</GeoJSON>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -84,19 +84,6 @@ class FiresMap extends React.Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* shouldComponentUpdate(nextProps, nextState) {
|
|
||||||
* const notMoving = !nextState.moving;
|
|
||||||
* const markersChanged = this.state.useMarkers !== nextState.useMarkers;
|
|
||||||
* const unionChanged = this.state.showSubsUnion !== nextState.showSubsUnion;
|
|
||||||
* const otherViewport = this.state.viewport !== nextState.viewport;
|
|
||||||
* // const init = nextState.viewport.center === [0, 0];
|
|
||||||
* // console.log(notMoving ? 'Not moving map' : 'Moving map');
|
|
||||||
* // console.log(otherViewport ? 'Other viewport' : 'Not other viewport');
|
|
||||||
* console.log(`${otherViewport ? 'OTHER' : 'Not other'} viewport ${nextState.viewport.center} zoom: ${nextState.viewport.zoom}`);
|
|
||||||
* return this.state.init || (notMoving && otherViewport && this.state.moved) || unionChanged || markersChanged;
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
|
|
||||||
shouldComponentUpdate(nextProps, nextState) {
|
shouldComponentUpdate(nextProps, nextState) {
|
||||||
const notMoving = !nextState.moving;
|
const notMoving = !nextState.moving;
|
||||||
return notMoving;
|
return notMoving;
|
||||||
|
|
@ -249,7 +236,7 @@ class FiresMap extends React.Component {
|
||||||
<p className="firesmap-legend">
|
<p className="firesmap-legend">
|
||||||
{ (this.props.activefires.length + this.props.firealerts.length) === 0 ?
|
{ (this.props.activefires.length + this.props.firealerts.length) === 0 ?
|
||||||
<Fragment><Trans parent="span" i18nKey="noActiveFireInMapCount">No hay fuegos activos en esta zona del mapa. <strong>{{ countTotal: this.props.activefirestotal }}</strong> fuegos activos en el mundo.</Trans> <FireStats loadingAll={loading} {... this.props} /></Fragment> :
|
<Fragment><Trans parent="span" i18nKey="noActiveFireInMapCount">No hay fuegos activos en esta zona del mapa. <strong>{{ countTotal: this.props.activefirestotal }}</strong> fuegos activos en el mundo.</Trans> <FireStats loadingAll={loading} {... this.props} /></Fragment> :
|
||||||
<Fragment><Trans parent="span" i18nKey="activeFireInMapCount">En rojo, <strong>{{ count: this.props.activefires.length + this.props.firealerts.length }}</strong> fuegos activos. <strong>{{ countTotal: this.props.activefirestotal }}</strong> fuegos activos en el mundo.</Trans> <FireStats loadingAll={loading} {... this.props} /></Fragment>
|
<Fragment><Trans parent="span" i18nKey="activeFireInMapCount">En rojo, <strong>{{ count: this.props.activefiresunion.length + this.props.firealerts.length }}</strong> fuegos activos. <strong>{{ countTotal: this.props.activefirestotal }}</strong> fuegos activos en el mundo.</Trans> <FireStats loadingAll={loading} {... this.props} /></Fragment>
|
||||||
}
|
}
|
||||||
</p>
|
</p>
|
||||||
{isNotHomeAndMobile() && this.props.firealerts.length > 0 &&
|
{isNotHomeAndMobile() && this.props.firealerts.length > 0 &&
|
||||||
|
|
|
||||||
1017
package-lock.json
generated
1017
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -2,7 +2,7 @@
|
||||||
"name": "tcef",
|
"name": "tcef",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "QT_QPA_PLATFORM='' MONGO_URL=mongodb://localhost:27017/fuegos meteor --settings settings-development.json",
|
"start": "QT_QPA_PLATFORM='' MONGO_URL=mongodb://fuegos:fuegos@localhost:27017/fuegos meteor --settings settings-development.json",
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -39,7 +39,6 @@
|
||||||
"juice": "^4.2.2",
|
"juice": "^4.2.2",
|
||||||
"leaflet": "^1.3.1",
|
"leaflet": "^1.3.1",
|
||||||
"leaflet-graphicscale": "0.0.2",
|
"leaflet-graphicscale": "0.0.2",
|
||||||
"leaflet-headless": "^0.2.6",
|
|
||||||
"leaflet-sleep": "^0.5.1",
|
"leaflet-sleep": "^0.5.1",
|
||||||
"lodash": "^4.17.4",
|
"lodash": "^4.17.4",
|
||||||
"loms.perlin": "^1.0.1",
|
"loms.perlin": "^1.0.1",
|
||||||
|
|
@ -83,7 +82,6 @@
|
||||||
"react-router-hash-link": "^1.1.1",
|
"react-router-hash-link": "^1.1.1",
|
||||||
"react-share": "^2.0.0",
|
"react-share": "^2.0.0",
|
||||||
"reactstrap": "^5.0.0-alpha.3",
|
"reactstrap": "^5.0.0-alpha.3",
|
||||||
"segfault-handler": "^1.0.0",
|
|
||||||
"simpl-schema": "^1.5.0",
|
"simpl-schema": "^1.5.0",
|
||||||
"simple-line-icons": "^2.4.1",
|
"simple-line-icons": "^2.4.1",
|
||||||
"store": "^2.0.12",
|
"store": "^2.0.12",
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 3346b6db70c153b1dd66e6a16a0ad28f10ebf740
|
Subproject commit 4761da921f467838a2c01b34e84a7703ee49b12c
|
||||||
Loading…
Add table
Add a link
Reference in a new issue