Commit d63d3a87 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

lint issues

parent e8044f03
...@@ -811,7 +811,7 @@ ServerConnector.getSessionData = function(project) { ...@@ -811,7 +811,7 @@ ServerConnector.getSessionData = function(project) {
this._sessionData = new SessionData(project); this._sessionData = new SessionData(project);
} }
if (project!==undefined && this._sessionData.getProject()===null) { if (project!==undefined && this._sessionData.getProject()===null) {
this._sessionData.setProject(project) this._sessionData.setProject(project);
} }
return this._sessionData; return this._sessionData;
}; };
...@@ -852,7 +852,7 @@ ServerConnector.login = function(login, password) { ...@@ -852,7 +852,7 @@ ServerConnector.login = function(login, password) {
if (token===undefined) { if (token===undefined) {
reject(obj.error); reject(obj.error);
} else { } else {
self.getSessionData().setToken(token) self.getSessionData().setToken(token);
resolve(token); resolve(token);
} }
}).catch(function(exception){ }).catch(function(exception){
...@@ -863,11 +863,11 @@ ServerConnector.login = function(login, password) { ...@@ -863,11 +863,11 @@ ServerConnector.login = function(login, password) {
ServerConnector.isValidToken = function(token) { ServerConnector.isValidToken = function(token) {
var self = this; var self = this;
return new Promise(function(resolve, reject) { return new Promise(function(resolve) {
return self.readFile(self.isValidTokenUrl({token:token})).then(function(content) { return self.readFile(self.isValidTokenUrl({token:token})).then(function(content) {
var obj=JSON.parse(content); var obj=JSON.parse(content);
resolve(obj.error===undefined); resolve(obj.error===undefined);
}).catch(function(exception){ }).catch(function(){
resolve(false); resolve(false);
}); });
}); });
...@@ -875,8 +875,8 @@ ServerConnector.isValidToken = function(token) { ...@@ -875,8 +875,8 @@ ServerConnector.isValidToken = function(token) {
ServerConnector.logout = function() { ServerConnector.logout = function() {
var self = this; var self = this;
return new Promise(function(resolve, reject) { return new Promise(function(resolve) {
self.getSessionData().setToken(undefined) self.getSessionData().setToken(undefined);
resolve(); resolve();
}); });
}; };
......
"use strict"; "use strict";
/* exported logger */
var SessionObjectType = require('./SessionObjectType'); var SessionObjectType = require('./SessionObjectType');
var Cookies = require('js-cookie'); var Cookies = require('js-cookie');
...@@ -154,8 +156,8 @@ SessionData.prototype.setToken = function(token) { ...@@ -154,8 +156,8 @@ SessionData.prototype.setToken = function(token) {
} }
}; };
SessionData.prototype.getToken = function(model) { SessionData.prototype.getToken = function() {
var key = SessionObjectType.TOKEN var key = SessionObjectType.TOKEN;
var value = Cookies.get(key); var value = Cookies.get(key);
return value; return value;
}; };
......
...@@ -25,7 +25,7 @@ function UserPanel(params) { ...@@ -25,7 +25,7 @@ function UserPanel(params) {
var login = self.getLoginText().value; var login = self.getLoginText().value;
var password = self.getPasswordText().value; var password = self.getPasswordText().value;
ServerConnector.login(login, password).then(function(token){ ServerConnector.login(login, password).then(function(){
window.location.reload(false); window.location.reload(false);
}).catch(function(problem){ }).catch(function(problem){
GuiConnector.alert(problem); GuiConnector.alert(problem);
...@@ -33,7 +33,7 @@ function UserPanel(params) { ...@@ -33,7 +33,7 @@ function UserPanel(params) {
}; };
self.getLogoutButton().onclick = function(){ self.getLogoutButton().onclick = function(){
ServerConnector.logout().then(function(token){ ServerConnector.logout().then(function(){
window.location.reload(false); window.location.reload(false);
}).catch(function(problem){ }).catch(function(problem){
GuiConnector.alert(problem); GuiConnector.alert(problem);
...@@ -88,7 +88,7 @@ UserPanel.prototype.showLoginPage = function() { ...@@ -88,7 +88,7 @@ UserPanel.prototype.showLoginPage = function() {
self.getUserLoginTab().style.display = "block"; self.getUserLoginTab().style.display = "block";
self.getUserDataTab().style.display = "none"; self.getUserDataTab().style.display = "none";
} };
UserPanel.prototype.showUserProfilePage = function(user) { UserPanel.prototype.showUserProfilePage = function(user) {
var self = this; var self = this;
...@@ -100,6 +100,6 @@ UserPanel.prototype.showUserProfilePage = function(user) { ...@@ -100,6 +100,6 @@ UserPanel.prototype.showUserProfilePage = function(user) {
self.getNameValue().innerHTML = user.getName(); self.getNameValue().innerHTML = user.getName();
self.getSurnameValue().innerHTML = user.getSurname(); self.getSurnameValue().innerHTML = user.getSurname();
self.getEmailValue().innerHTML = user.getEmail(); self.getEmailValue().innerHTML = user.getEmail();
} };
module.exports = UserPanel; module.exports = UserPanel;
"use strict"; "use strict";
var Project = require("../../main/js/map/data/Project");
var Promise = require("bluebird"); var Promise = require("bluebird");
var Cookies = require('js-cookie'); var Cookies = require('js-cookie');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment