Skip to content

Commit

Permalink
Constants
Browse files Browse the repository at this point in the history
  • Loading branch information
NewtonGauss committed Jul 1, 2022
1 parent 31a7bb0 commit 368549a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/gidsa/plugins/historical-telemetry/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ define([
const telemetryProvider = {
supportsRequest: domObj => domObj.type === Constants.TelemtryType,
request: (domObj, options) => {
const satName = domObj.identifier.namespace;
const satName = domObj.identifier.namespace.replace('.telemetry', '');
const tlmyVar = domObj.name;
const startDate = Math.floor(options.start);
const endDate = Math.floor(options.end);
Expand Down
2 changes: 1 addition & 1 deletion src/gidsa/plugins/telemetry-dictionary/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ define([
}

function TelemetryDictionary(sat, satService) {
const namespace = `${sat.name}`;
const namespace = `${sat.name}.telemetry`;
const satObjectPromise = satService.Dictionary(sat.name).then(dict => mapMetadata(namespace, dict));

const objectProvider = {
Expand Down
2 changes: 2 additions & 0 deletions src/gidsa/utils/constants.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
define({
SatelliteType: 'satellite',
TelemtryType: 'sat.telemetry',
AnonymUsername: 'anonym',
AnonymPassword: 'anonym',
});
11 changes: 9 additions & 2 deletions src/gidsa/utils/login.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
define([], function(){
define([
'./constants',
], function(
Constants,
){
const USR_DATA = 'userData';

function LoginService(entryPoint, http) {
Expand Down Expand Up @@ -53,7 +57,10 @@ define([], function(){
* @param {string} password la password con la cual iniciar sesion. Por defecto, 'anonym'.
* @return {Promise} una promise con el token.
*/
LoginService.prototype.Login = function(username = 'anonym', password = 'anonym') {
LoginService.prototype.Login = function(
username = Constants.AnonymUsername,
password = Constants.AnonymPassword,
) {
let retPromise;
// Si el usuario ya se encuentra loggeado, entonces no hace falta realizar el post
if ( this.isUserLoggedIn(username) ) {
Expand Down

0 comments on commit 368549a

Please sign in to comment.