Skip to content

Commit

Permalink
Ran npm fix
Browse files Browse the repository at this point in the history
  • Loading branch information
silvae86 committed Jul 16, 2018
1 parent 2e17895 commit 4ae94f8
Show file tree
Hide file tree
Showing 61 changed files with 927 additions and 919 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ angular.module("dendroApp.controllers")
{
var interactionType = "hide_descriptor_from_quick_list_for_project";
var uri = "/interactions/hide_descriptor_from_quick_list_for_project";
//newDescriptor.added_from_quick_list = true;
// newDescriptor.added_from_quick_list = true;
newDescriptor.rankingPosition = index;
newDescriptor.pageNumber = $scope.recommendations_page;

if(newDescriptor.recommendation_types != null)
if (newDescriptor.recommendation_types != null)
{
newDescriptor.recommendation_types.project_hidden = true;
}
Expand All @@ -242,8 +242,8 @@ angular.module("dendroApp.controllers")
newDescriptor.recommendation_types.project_hidden = true;
}

//TODO This is commented because it cannot be added to the descriptor list at this point
//$scope.add_descriptor(newDescriptor);
// TODO This is commented because it cannot be added to the descriptor list at this point
// $scope.add_descriptor(newDescriptor);

interactionsService.register_interaction(
uri,
Expand Down Expand Up @@ -272,16 +272,15 @@ angular.module("dendroApp.controllers")
);
};


$scope.unhide_descriptor_from_quick_list_for_project = function (newDescriptor, index)
{
var interactionType = "unhide_descriptor_from_quick_list_for_project";
var uri = "/interactions/unhide_descriptor_from_quick_list_for_project";
//newDescriptor.added_from_quick_list = true;
// newDescriptor.added_from_quick_list = true;
newDescriptor.rankingPosition = index;
newDescriptor.pageNumber = $scope.recommendations_page;

if(newDescriptor.recommendation_types != null)
if (newDescriptor.recommendation_types != null)
{
newDescriptor.recommendation_types.project_hidden = false;
}
Expand All @@ -291,8 +290,8 @@ angular.module("dendroApp.controllers")
newDescriptor.recommendation_types.project_hidden = false;
}

//TODO This is commented because it cannot be added to the descriptor list at this point
//$scope.add_descriptor(newDescriptor);
// TODO This is commented because it cannot be added to the descriptor list at this point
// $scope.add_descriptor(newDescriptor);

