From 346016b5c43a1f935139c5ed3d7e35e2215de1d9 Mon Sep 17 00:00:00 2001 From: vjrj Date: Fri, 9 Feb 2018 11:02:21 +0100 Subject: [PATCH 001/325] Added sitemap --- .meteor/packages | 1 + .meteor/versions | 2 + cucumber/features/general.feature | 14 +++++++ cucumber/features/pages.feature | 1 - .../features/steps_definitions/general.js | 20 ++++++++++ imports/startup/server/index.js | 1 + imports/startup/server/sitemaps.js | 40 +++++++++++++++++++ 7 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 cucumber/features/general.feature create mode 100644 cucumber/features/steps_definitions/general.js create mode 100644 imports/startup/server/sitemaps.js diff --git a/.meteor/packages b/.meteor/packages index 4b3f213..de1e606 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -61,3 +61,4 @@ reywood:publish-composite barbatus:stars-rating arkham:comments-ui facts +gadicohen:sitemaps diff --git a/.meteor/versions b/.meteor/versions index ce2ba16..e9ae166 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -50,6 +50,8 @@ flowkey:raven@1.0.0 fortawesome:fontawesome@4.7.0 fourseven:scss@4.5.4 gadicc:blaze-react-component@1.4.0 +gadicohen:robots-txt@0.0.10 +gadicohen:sitemaps@0.0.26 geojson-utils@1.0.10 github-oauth@1.2.0 google-oauth@1.2.4 diff --git a/cucumber/features/general.feature b/cucumber/features/general.feature new file mode 100644 index 0000000..c3ea6a8 --- /dev/null +++ b/cucumber/features/general.feature @@ -0,0 +1,14 @@ +Feature: This app should generate a correct sitemap, etc + + @watch + Scenario: I verify that a sitemap is generated correctly + Given the page sitemap.xml + Then I check that exist this list of pages in the sitemap + | license | License | + | terms | Terms of Service | + | credits | Credits | + | privacy | Privacy Policy | + | fires | Active Fires | + | login | Login | + | signup | Signup | + # And should be spiderables diff --git a/cucumber/features/pages.feature b/cucumber/features/pages.feature index 1946218..1d6ff70 100644 --- a/cucumber/features/pages.feature +++ b/cucumber/features/pages.feature @@ -1,4 +1,3 @@ -@watch Feature: Test all secundary pages Scenario: Check that all secondary pages work well diff --git a/cucumber/features/steps_definitions/general.js b/cucumber/features/steps_definitions/general.js new file mode 100644 index 0000000..33bb272 --- /dev/null +++ b/cucumber/features/steps_definitions/general.js @@ -0,0 +1,20 @@ +/* global module expect require process client */ + +module.exports = function doSteps() { + let pages; + + this.Then(/^I check that exist this list of pages in the sitemap$/, (table, callback) => { + // Write code here that turns the phrase above into concrete actions + pages = table.raw(); + for (let i = 0; i < pages.length; i += 1) { + // TODO download sitemap and parse + // client.waitForText('.text', pages[i][0]); + } + callback(); + }); + + this.Given(/^the page sitemap\.xml$/, (callback) => { + client.url(`${process.env.ROOT_URL}/sitemap.xml`); + callback(); + }); +}; diff --git a/imports/startup/server/index.js b/imports/startup/server/index.js index 8a27f96..aa32e9d 100644 --- a/imports/startup/server/index.js +++ b/imports/startup/server/index.js @@ -8,3 +8,4 @@ import './migrations'; import './notificationsObserver'; import './facts'; import '../common/comments'; +import './sitemaps'; diff --git a/imports/startup/server/sitemaps.js b/imports/startup/server/sitemaps.js new file mode 100644 index 0000000..29a62df --- /dev/null +++ b/imports/startup/server/sitemaps.js @@ -0,0 +1,40 @@ +/* global sitemaps Comments */ +/* eslint-disable import/no-absolute-path */ + +import Fires from '/imports/api/Fires/Fires'; +// import Comments from '/imports/api/Comments/Comments'; + +sitemaps.add('/sitemap.xml', () => { + const today = new Date(); + + const out = []; + out.push({ page: '/fires', lastmod: today }); + out.push({ page: '/login', lastmod: today }); + out.push({ page: '/signup', lastmod: today }); + out.push({ page: '/recover-password', lastmod: today }); + out.push({ page: '/credits', lastmod: today }); + out.push({ page: '/terms', lastmod: today }); + out.push({ page: '/license', lastmod: today }); + out.push({ page: '/privacy', lastmod: today }); + + + // When user has public page + /* const users = Meteor.users.find().fetch(); + _.each(users, function(user) { + out.push({ + page: '/persona/' + user.username, + lastmod: user.updatedAt + }); + }); */ + + Fires.find().fetch().forEach((fire) => { + // Search the last comment of tha fire + const lastComment = Comments.getCollection().findOne({ referenceId: `fire-${fire._id}` }, { sort: { createdAt: -1 } }); + out.push({ + page: `/fire/archive/${fire._id._str}`, + lastmod: lastComment ? lastComment.createdAt : fire.updatedAt + }); + }); + + return out; +}); From 97eb8c91f57e766f43d4ef1bf532c33f27b4a0b1 Mon Sep 17 00:00:00 2001 From: vjrj Date: Fri, 9 Feb 2018 11:21:14 +0100 Subject: [PATCH 002/325] Upgrade leaflet --- package-lock.json | 45 ++++++++++++++++++++++++++++++++++----------- package.json | 4 ++-- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index eb4a96a..002d5c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7409,9 +7409,9 @@ } }, "leaflet": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.2.0.tgz", - "integrity": "sha512-Bold8phAE6WcRsuwhofrQ7cOK1REFHaYIkKuj7+TBYK3ONKRpGGIb5oXR5akYotFnrWN0TWKh6Svlhflm3dogg==" + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.3.1.tgz", + "integrity": "sha512-adQOIzh+bfdridLM1xIgJ9VnJbAUY3wqs/ueF+ITla+PLQ1z47USdBKUf+iD9FuUA8RtlT6j6hZBfZoA6mW+XQ==" }, "leaflet-geodesy": { "version": "0.2.1", @@ -7529,9 +7529,9 @@ "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" }, "lodash-es": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.4.tgz", - "integrity": "sha1-3MHXVS4VCgZABzupyzHXDwMpUOc=" + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.5.tgz", + "integrity": "sha512-Ez3ONp3TK9gX1HYKp6IhetcVybD+2F+Yp6GS9dfH8ue6EOCEzQtQEh4K0FYWBP9qLv+lzeQAYXw+3ySfxyZqkw==" }, "lodash._getnative": { "version": "3.9.1", @@ -10003,13 +10003,36 @@ } }, "react-leaflet": { - "version": "1.7.8", - "resolved": "https://registry.npmjs.org/react-leaflet/-/react-leaflet-1.7.8.tgz", - "integrity": "sha512-SEN/QJw8QxOVcxax0D0lqYEYO9IWwn78+laatA+IGaY6H42yD5IxlMcQh9HZGV4NQqs0NPnbc6FW2bHZZIldJA==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/react-leaflet/-/react-leaflet-1.8.0.tgz", + "integrity": "sha512-/2mm/ZQodvcknMJpHm0UMbsQIeQVe9TNA62TUYzTWEX6yAqfLxjQmKIio0xKWSoMIRuQ0R1lROvVZFgiHT7KNw==", "requires": { "lodash": "4.17.4", - "lodash-es": "4.17.4", - "warning": "https://registry.npmjs.org/warning/-/warning-3.0.0.tgz" + "lodash-es": "4.17.5", + "warning": "3.0.0" + }, + "dependencies": { + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" + }, + "loose-envify": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", + "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", + "requires": { + "js-tokens": "3.0.2" + } + }, + "warning": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/warning/-/warning-3.0.0.tgz", + "integrity": "sha1-MuU3fLVy3kqwR1O9+IIcAe1gW3w=", + "requires": { + "loose-envify": "1.3.1" + } + } } }, "react-leaflet-control": { diff --git a/package.json b/package.json index e517587..945775d 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "jquery": "^2.2.4", "jquery-validation": "^1.17.0", "juice": "^4.2.2", - "leaflet": "^1.2.0", + "leaflet": "^1.3.1", "leaflet-geodesy": "^0.2.1", "leaflet-graphicscale": "0.0.2", "leaflet-sleep": "^0.5.1", @@ -58,7 +58,7 @@ "react-dom": "^16.0.0", "react-helmet": "^5.2.0", "react-i18next": "^7.1.1", - "react-leaflet": "^1.7.7", + "react-leaflet": "^1.8.0", "react-leaflet-control": "^1.4.0", "react-leaflet-google": "^3.2.1", "react-leaflet-sidebarv2": "^0.5.1", From 6a9f3e4df66e22eec6d700c2b0eb9d14ecb39ba6 Mon Sep 17 00:00:00 2001 From: vjrj Date: Sun, 11 Feb 2018 19:22:34 +0100 Subject: [PATCH 003/325] English typo --- client/main.html | 4 ++-- public/locales/en/common.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/main.html b/client/main.html index bf46507..90fe4b1 100644 --- a/client/main.html +++ b/client/main.html @@ -1,7 +1,7 @@ - All agaist Fire | Tod@s contra el Fuego - + All against Fire | Tod@s contra el Fuego + diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 00a2224..6b383de 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -1,7 +1,7 @@ { "AppName": "All Against Fire", "AppNameFull": "All Against Fire!", - "AppDescrip": "Corwdsourcing against wildfires", + "AppDescrip": "Crowdsourcing against wildfires", "AppDescripLong": "We use different sources of data to notify you of active fires in your areas of interest", "OrgName": "Comunes", "OrgNameFull": "Comunes Association", From e46ae3a000b5b9a98045bd5f3e9506104289dc7d Mon Sep 17 00:00:00 2001 From: vjrj Date: Mon, 12 Feb 2018 09:49:13 +0100 Subject: [PATCH 004/325] Added zones nav link --- imports/ui/components/Navigation/Navigation.js | 6 +++++- imports/ui/layouts/App/App.js | 2 ++ imports/ui/pages/Subscriptions/SubscriptionsMap.js | 8 ++++++++ public/locales/es/common.json | 4 +++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/imports/ui/components/Navigation/Navigation.js b/imports/ui/components/Navigation/Navigation.js index 4207ee1..f252702 100644 --- a/imports/ui/components/Navigation/Navigation.js +++ b/imports/ui/components/Navigation/Navigation.js @@ -15,8 +15,9 @@ import NavItem from '../NavItem/NavItem'; import './Navigation.scss'; // removed class: fixed-top +// md instead of lg: no menu in medium const Navigation = props => ( -