Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use externe file for gmf User #1313

Merged
merged 1 commit into from
May 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
70 changes: 70 additions & 0 deletions contribs/gmf/externs/gmfx.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,73 @@ gmfx.ServiceUrls;
* @type {string}
*/
gmfx.ServiceUrls.prototype.exportgpxkml;


/**
* Availables functionalities.
* @typedef {{
* default_basemap: Array.<string>,
* location: Array.<string>
* }}
*/
gmfx.AuthenticationFunctionalities;


/**
* Base maps to use by default.
* @type {Array.<string>}
*/
gmfx.AuthenticationFunctionalities.prototype.default_basemap;


/**
* Availables locations.
* @type {Array.<string>}
*/
gmfx.AuthenticationFunctionalities.prototype.location;

/**
* @typedef {{
* functionalities: (gmfx.AuthenticationFunctionalities|null),
* is_password_changed: (boolean|null),
* role_id: (number|null),
* role_name: (string|null),
* username: (string|null)
* }}
*/
gmfx.User;


/**
* Configured functionalities of the user.
* @type {gmfx.AuthenticationFunctionalities|null}
*/
gmfx.User.prototype.functionalities;


/**
* True if the password of the user has been changed. False otherwise.
* @type {boolean|null}
*/
gmfx.User.prototype.is_password_changed;


/**
* the role id of the user.
* @type {number|null}
*/
gmfx.User.prototype.role_id;


/**
* The role name of the user.
* @type {string|null}
*/
gmfx.User.prototype.role_name;


/**
* The name of the user.
* @type {string|null}
*/
gmfx.User.prototype.username;
2 changes: 1 addition & 1 deletion contribs/gmf/src/controllers/abstract.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ gmf.AbstractController = function(config, $scope, $injector) {
this.measureLengthActive = false;

/**
* @type {gmf.User}
* @type {gmfx.User}
* @export
*/
this.gmfUser = $injector.get('gmfUser');
Expand Down
4 changes: 2 additions & 2 deletions contribs/gmf/src/directives/authenticationdirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ gmf.module.directive('gmfAuthentication', gmf.authenticationDirective);
* @param {angularGettext.Catalog} gettextCatalog Gettext catalog.
* @param {angular.Scope} $scope The directive's scope.
* @param {gmf.Authentication} gmfAuthentication GMF Authentication service
* @param {gmf.User} gmfUser User.
* @param {gmfx.User} gmfUser User.
* @constructor
* @ngInject
* @ngdoc controller
Expand All @@ -70,7 +70,7 @@ gmf.AuthenticationController = function(gettextCatalog, $scope,
gmfAuthentication, gmfUser) {

/**
* @type {gmf.User}
* @type {gmfx.User}
* @export
*/
this.gmfUser = gmfUser;
Expand Down
31 changes: 5 additions & 26 deletions contribs/gmf/src/services/authenticationservice.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ goog.require('ol.events.EventTarget');

/**
* @typedef {{
* functionalities: (gmf.AuthenticationFunctionalities|undefined),
* functionalities: (gmfx.AuthenticationFunctionalities|undefined),
* is_password_changed: (boolean|undefined),
* role_id: (number|undefined),
* role_name: (string|undefined),
Expand All @@ -20,15 +20,6 @@ goog.require('ol.events.EventTarget');
gmf.AuthenticationLoginResponse;


/**
* @typedef {{
* default_basemap: Array.<string>,
* location: Array
* }}
*/
gmf.AuthenticationFunctionalities;


/**
* @typedef {{
* success: boolean
Expand All @@ -49,18 +40,6 @@ gmf.AuthenticationRouteSuffix = {
};


/**
* @typedef {{
* functionalities: (gmf.AuthenticationFunctionalities|null),
* is_password_changed: (boolean|null),
* role_id: (number|null),
* role_name: (string|null),
* username: (string|null)
* }}
*/
gmf.User;


gmf.module.value('gmfUser', {
'functionalities': null,
'is_password_changed': null,
Expand Down Expand Up @@ -95,15 +74,15 @@ gmf.AuthenticationEventType = {
* @constructor
* @extends {ol.events.Event}
* @param {gmf.AuthenticationEventType} type Event type.
* @param {gmf.User} user The current user.
* @param {gmfx.User} user The current user.
*/
gmf.AuthenticationEvent = function(type, user) {

goog.base(this, type);

/**
* The logged-in user.
* @type {gmf.User}
* @type {gmfx.User}
*/
this.user = user;

Expand All @@ -127,7 +106,7 @@ goog.inherits(gmf.AuthenticationEvent, ol.events.Event);
* @extends {ol.events.EventTarget}
* @param {angular.$http} $http Angular http service.
* @param {string} authenticationBaseUrl URL to "authentication" web service.
* @param {gmf.User} gmfUser User.
* @param {gmfx.User} gmfUser User.
* @ngInject
*/
gmf.Authentication = function($http, authenticationBaseUrl, gmfUser) {
Expand All @@ -147,7 +126,7 @@ gmf.Authentication = function($http, authenticationBaseUrl, gmfUser) {
this.baseUrl_ = authenticationBaseUrl;

/**
* @type {gmf.User}
* @type {gmfx.User}
* @private
*/
this.user_ = gmfUser;
Expand Down