diff --git a/config/config.json b/config/config.json
index 4220d10551..4477ec63b0 100644
--- a/config/config.json
+++ b/config/config.json
@@ -82,6 +82,14 @@
"ShowEmailAddress": true,
"ShowFullName": true
},
+ "SupportSettings": {
+ "TermsOfServiceLink": "/static/help/terms.html",
+ "PrivacyPolicyLink": "/static/help/privacy.html",
+ "AboutLink": "/static/help/about.html",
+ "HelpLink": "/static/help/help.html",
+ "ReportAProblemLink": "/static/help/report_problem.html",
+ "SupportEmail": "feedback@mattermost.com"
+ },
"GitLabSettings": {
"Enable": false,
"Secret": "",
diff --git a/docker/dev/config_docker.json b/docker/dev/config_docker.json
index a35abb9da8..ab1373a44a 100644
--- a/docker/dev/config_docker.json
+++ b/docker/dev/config_docker.json
@@ -82,6 +82,14 @@
"ShowEmailAddress": true,
"ShowFullName": true
},
+ "SupportSettings": {
+ "TermsOfServiceLink": "/static/help/terms.html",
+ "PrivacyPolicyLink": "/static/help/privacy.html",
+ "AboutLink": "/static/help/about.html",
+ "HelpLink": "/static/help/help.html",
+ "ReportAProblemLink": "/static/help/report_problem.html",
+ "SupportEmail": "feedback@mattermost.com"
+ },
"GitLabSettings": {
"Enable": false,
"Secret": "",
diff --git a/docker/local/config_docker.json b/docker/local/config_docker.json
index a35abb9da8..ab1373a44a 100644
--- a/docker/local/config_docker.json
+++ b/docker/local/config_docker.json
@@ -82,6 +82,14 @@
"ShowEmailAddress": true,
"ShowFullName": true
},
+ "SupportSettings": {
+ "TermsOfServiceLink": "/static/help/terms.html",
+ "PrivacyPolicyLink": "/static/help/privacy.html",
+ "AboutLink": "/static/help/about.html",
+ "HelpLink": "/static/help/help.html",
+ "ReportAProblemLink": "/static/help/report_problem.html",
+ "SupportEmail": "feedback@mattermost.com"
+ },
"GitLabSettings": {
"Enable": false,
"Secret": "",
diff --git a/model/config.go b/model/config.go
index a3ba812b00..9030f91ae6 100644
--- a/model/config.go
+++ b/model/config.go
@@ -113,6 +113,15 @@ type PrivacySettings struct {
ShowFullName bool
}
+type SupportSettings struct {
+ TermsOfServiceLink *string
+ PrivacyPolicyLink *string
+ AboutLink *string
+ HelpLink *string
+ ReportAProblemLink *string
+ SupportEmail *string
+}
+
type TeamSettings struct {
SiteName string
MaxUsersPerTeam int
@@ -132,6 +141,7 @@ type Config struct {
EmailSettings EmailSettings
RateLimitSettings RateLimitSettings
PrivacySettings PrivacySettings
+ SupportSettings SupportSettings
GitLabSettings SSOSettings
}
@@ -206,6 +216,35 @@ func (o *Config) SetDefaults() {
*o.EmailSettings.PushNotificationServer = ""
}
+ if o.SupportSettings.TermsOfServiceLink == nil {
+ o.SupportSettings.TermsOfServiceLink = new(string)
+ *o.SupportSettings.TermsOfServiceLink = "/static/help/terms.html"
+ }
+
+ if o.SupportSettings.PrivacyPolicyLink == nil {
+ o.SupportSettings.PrivacyPolicyLink = new(string)
+ *o.SupportSettings.PrivacyPolicyLink = "/static/help/privacy.html"
+ }
+
+ if o.SupportSettings.AboutLink == nil {
+ o.SupportSettings.AboutLink = new(string)
+ *o.SupportSettings.AboutLink = "/static/help/about.html"
+ }
+
+ if o.SupportSettings.HelpLink == nil {
+ o.SupportSettings.HelpLink = new(string)
+ *o.SupportSettings.HelpLink = "/static/help/help.html"
+ }
+
+ if o.SupportSettings.ReportAProblemLink == nil {
+ o.SupportSettings.ReportAProblemLink = new(string)
+ *o.SupportSettings.ReportAProblemLink = "/static/help/report_problem.html"
+ }
+
+ if o.SupportSettings.SupportEmail == nil {
+ o.SupportSettings.SupportEmail = new(string)
+ *o.SupportSettings.SupportEmail = "feedback@mattermost.com"
+ }
}
func (o *Config) IsValid() *AppError {
diff --git a/utils/config.go b/utils/config.go
index 4c8e0b5a19..0789c101dd 100644
--- a/utils/config.go
+++ b/utils/config.go
@@ -205,6 +205,13 @@ func getClientConfig(c *model.Config) map[string]string {
props["ShowEmailAddress"] = strconv.FormatBool(c.PrivacySettings.ShowEmailAddress)
+ props["TermsOfServiceLink"] = *c.SupportSettings.TermsOfServiceLink
+ props["PrivacyPolicyLink"] = *c.SupportSettings.PrivacyPolicyLink
+ props["AboutLink"] = *c.SupportSettings.AboutLink
+ props["HelpLink"] = *c.SupportSettings.HelpLink
+ props["ReportAProblemLink"] = *c.SupportSettings.ReportAProblemLink
+ props["SupportEmail"] = *c.SupportSettings.SupportEmail
+
props["EnablePublicLink"] = strconv.FormatBool(c.FileSettings.EnablePublicLink)
props["ProfileHeight"] = fmt.Sprintf("%v", c.FileSettings.ProfileHeight)
props["ProfileWidth"] = fmt.Sprintf("%v", c.FileSettings.ProfileWidth)
diff --git a/web/react/components/admin_console/admin_controller.jsx b/web/react/components/admin_console/admin_controller.jsx
index 4f144b0dd2..e587c4f845 100644
--- a/web/react/components/admin_console/admin_controller.jsx
+++ b/web/react/components/admin_console/admin_controller.jsx
@@ -18,6 +18,7 @@ import GitLabSettingsTab from './gitlab_settings.jsx';
import SqlSettingsTab from './sql_settings.jsx';
import TeamSettingsTab from './team_settings.jsx';
import ServiceSettingsTab from './service_settings.jsx';
+import LegalAndSupportSettingsTab from './legal_and_support_settings.jsx';
import TeamUsersTab from './team_users.jsx';
import TeamAnalyticsTab from './team_analytics.jsx';
@@ -148,6 +149,8 @@ export default class AdminController extends React.Component {
tab = ;
} else if (this.state.selected === 'service_settings') {
tab = ;
+ } else if (this.state.selected === 'legal_and_support_settings') {
+ tab = ;
} else if (this.state.selected === 'team_users') {
if (this.state.teams) {
tab = ;
diff --git a/web/react/components/admin_console/admin_sidebar.jsx b/web/react/components/admin_console/admin_sidebar.jsx
index cc98c495ee..d2255ad590 100644
--- a/web/react/components/admin_console/admin_sidebar.jsx
+++ b/web/react/components/admin_console/admin_sidebar.jsx
@@ -252,6 +252,15 @@ export default class AdminSidebar extends React.Component {
{'GitLab Settings'}
+
+
+ {'Legal and Support Settings'}
+
+
diff --git a/web/react/components/admin_console/legal_and_support_settings.jsx b/web/react/components/admin_console/legal_and_support_settings.jsx
new file mode 100644
index 0000000000..b00e4b6bd0
--- /dev/null
+++ b/web/react/components/admin_console/legal_and_support_settings.jsx
@@ -0,0 +1,222 @@
+// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+import * as Client from '../../utils/client.jsx';
+import * as AsyncClient from '../../utils/async_client.jsx';
+
+export default class LegalAndSupportSettings extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.handleChange = this.handleChange.bind(this);
+ this.handleSubmit = this.handleSubmit.bind(this);
+
+ this.state = {
+ saveNeeded: false,
+ serverError: null
+ };
+ }
+
+ handleChange() {
+ var s = {saveNeeded: true, serverError: this.state.serverError};
+ this.setState(s);
+ }
+
+ handleSubmit(e) {
+ e.preventDefault();
+ $('#save-button').button('loading');
+
+ var config = this.props.config;
+
+ config.SupportSettings.TermsOfServiceLink = ReactDOM.findDOMNode(this.refs.TermsOfServiceLink).value.trim();
+ config.SupportSettings.PrivacyPolicyLink = ReactDOM.findDOMNode(this.refs.PrivacyPolicyLink).value.trim();
+ config.SupportSettings.AboutLink = ReactDOM.findDOMNode(this.refs.AboutLink).value.trim();
+ config.SupportSettings.HelpLink = ReactDOM.findDOMNode(this.refs.HelpLink).value.trim();
+ config.SupportSettings.ReportAProblemLink = ReactDOM.findDOMNode(this.refs.ReportAProblemLink).value.trim();
+ config.SupportSettings.SupportEmail = ReactDOM.findDOMNode(this.refs.SupportEmail).value.trim();
+
+ Client.saveConfig(
+ config,
+ () => {
+ AsyncClient.getConfig();
+ this.setState({
+ serverError: null,
+ saveNeeded: false
+ });
+ $('#save-button').button('reset');
+ },
+ (err) => {
+ this.setState({
+ serverError: err.message,
+ saveNeeded: true
+ });
+ $('#save-button').button('reset');
+ }
+ );
+ }
+
+ render() {
+ var serverError = '';
+ if (this.state.serverError) {
+ serverError = {this.state.serverError}
;
+ }
+
+ var saveClass = 'btn';
+ if (this.state.saveNeeded) {
+ saveClass = 'btn btn-primary';
+ }
+
+ return (
+
+
+
{'Legal and Support Settings'}
+
+
+ );
+ }
+}
+
+LegalAndSupportSettings.propTypes = {
+ config: React.PropTypes.object
+};
diff --git a/web/react/components/admin_console/service_settings.jsx b/web/react/components/admin_console/service_settings.jsx
index 908eb709ab..1f5faf1d43 100644
--- a/web/react/components/admin_console/service_settings.jsx
+++ b/web/react/components/admin_console/service_settings.jsx
@@ -36,7 +36,7 @@ export default class ServiceSettings extends React.Component {
config.ServiceSettings.SegmentDeveloperKey = ReactDOM.findDOMNode(this.refs.SegmentDeveloperKey).value.trim();
config.ServiceSettings.GoogleDeveloperKey = ReactDOM.findDOMNode(this.refs.GoogleDeveloperKey).value.trim();
config.ServiceSettings.EnableIncomingWebhooks = ReactDOM.findDOMNode(this.refs.EnableIncomingWebhooks).checked;
- config.ServiceSettings.EnableOutgoingWebhooks = React.findDOMNode(this.refs.EnableOutgoingWebhooks).checked;
+ config.ServiceSettings.EnableOutgoingWebhooks = ReactDOM.findDOMNode(this.refs.EnableOutgoingWebhooks).checked;
config.ServiceSettings.EnablePostUsernameOverride = ReactDOM.findDOMNode(this.refs.EnablePostUsernameOverride).checked;
config.ServiceSettings.EnablePostIconOverride = ReactDOM.findDOMNode(this.refs.EnablePostIconOverride).checked;
config.ServiceSettings.EnableTesting = ReactDOM.findDOMNode(this.refs.EnableTesting).checked;
diff --git a/web/react/components/navbar_dropdown.jsx b/web/react/components/navbar_dropdown.jsx
index c286ee6f99..d4ec5a5f5c 100644
--- a/web/react/components/navbar_dropdown.jsx
+++ b/web/react/components/navbar_dropdown.jsx
@@ -184,6 +184,34 @@ export default class NavbarDropdown extends React.Component {
);
}
+ let helpLink = null;
+ if (global.window.mm_config.HelpLink) {
+ helpLink = (
+
+
+ {'Help'}
+
+
+ );
+ }
+
+ let reportLink = null;
+ if (global.window.mm_config.ReportAProblemLink) {
+ reportLink = (
+
+
+ {'Report a Problem'}
+
+
+ );
+ }
+
return (
-
-
- {'Help'}
-
-
-
-
- {'Report a Problem'}
-
-
+ {helpLink}
+ {reportLink}
- Invite New Member
+ {'Invite New Member'}
);
@@ -75,7 +75,7 @@ export default class SidebarRightMenu extends React.Component {
href='#'
data-toggle='modal'
data-target='#team_settings'
- > Team Settings
+ > {'Team Settings'}
);
manageLink = (
@@ -93,7 +93,7 @@ export default class SidebarRightMenu extends React.Component {
- System Console
+ {'System Console'}
);
}
@@ -107,6 +107,27 @@ export default class SidebarRightMenu extends React.Component {
teamDisplayName = this.props.teamDisplayName;
}
+ let helpLink = null;
+ if (global.window.mm_config.HelpLink) {
+ helpLink = (
+
+ {'Help'}
+ );
+ }
+
+ let reportLink = null;
+ if (global.window.mm_config.ReportAProblemLink) {
+ reportLink = (
+
+ {'Report a Problem'}
+ );
+ }
return (
@@ -123,7 +144,7 @@ export default class SidebarRightMenu extends React.Component {
href='#'
onClick={() => this.setState({showUserSettingsModal: true})}
>
-
Account Settings
+
{'Account Settings'}
{teamSettingsLink}
@@ -135,18 +156,10 @@ export default class SidebarRightMenu extends React.Component {
Logout
+ >
{'Logout'}
-
- Help
-
- Report a Problem
+ {helpLink}
+ {reportLink}
+ {'Need anything, just email us at '}
+
+ {global.window.mm_config.SupportEmail}
+
+ {'.'}
+
+ );
+ }
+
return (
{'You’re all set'}
@@ -119,16 +135,7 @@ export default class TutorialIntroScreens extends React.Component {
{inviteModalLink}
{' when you’re ready.'}
-
- {'Need anything, just email us at '}
-
- {'feedback@mattermost.com'}
-
- {'.'}
-
+ {supportInfo}
{'Click “Next” to enter Town Square. This is the first channel teammates see when they sign up. Use it for posting updates everyone needs to know.'}
{circles}
diff --git a/web/templates/footer.html b/web/templates/footer.html
index dc1a7c9d0c..60dd5a40e4 100644
--- a/web/templates/footer.html
+++ b/web/templates/footer.html
@@ -12,9 +12,28 @@
{{end}}