mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Moving config.js to /web/react/utils/ Including in every file needed
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
import {config} from '../utils/config.js';
|
||||
|
||||
export default class EmailVerify extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
var utils = require('../utils/utils.jsx');
|
||||
var client = require('../utils/client.jsx');
|
||||
import {strings} from '../utils/config.js';
|
||||
|
||||
export default class FindTeam extends React.Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// See License.txt for license information.
|
||||
|
||||
var UserStore = require('../stores/user_store.jsx');
|
||||
import {strings} from '../utils/config.js';
|
||||
|
||||
export default class GetLinkModal extends React.Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -6,6 +6,7 @@ var ConfigStore = require('../stores/config_store.jsx');
|
||||
var Client = require('../utils/client.jsx');
|
||||
var UserStore = require('../stores/user_store.jsx');
|
||||
var ConfirmModal = require('./confirm_modal.jsx');
|
||||
import {config} from '../utils/config.js';
|
||||
|
||||
export default class InviteMemberModal extends React.Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -6,6 +6,7 @@ const Client = require('../utils/client.jsx');
|
||||
const UserStore = require('../stores/user_store.jsx');
|
||||
const BrowserStore = require('../stores/browser_store.jsx');
|
||||
const Constants = require('../utils/constants.jsx');
|
||||
import {config, strings} from '../utils/config.js';
|
||||
|
||||
export default class Login extends React.Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -7,6 +7,7 @@ var UserStore = require('../stores/user_store.jsx');
|
||||
var TeamStore = require('../stores/team_store.jsx');
|
||||
|
||||
var Constants = require('../utils/constants.jsx');
|
||||
import {config} from '../utils/config.js';
|
||||
|
||||
function getStateFromStores() {
|
||||
return {teams: UserStore.getTeams(), currentTeam: TeamStore.getCurrent()};
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// See License.txt for license information.
|
||||
|
||||
var client = require('../utils/client.jsx');
|
||||
import {config} from '../utils/config.js';
|
||||
|
||||
export default class PasswordResetForm extends React.Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -15,6 +15,8 @@ var AppDispatcher = require('../dispatcher/app_dispatcher.jsx');
|
||||
var Constants = require('../utils/constants.jsx');
|
||||
var ActionTypes = Constants.ActionTypes;
|
||||
|
||||
import {strings} from '../utils/config.js';
|
||||
|
||||
export default class PostList extends React.Component {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
import {config} from '../utils/config.js';
|
||||
|
||||
export default class SettingPicture extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
var NavbarDropdown = require('./navbar_dropdown.jsx');
|
||||
var UserStore = require('../stores/user_store.jsx');
|
||||
import {config} from '../utils/config.js';
|
||||
|
||||
export default class SidebarHeader extends React.Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
var UserStore = require('../stores/user_store.jsx');
|
||||
var client = require('../utils/client.jsx');
|
||||
var utils = require('../utils/utils.jsx');
|
||||
import {config} from '../utils/config.js';
|
||||
|
||||
export default class SidebarRightMenu extends React.Component {
|
||||
constructor(props) {
|
||||
@@ -128,4 +129,4 @@ export default class SidebarRightMenu extends React.Component {
|
||||
SidebarRightMenu.propTypes = {
|
||||
teamType: React.PropTypes.string,
|
||||
teamDisplayName: React.PropTypes.string
|
||||
};
|
||||
};
|
||||
|
||||
@@ -6,6 +6,7 @@ var client = require('../utils/client.jsx');
|
||||
var UserStore = require('../stores/user_store.jsx');
|
||||
var BrowserStore = require('../stores/browser_store.jsx');
|
||||
var Constants = require('../utils/constants.jsx');
|
||||
import {config} from '../utils/config.js';
|
||||
|
||||
export default class SignupUserComplete extends React.Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -6,6 +6,7 @@ const SettingItemMax = require('./setting_item_max.jsx');
|
||||
|
||||
const Client = require('../utils/client.jsx');
|
||||
const Utils = require('../utils/utils.jsx');
|
||||
import {strings} from '../utils/config.js';
|
||||
|
||||
export default class GeneralTab extends React.Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// See License.txt for license information.
|
||||
|
||||
var Client = require('../utils/client.jsx');
|
||||
import {strings} from '../utils/config.js';
|
||||
|
||||
export default class TeamSignupAllowedDomainsPage extends React.Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// See License.txt for license information.
|
||||
|
||||
var Constants = require('../utils/constants.jsx');
|
||||
import {strings} from '../utils/config.js';
|
||||
|
||||
export default class ChooseAuthPage extends React.Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
var utils = require('../utils/utils.jsx');
|
||||
var client = require('../utils/client.jsx');
|
||||
import {strings} from '../utils/config.js';
|
||||
|
||||
export default class TeamSignupDisplayNamePage extends React.Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
var Client = require('../utils/client.jsx');
|
||||
var BrowserStore = require('../stores/browser_store.jsx');
|
||||
var UserStore = require('../stores/user_store.jsx');
|
||||
import {strings, config} from '../utils/config.js';
|
||||
|
||||
export default class TeamSignupPasswordPage extends React.Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -5,6 +5,7 @@ var EmailItem = require('./team_signup_email_item.jsx');
|
||||
var Utils = require('../utils/utils.jsx');
|
||||
var ConfigStore = require('../stores/config_store.jsx');
|
||||
var Client = require('../utils/client.jsx');
|
||||
import {strings, config} from '../utils/config.js';
|
||||
|
||||
export default class TeamSignupSendInvitesPage extends React.Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
const Utils = require('../utils/utils.jsx');
|
||||
const Client = require('../utils/client.jsx');
|
||||
const Constants = require('../utils/constants.jsx');
|
||||
import {strings, config} from '../utils/config.js';
|
||||
|
||||
export default class TeamSignupUrlPage extends React.Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
var Utils = require('../utils/utils.jsx');
|
||||
var Client = require('../utils/client.jsx');
|
||||
import {strings} from '../utils/config.js';
|
||||
|
||||
export default class TeamSignupUsernamePage extends React.Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
var Utils = require('../utils/utils.jsx');
|
||||
var Client = require('../utils/client.jsx');
|
||||
var BrowserStore = require('../stores/browser_store.jsx');
|
||||
import {config} from '../utils/config.js';
|
||||
|
||||
export default class TeamSignupWelcomePage extends React.Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
const Utils = require('../utils/utils.jsx');
|
||||
const Client = require('../utils/client.jsx');
|
||||
import {strings} from '../utils/config.js';
|
||||
|
||||
export default class EmailSignUpPage extends React.Component {
|
||||
constructor() {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
var utils = require('../utils/utils.jsx');
|
||||
var client = require('../utils/client.jsx');
|
||||
var Constants = require('../utils/constants.jsx');
|
||||
import {strings} from '../utils/config.js';
|
||||
|
||||
export default class SSOSignUpPage extends React.Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
var Utils = require('../utils/utils.jsx');
|
||||
var UserStore = require('../stores/user_store.jsx');
|
||||
import {config} from '../utils/config.js';
|
||||
|
||||
var id = 0;
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ var SettingItemMin = require('./setting_item_min.jsx');
|
||||
var SettingItemMax = require('./setting_item_max.jsx');
|
||||
var Client = require('../utils/client.jsx');
|
||||
var Utils = require('../utils/utils.jsx');
|
||||
import {config} from '../utils/config.js';
|
||||
|
||||
export default class UserSettingsAppearance extends React.Component {
|
||||
constructor(props) {
|
||||
|
||||
@@ -9,6 +9,7 @@ var client = require('../utils/client.jsx');
|
||||
var AsyncClient = require('../utils/async_client.jsx');
|
||||
var utils = require('../utils/utils.jsx');
|
||||
var assign = require('object-assign');
|
||||
import {config} from '../utils/config.js';
|
||||
|
||||
function getNotificationsStateFromStores() {
|
||||
var user = UserStore.getCurrentUser();
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
var Client = require('../utils/client.jsx');
|
||||
var Utils = require('../utils/utils.jsx');
|
||||
import {config} from '../utils/config.js';
|
||||
|
||||
export default class ViewImageModal extends React.Component {
|
||||
constructor(props) {
|
||||
|
||||
48
web/react/utils/config.js
Normal file
48
web/react/utils/config.js
Normal file
@@ -0,0 +1,48 @@
|
||||
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
export var config = {
|
||||
|
||||
// Loggly configs
|
||||
LogglyWriteKey: '',
|
||||
LogglyConsoleErrors: true,
|
||||
|
||||
// Segment configs
|
||||
SegmentWriteKey: '',
|
||||
|
||||
// Feature switches
|
||||
AllowPublicLink: true,
|
||||
AllowInviteNames: true,
|
||||
RequireInviteNames: false,
|
||||
AllowSignupDomainsWizard: false,
|
||||
|
||||
// Google Developer Key (for Youtube API links)
|
||||
// Leave blank to disable
|
||||
GoogleDeveloperKey: '',
|
||||
|
||||
// Privacy switches
|
||||
ShowEmail: true,
|
||||
|
||||
// Links
|
||||
TermsLink: '/static/help/configure_links.html',
|
||||
PrivacyLink: '/static/help/configure_links.html',
|
||||
AboutLink: '/static/help/configure_links.html',
|
||||
HelpLink: '/static/help/configure_links.html',
|
||||
ReportProblemLink: '/static/help/configure_links.html',
|
||||
HomeLink: '',
|
||||
|
||||
// Toggle whether or not users are shown a message about agreeing to the Terms of Service during the signup process
|
||||
ShowTermsDuringSignup: false,
|
||||
|
||||
ThemeColors: ['#2389d7', '#008a17', '#dc4fad', '#ac193d', '#0072c6', '#d24726', '#ff8f32', '#82ba00', '#03b3b2', '#008299', '#4617b4', '#8c0095', '#004b8b', '#004b8b', '#570000', '#380000', '#585858', '#000000']
|
||||
};
|
||||
|
||||
// Flavor strings
|
||||
export var strings = {
|
||||
Team: 'team',
|
||||
TeamPlural: 'teams',
|
||||
Company: 'company',
|
||||
CompanyPlural: 'companies'
|
||||
};
|
||||
|
||||
global.window.config = config;
|
||||
@@ -9,6 +9,7 @@ var ActionTypes = Constants.ActionTypes;
|
||||
var AsyncClient = require('./async_client.jsx');
|
||||
var client = require('./client.jsx');
|
||||
var Autolinker = require('autolinker');
|
||||
import {config} from '../utils/config.js';
|
||||
|
||||
export function isEmail(email) {
|
||||
var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
var config = {
|
||||
|
||||
// Loggly configs
|
||||
LogglyWriteKey: "",
|
||||
LogglyConsoleErrors: true,
|
||||
|
||||
// Segment configs
|
||||
SegmentWriteKey: "",
|
||||
|
||||
// Feature switches
|
||||
AllowPublicLink: true,
|
||||
AllowInviteNames: true,
|
||||
RequireInviteNames: false,
|
||||
AllowSignupDomainsWizard: false,
|
||||
|
||||
// Google Developer Key (for Youtube API links)
|
||||
// Leave blank to disable
|
||||
GoogleDeveloperKey: "",
|
||||
|
||||
// Privacy switches
|
||||
ShowEmail: true,
|
||||
|
||||
// Links
|
||||
TermsLink: "/static/help/configure_links.html",
|
||||
PrivacyLink: "/static/help/configure_links.html",
|
||||
AboutLink: "/static/help/configure_links.html",
|
||||
HelpLink: "/static/help/configure_links.html",
|
||||
ReportProblemLink: "/static/help/configure_links.html",
|
||||
HomeLink: "",
|
||||
|
||||
// Toggle whether or not users are shown a message about agreeing to the Terms of Service during the signup process
|
||||
ShowTermsDuringSignup: false,
|
||||
|
||||
ThemeColors: ["#2389d7", "#008a17", "#dc4fad", "#ac193d", "#0072c6", "#d24726", "#ff8f32", "#82ba00", "#03b3b2", "#008299", "#4617b4", "#8c0095", "#004b8b", "#004b8b", "#570000", "#380000", "#585858", "#000000"]
|
||||
};
|
||||
|
||||
// Flavor strings
|
||||
var strings = {
|
||||
Team: "team",
|
||||
TeamPlural: "teams",
|
||||
Company: "company",
|
||||
CompanyPlural: "companies"
|
||||
};
|
||||
@@ -37,8 +37,8 @@
|
||||
<script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1','packages':['annotationchart']}]}"></script>
|
||||
|
||||
<script type="text/javascript" src="https://cloudfront.loggly.com/js/loggly.tracker.js" async></script>
|
||||
<script id="config" type="text/javascript" src="/static/config/config.js"></script>
|
||||
<style id="antiClickjack">body{display:none !important;}</style>
|
||||
<script src="/static/js/bundle.js"></script>
|
||||
<script type="text/javascript">
|
||||
if (self === top) {
|
||||
var blocker = document.getElementById("antiClickjack");
|
||||
@@ -46,30 +46,29 @@
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
if (config == null) {
|
||||
config = {};
|
||||
if (window.config == null) {
|
||||
window.config = {};
|
||||
}
|
||||
config.SiteName = '{{ .SiteName }}';
|
||||
config.ProfileWidth = '{{ .Props.ProfileWidth }}'
|
||||
config.ProfileHeight = '{{ .Props.ProfileHeight }}'
|
||||
window.config.SiteName = '{{ .SiteName }}';
|
||||
window.config.ProfileWidth = '{{ .Props.ProfileWidth }}'
|
||||
window.config.ProfileHeight = '{{ .Props.ProfileHeight }}'
|
||||
</script>
|
||||
|
||||
<script src="/static/js/bundle.js"></script>
|
||||
|
||||
<script>
|
||||
if (config.LogglyWriteKey != null && config.LogglyWriteKey !== "") {
|
||||
if (window.config.LogglyWriteKey != null && window.config.LogglyWriteKey !== "") {
|
||||
var LTracker = LTracker || [];
|
||||
window.LTracker = LTracker;
|
||||
LTracker.push({'logglyKey': config.LogglyWriteKey, 'sendConsoleErrors' : config.LogglyConsoleErrors });
|
||||
LTracker.push({'logglyKey': window.config.LogglyWriteKey, 'sendConsoleErrors' : window.config.LogglyConsoleErrors });
|
||||
} else {
|
||||
window.LTracker = [];
|
||||
console.warn("config.js missing LogglyWriteKey, Loggly analytics is not reporting");
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
if (config.SegmentWriteKey != null && config.SegmentWriteKey !== "") {
|
||||
if (window.config.SegmentWriteKey != null && window.config.SegmentWriteKey !== "") {
|
||||
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","group","track","ready","alias","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="3.0.1";
|
||||
analytics.load(config.SegmentWriteKey);
|
||||
analytics.load(window.config.SegmentWriteKey);
|
||||
var user = window.UserStore.getCurrentUser(true);
|
||||
if (user) {
|
||||
analytics.identify(user.id, {
|
||||
|
||||
Reference in New Issue
Block a user