From c4a3118e9f885e92bb9b7d882898e9a51fc3be69 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Tue, 2 Aug 2016 16:37:09 -0400 Subject: PLT-3408 Add SiteURL to config.json (#3692) * PLT-3408 Changed serverside code to get the service's URL from config.json * PLT-3408 Changed most clientside code to use the SiteURL config setting instead of window.location * PLT-3408 Changed default SiteURL to be autodetected --- webapp/stores/team_store.jsx | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'webapp/stores') diff --git a/webapp/stores/team_store.jsx b/webapp/stores/team_store.jsx index f4383589a..a482fa3a1 100644 --- a/webapp/stores/team_store.jsx +++ b/webapp/stores/team_store.jsx @@ -11,12 +11,6 @@ const ActionTypes = Constants.ActionTypes; const CHANGE_EVENT = 'change'; var Utils; -function getWindowLocationOrigin() { - if (!Utils) { - Utils = require('utils/utils.jsx'); //eslint-disable-line global-require - } - return Utils.getWindowLocationOrigin(); -} class TeamStoreClass extends EventEmitter { constructor() { @@ -87,23 +81,23 @@ class TeamStoreClass extends EventEmitter { getCurrentTeamUrl() { if (this.getCurrent()) { - return getWindowLocationOrigin() + '/' + this.getCurrent().name; + return window.mm_config.SiteURL + '/' + this.getCurrent().name; } - return null; + return ''; } getCurrentTeamRelativeUrl() { if (this.getCurrent()) { return '/' + this.getCurrent().name; } - return null; + return ''; } getCurrentInviteLink() { const current = this.getCurrent(); if (current) { - return getWindowLocationOrigin() + '/signup_user_complete/?id=' + current.invite_id; + return window.mm_config.SiteURL + '/signup_user_complete/?id=' + current.invite_id; } return ''; @@ -112,10 +106,10 @@ class TeamStoreClass extends EventEmitter { getTeamUrl(id) { const team = this.get(id); if (team) { - return getWindowLocationOrigin() + '/' + team.name; + return window.mm_config.SiteURL + '/' + team.name; } - return null; + return ''; } saveTeam(team) { -- cgit v1.2.3-1-g7c22