Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into feature/45_edit_…
Browse files Browse the repository at this point in the history
…tags

Conflicts:
	app/developer/developer.controller.js
	app/events/eventsHeatmap.controller.js
	app/events/eventsHeatmap.html
	app/scripts/controllers/main.js
	app/scripts/hub.config.js
	bower.json
	package.json
	test/spec/controllers/main.js
  • Loading branch information
Splaktar committed Mar 11, 2017
2 parents 78c0f64 + 6489800 commit 461935c
Show file tree
Hide file tree
Showing 23 changed files with 121 additions and 181 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
language: node_js
node_js:
- '0.12'
- '4'
- '5'
- '6'
before_script:
- npm install -g bower grunt-cli
- bower install
Expand Down
7 changes: 6 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ module.exports = function (grunt) {
app: {
html: '<%= yeoman.app %>/views/index.html',
ignorePath: '<%= yeoman.app %>/',
exclude: ['bower_components/moment-timezone/index.js']
exclude: [
'bower_components/moment-timezone/index.js',
/markerclustererplus/,
/google-maps-utility-library-v3/,
/js-rich-marker/
]
}
},

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ See the [wiki](https://github.com/gdg-x/hub/wiki/Ingesting-data-into-the-Hub).
###Contributors
See [list of contributors](https://github.com/gdg-x/hub/graphs/contributors)

Maintainer: [@splaktar](https://github.com/splaktar).
Maintainer:

######GDG Apps, GDG[x] are not endorsed and/or supported by Google, the corporation.

Expand Down
13 changes: 8 additions & 5 deletions app/developer/developer.controller.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
'use strict';

angular.module('gdgxHubApp')
.controller('DeveloperCtrl', function ($scope, $http) {
$http.get('/api/v1/rest').success(function (data) {
$scope.restDiscovery = data;
});
angular.module('gdgxHubApp').controller('DeveloperCtrl', DeveloperCtrl);

ApiCtrl.$inject = ['$scope', '$http'];

function DeveloperCtrl($scope, $http) {
$http.get('/api/v1/rest').success(function(data) {
$scope.restDiscovery = data;
});
}
59 changes: 0 additions & 59 deletions app/events/eventsHeatmap.controller.js

This file was deleted.

17 changes: 0 additions & 17 deletions app/events/eventsHeatmap.html

This file was deleted.

5 changes: 3 additions & 2 deletions app/scripts/controllers/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';

angular.module('gdgxHubApp')
.controller('MainCtrl', function () {});
angular.module('gdgxHubApp').controller('MainController', MainController);

function MainController() {}
10 changes: 3 additions & 7 deletions app/scripts/hub.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ angular.module('gdgxHubApp')
.config(function ($routeProvider, $locationProvider, uiGmapGoogleMapApiProvider, GOOGLE_API_KEY) {
uiGmapGoogleMapApiProvider.configure({
key: GOOGLE_API_KEY,
v: '3.20',
v: '3.24',
libraries: 'weather,geometry,visualization'
});

$routeProvider
.when('/', {
templateUrl: 'partials/main.html',
controller: 'MainCtrl'
templateUrl: 'partials/main',
controller: 'MainController'
})
.when('/dashboard', {
templateUrl: 'dashboard/dashboard.html',
Expand Down Expand Up @@ -50,10 +50,6 @@ angular.module('gdgxHubApp')
.when('/events/devfest', {
templateUrl: 'partials/devfest.html'
})
.when('/events/heatmap/:year/:month', {
templateUrl: 'events/eventsHeatmap.html',
controller: 'EventsHeatmapCtrl'
})
.when('/events/tags', {
templateUrl: 'events/events.html',
controller: 'EventsCtrl'
Expand Down
6 changes: 1 addition & 5 deletions app/views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-42015512-2', 'gdgx.io');
ga('send', 'pageview');
</script>
Expand All @@ -55,8 +54,6 @@
<script src="bower_components/json3/lib/json3.min.js"></script>
<![endif]-->

<script src='//maps.googleapis.com/maps/api/js'></script>

<!-- build:js(app) scripts/vendor.js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<!-- bower:js -->
Expand All @@ -67,6 +64,7 @@
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/angular-directive.g-signin/google-plus-signin.js"></script>
<script src="bower_components/angular-simple-logger/dist/angular-simple-logger.js"></script>
<script src="bower_components/lodash/lodash.js"></script>
<script src="bower_components/angular-google-maps/dist/angular-google-maps.js"></script>
<script src="bower_components/fullcalendar/dist/fullcalendar.js"></script>
Expand All @@ -76,8 +74,6 @@
<!-- endbower -->
<script src="bower_components/angular-google-chart/ng-google-chart.js"></script>
<script src="bower_components/moment-timezone/moment-timezone.js"></script>
<script src="bower_components/heatmap.js/src/heatmap.js"></script>
<script src="bower_components/heatmap.js/src/heatmap-gmaps.js"></script>
<!-- endbuild -->

<!-- build:js({.tmp,app}) scripts/scripts.js -->
Expand Down
23 changes: 11 additions & 12 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
{
"name": "gdgx-hub",
"version": "0.1.0",
"version": "0.2.0",
"dependencies": {
"angular": "1.4.7",
"angular": "1.5.8",
"json3": "3.2.6",
"es5-shim": "2.1.0",
"jquery": "2.1.0",
"moment": "2.6.0",
"heatmap.js": "0.0.1",
"moment-timezone": "0.0.6",
"angular-resource": "1.4.7",
"angular-cookies": "1.4.7",
"angular-sanitize": "1.4.7",
"angular-route": "1.4.7",
"angular-directive.g-signin": "87aac779fb2b5ef4aa5a61843c963a33cc78f846",
"angular-google-maps": "2.1.5",
"angular-resource": "1.5.8",
"angular-cookies": "1.5.8",
"angular-sanitize": "1.5.8",
"angular-route": "1.5.8",
"angular-directive.g-signin": "0.1.1",
"angular-google-maps": "2.3.4",
"angular-google-chart": "0.0.11",
"angular-ui-calendar": "1.0.1",
"angular-bootstrap": "0.8.0",
"angular-cache": "4.3.2"
},
"devDependencies": {
"angular-mocks": "1.4.7",
"angular-scenario": "1.4.7"
"angular-mocks": "1.5.8",
"angular-scenario": "1.5.8"
},
"resolutions": {
"jquery": "2.1.0",
"angular": "1.4.7"
"angular": "1.5.8"
}
}
3 changes: 2 additions & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ module.exports = function(config) {
'app/bower_components/angular-sanitize/angular-sanitize.js',
'app/bower_components/angular-route/angular-route.js',
'app/bower_components/angular-directive.g-signin/google-plus-signin.js',
'app/bower_components/underscore/underscore.js',
'app/bower_components/lodash/dist/lodash.js',
'app/bower_components/angular-simple-logger/dist/angular-simple-logger.js',
'app/bower_components/angular-google-maps/dist/angular-google-maps.js',
'app/bower_components/angular-bootstrap/ui-bootstrap-tpls.js',
'app/bower_components/moment/moment.js',
Expand Down
11 changes: 7 additions & 4 deletions lib/clients/devsite.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,19 +166,22 @@ module.exports = {
});
},
fetchTaggedEvents: function(tag, month, year, callback) {
var requestUrl;

if (!callback) {
return;
}

month = month || moment().month();
year = year || moment().year();

var end = moment().year(year).month(month).add(1, 'months').date(10).seconds(0).minutes(0).hours(0).unix();
var start = moment().year(year).month(month).date(1).subtract(10, 'days').seconds(0).minutes(0).hours(0).unix();
var start = moment().year(year).month(month).date(1).subtract(1, 'months').seconds(0).minutes(0).hours(0).unix();
var end = moment().year(year).month(month).add(6, 'months').seconds(0).minutes(0).hours(0).unix();

var now = moment().unix();
request.get('https://google-developers.appspot.com/events/event-markers.public?tag=' + tag +
'&start=' + start + '&end=' + end + '&_=' + now).retry(5).end(function(err, res) {
requestUrl = 'https://google-developers.appspot.com/events/event-markers.public?tag=' + tag +
'&start=' + start + '&end=' + end + '&_=' + now;
request.get(requestUrl).retry(5).end(function(err, res) {
if (err) {
return callback(err, null);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/cron/daily_metrics.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

var cronJob = require('cron').CronJob,
risky = require('../risky');
var CronJob = require('cron').CronJob,
risky = require('../risky');

module.exports = new cronJob('0 8 * * *', function(){
module.exports = new CronJob('0 8 * * *', function(){
risky.sendTask('daily_metrics');
});
6 changes: 3 additions & 3 deletions lib/cron/fetch_chapters.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
var cronJob = require('cron').CronJob,
risky = require('../risky');
var CronJob = require('cron').CronJob,
risky = require('../risky');

module.exports = new cronJob('0 */5 * * *', function(){
module.exports = new CronJob('0 */5 * * *', function(){
risky.sendTask('fetch_chapters');
});
17 changes: 9 additions & 8 deletions lib/cron/fetch_events.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'use strict';
var cronJob = require('cron').CronJob,
moment = require('moment'),
risky = require('../risky');
var CronJob = require('cron').CronJob,
moment = require('moment'),
risky = require('../risky');

module.exports = new cronJob('0 */5 * * *', function(){
risky.sendTask('fetch_events', { month: moment().month() });
risky.sendTask('fetch_events', { month: moment().add(1, 'months').month() });
risky.sendTask('fetch_events', { month: moment().add(2, 'months').month() });
});
module.exports = new CronJob('0 */5 * * *', function() {
// Ask to fetch events for the current month and year.
// The fetch_events task will actually try to fetch events starting at month - 1 and ending with month + 6.
// See ../tasks/fetch_events.js for more details.
risky.sendTask('fetch_events', { month: moment().month(), year: moment().year() });
});
4 changes: 2 additions & 2 deletions lib/cron/fetch_gdes.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
var cronJob = require('cron').CronJob,
var CronJob = require('cron').CronJob,
risky = require('../risky');

module.exports = new cronJob('0 3 * * *', function(){
module.exports = new CronJob('0 3 * * *', function(){
risky.sendTask('fetch_gdes');
});
4 changes: 2 additions & 2 deletions lib/cron/fetch_plus_posts.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
var cronJob = require('cron').CronJob,
var CronJob = require('cron').CronJob,
risky = require('../risky');

module.exports = new cronJob('0 */5 * * *', function(){
module.exports = new CronJob('0 */5 * * *', function(){
risky.sendTask('fetch_plus_posts');
});
4 changes: 2 additions & 2 deletions lib/cron/monthly_metrics.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

var cronJob = require('cron').CronJob,
var CronJob = require('cron').CronJob,
risky = require('../risky');

module.exports = new cronJob('0 0 1 * *', function(){
module.exports = new CronJob('0 0 1 * *', function(){
risky.sendTask('monthly_metrics');
});
2 changes: 1 addition & 1 deletion lib/tasks/fetch_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = function (id, params, cb) {

var firstDayOfMonth = moment().year(year).month(month).date(1).subtract(1, 'months')
.seconds(0).minutes(0).hours(0).unix();
var lastDayOfMonth = moment().year(year).month(month).add(3, 'months').seconds(0).minutes(0).hours(0).unix();
var lastDayOfMonth = moment().year(year).month(month).add(6, 'months').seconds(0).minutes(0).hours(0).unix();

console.log('[task ' + id + '] fetching events: start: "' + moment.unix(firstDayOfMonth).format('MMM DD YYYY') +
'", end: "' + moment.unix(lastDayOfMonth).format('MMM DD YYYY') + '"...');
Expand Down
4 changes: 2 additions & 2 deletions lib/tasks/fetch_plus_posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ module.exports = function (id, params, cb) {
}

var upsert = postRecord.toObject();
PlusPost.update({_id: post.id}, upsert, {upsert: true}, function (err) {
PlusPost.update({_id: post.id}, upsert, {upsert: true}, function (err) { // jshint ignore:line
if (err) {
console.log(err);
}
}); // jshint ignore:line
});
}
}
}
Expand Down
Loading

0 comments on commit 461935c

Please sign in to comment.