interactionsService.register_interaction(
uri,
Expand Down Expand Up @@ -325,11 +324,11 @@ angular.module("dendroApp.controllers")
{
var interactionType = "unhide_descriptor_from_quick_list_for_user";
var uri = "/interactions/unhide_descriptor_from_quick_list_for_user";
//newDescriptor.added_from_quick_list = true;
// newDescriptor.added_from_quick_list = true;
newDescriptor.rankingPosition = index;
newDescriptor.pageNumber = $scope.recommendations_page;

if(newDescriptor.recommendation_types != null)
if (newDescriptor.recommendation_types != null)
{
newDescriptor.recommendation_types.user_hidden = false;
}
Expand All @@ -339,8 +338,8 @@ angular.module("dendroApp.controllers")
newDescriptor.recommendation_types.user_hidden = false;
}

//TODO This is commented because it cannot be added to the descriptor list at this point
//$scope.add_descriptor(newDescriptor);
// TODO This is commented because it cannot be added to the descriptor list at this point
// $scope.add_descriptor(newDescriptor);

interactionsService.register_interaction(
uri,
Expand Down Expand Up @@ -373,11 +372,11 @@ angular.module("dendroApp.controllers")
{
var interactionType = "hide_descriptor_from_quick_list_for_user";
var uri = "/interactions/hide_descriptor_from_quick_list_for_user";
//newDescriptor.added_from_quick_list = true;
// newDescriptor.added_from_quick_list = true;
newDescriptor.rankingPosition = index;
newDescriptor.pageNumber = $scope.recommendations_page;

if(newDescriptor.recommendation_types != null)
if (newDescriptor.recommendation_types != null)
{
newDescriptor.recommendation_types.user_hidden = true;
}
Expand All @@ -387,8 +386,8 @@ angular.module("dendroApp.controllers")
newDescriptor.recommendation_types.user_hidden = true;
}

//TODO This is commented because it cannot be added to the descriptor list at this point
//$scope.add_descriptor(newDescriptor);
// TODO This is commented because it cannot be added to the descriptor list at this point
// $scope.add_descriptor(newDescriptor);

interactionsService.register_interaction(
uri,
Expand Down Expand Up @@ -423,11 +422,11 @@ angular.module("dendroApp.controllers")
var uri = "/interactions/favorite_descriptor_from_quick_list_for_project";

newDescriptor.just_added = true;
//newDescriptor.added_from_quick_list = true;
// newDescriptor.added_from_quick_list = true;
newDescriptor.rankingPosition = index;
newDescriptor.pageNumber = $scope.recommendations_page;

if(newDescriptor.recommendation_types != null)
if (newDescriptor.recommendation_types != null)
{
newDescriptor.recommendation_types.project_favorite = true;
}
Expand All @@ -437,8 +436,8 @@ angular.module("dendroApp.controllers")
newDescriptor.recommendation_types.project_favorite = true;
}

//TODO This is commented because it cannot be added to the descriptor list at this point
//$scope.add_descriptor(newDescriptor);
// TODO This is commented because it cannot be added to the descriptor list at this point
// $scope.add_descriptor(newDescriptor);

interactionsService.register_interaction(
uri,
Expand Down Expand Up @@ -473,10 +472,10 @@ angular.module("dendroApp.controllers")
var uri = "/interactions/favorite_descriptor_from_manual_list_for_project";

newDescriptor.just_added = true;
//newDescriptor.added_from_quick_list = true;
// newDescriptor.added_from_quick_list = true;
newDescriptor.rankingPosition = index;
newDescriptor.pageNumber = $scope.recommendations_page;
if(newDescriptor.recommendation_types != null)
if (newDescriptor.recommendation_types != null)
{
newDescriptor.recommendation_types.project_favorite = true;
}
Expand All @@ -486,8 +485,8 @@ angular.module("dendroApp.controllers")
newDescriptor.recommendation_types.project_favorite = true;
}

//TODO This is commented because it cannot be added to the descriptor list at this point
//$scope.add_descriptor(newDescriptor);
// TODO This is commented because it cannot be added to the descriptor list at this point
// $scope.add_descriptor(newDescriptor);

interactionsService.register_interaction(
uri,
Expand Down Expand Up @@ -522,10 +521,10 @@ angular.module("dendroApp.controllers")
var uri = "/interactions/favorite_descriptor_from_manual_list_for_user";

newDescriptor.just_added = true;
//newDescriptor.added_from_quick_list = true;
// newDescriptor.added_from_quick_list = true;
newDescriptor.rankingPosition = index;
newDescriptor.pageNumber = $scope.recommendations_page;
if(newDescriptor.recommendation_types != null)
if (newDescriptor.recommendation_types != null)
{
newDescriptor.recommendation_types.user_favorite = true;
}
Expand All @@ -535,8 +534,8 @@ angular.module("dendroApp.controllers")
newDescriptor.recommendation_types.user_favorite = true;
}

//TODO This is commented because it cannot be added to the descriptor list at this point
//$scope.add_descriptor(newDescriptor);
// TODO This is commented because it cannot be added to the descriptor list at this point
// $scope.add_descriptor(newDescriptor);

interactionsService.register_interaction(
uri,
Expand Down Expand Up @@ -571,10 +570,10 @@ angular.module("dendroApp.controllers")
var uri = "/interactions/favorite_descriptor_from_quick_list_for_user";

newDescriptor.just_added = true;
//newDescriptor.added_from_quick_list = true;
// newDescriptor.added_from_quick_list = true;
newDescriptor.rankingPosition = index;
newDescriptor.pageNumber = $scope.recommendations_page;
if(newDescriptor.recommendation_types != null)
if (newDescriptor.recommendation_types != null)
{
newDescriptor.recommendation_types.user_favorite = true;
}
Expand All @@ -584,8 +583,8 @@ angular.module("dendroApp.controllers")
newDescriptor.recommendation_types.user_favorite = true;
}

//TODO This is commented because it cannot be added to the descriptor list at this point
//$scope.add_descriptor(newDescriptor);
// TODO This is commented because it cannot be added to the descriptor list at this point
// $scope.add_descriptor(newDescriptor);

interactionsService.register_interaction(
uri,
Expand Down Expand Up @@ -620,10 +619,10 @@ angular.module("dendroApp.controllers")
var uri = "/interactions/unfavorite_descriptor_from_quick_list_for_user";

newDescriptor.just_added = true;
//newDescriptor.added_from_quick_list = true;
// newDescriptor.added_from_quick_list = true;
newDescriptor.rankingPosition = index;
newDescriptor.pageNumber = $scope.recommendations_page;
if(newDescriptor.recommendation_types != null)
if (newDescriptor.recommendation_types != null)
{
newDescriptor.recommendation_types.user_favorite = false;
}
Expand All @@ -633,8 +632,8 @@ angular.module("dendroApp.controllers")
newDescriptor.recommendation_types.user_favorite = false;
}

//TODO This is commented because it cannot be added to the descriptor list at this point
//$scope.add_descriptor(newDescriptor);
// TODO This is commented because it cannot be added to the descriptor list at this point
// $scope.add_descriptor(newDescriptor);

interactionsService.register_interaction(
uri,
Expand Down Expand Up @@ -668,10 +667,10 @@ angular.module("dendroApp.controllers")
var interactionType = "unfavorite_descriptor_from_quick_list_for_project";
var uri = "/interactions/unfavorite_descriptor_from_quick_list_for_project";

//newDescriptor.added_from_quick_list = true;
// newDescriptor.added_from_quick_list = true;
newDescriptor.rankingPosition = index;
newDescriptor.pageNumber = $scope.recommendations_page;
if(newDescriptor.recommendation_types != null)
if (newDescriptor.recommendation_types != null)
{
newDescriptor.recommendation_types.project_favorite = false;
}
Expand All @@ -681,8 +680,8 @@ angular.module("dendroApp.controllers")
newDescriptor.recommendation_types.project_favorite = false;
}

//TODO This is commented because it cannot be added to the descriptor list at this point
//$scope.add_descriptor(newDescriptor);
// TODO This is commented because it cannot be added to the descriptor list at this point
// $scope.add_descriptor(newDescriptor);

interactionsService.register_interaction(
uri,
Expand Down
2 changes: 1 addition & 1 deletion public/app/js/controllers/social/timeline_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ angular.module("dendroApp.controllers")
.catch(function (error)
{
console.log("error", "Error at getPosts: " + JSON.stringify(error));
if(error !== null && error.data !== null && error.data.message !== null)
if (error !== null && error.data !== null && error.data.message !== null)
{
Utils.show_popup("error", "Error getting posts information", error.data.message);
}
Expand Down
2 changes: 1 addition & 1 deletion public/app/js/services/social/timeline_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,5 +235,5 @@ angular.module("dendroApp.services")
contentType: "application/json",
headers: {Accept: "application/json"}
});
}
};
}]);
36 changes: 17 additions & 19 deletions src/bootup/init/init_mysql.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const Sequelize = require('sequelize');
const Sequelize = require("sequelize");
const Pathfinder = global.Pathfinder;
const Config = require(Pathfinder.absPathInSrcFolder("models/meta/config.js")).Config;
const Logger = require(Pathfinder.absPathInSrcFolder("utils/logger.js")).Logger;
const Umzug = require('umzug');
const Umzug = require("umzug");
let isNull = require(Pathfinder.absPathInSrcFolder("/utils/null.js")).isNull;

const initMySQL = function (app, callback)
Expand All @@ -13,7 +13,7 @@ const initMySQL = function (app, callback)
{
// Create connection omitting database name, create database if not exists
const sequelize = new Sequelize("", Config.mySQLAuth.user, Config.mySQLAuth.password, {
dialect: 'mysql',
dialect: "mysql",
host: Config.mySQLHost,
port: Config.mySQLPort,
logging: false,
Expand All @@ -25,19 +25,15 @@ const initMySQL = function (app, callback)
{
Logger.log_boot_message("Connected to MySQL!");
return sequelize.query("CREATE DATABASE IF NOT EXISTS " + Config.mySQLDBName + ";").then(data =>
{
return callback(null, data);
})
.catch(err =>
{
Logger.log("error", "Error creating database in MySQL: " + Config.mySQLDBName);
return callback(err, null);
});
callback(null, data))
.catch(err =>
{
Logger.log("error", "Error creating database in MySQL: " + Config.mySQLDBName);
return callback(err, null);
});
})
.catch(err =>
{
return callback(err, null);
});
callback(err, null));
};

createDatabase(function (err, result)
Expand All @@ -49,29 +45,31 @@ const initMySQL = function (app, callback)

// run migrations
const sequelize = new Sequelize(Config.mySQLDBName, Config.mySQLAuth.user, Config.mySQLAuth.password, {
dialect: 'mysql',
dialect: "mysql",
host: Config.mySQLHost,
port: Config.mySQLPort,
logging: false,
define: {
underscored: false,
freezeTableName: true,
charset: 'utf8',
charset: "utf8"
},
operatorsAliases: false
});

var umzug = new Umzug({
storage: 'sequelize',
storage: "sequelize",
storageOptions: { sequelize: sequelize },
migrations: {
params: [sequelize.getQueryInterface(), Sequelize],
path: Pathfinder.absPathInSrcFolder("/mysql_migrations")}
});

return umzug.up().then(function () {
return umzug.up().then(function ()
{
return callback(null);
}).catch(err => {
}).catch(err =>
{
console.log(err);
return callback(err);
});
Expand Down
Loading

0 comments on commit 4ae94f8

Please sign in to comment.