From c56b429e1dee257bac69de1db55cafee01ccd005 Mon Sep 17 00:00:00 2001 From: David Lu Date: Mon, 25 Jul 2016 20:03:15 -0400 Subject: Removed Legal & Support settings from UI if empty (#3662) --- model/config.go | 10 +-- webapp/components/header_footer_template.jsx | 95 +++++++++++++++++----------- 2 files changed, 64 insertions(+), 41 deletions(-) diff --git a/model/config.go b/model/config.go index b38179cf1..d7e4cac91 100644 --- a/model/config.go +++ b/model/config.go @@ -489,7 +489,7 @@ func (o *Config) SetDefaults() { if o.SupportSettings.TermsOfServiceLink == nil { o.SupportSettings.TermsOfServiceLink = new(string) - *o.SupportSettings.TermsOfServiceLink = "/static/help/terms.html" + *o.SupportSettings.TermsOfServiceLink = "" } if !IsSafeLink(o.SupportSettings.PrivacyPolicyLink) { @@ -498,7 +498,7 @@ func (o *Config) SetDefaults() { if o.SupportSettings.PrivacyPolicyLink == nil { o.SupportSettings.PrivacyPolicyLink = new(string) - *o.SupportSettings.PrivacyPolicyLink = "/static/help/privacy.html" + *o.SupportSettings.PrivacyPolicyLink = "" } if !IsSafeLink(o.SupportSettings.AboutLink) { @@ -507,7 +507,7 @@ func (o *Config) SetDefaults() { if o.SupportSettings.AboutLink == nil { o.SupportSettings.AboutLink = new(string) - *o.SupportSettings.AboutLink = "/static/help/about.html" + *o.SupportSettings.AboutLink = "" } if !IsSafeLink(o.SupportSettings.HelpLink) { @@ -516,7 +516,7 @@ func (o *Config) SetDefaults() { if o.SupportSettings.HelpLink == nil { o.SupportSettings.HelpLink = new(string) - *o.SupportSettings.HelpLink = "/static/help/help.html" + *o.SupportSettings.HelpLink = "" } if !IsSafeLink(o.SupportSettings.ReportAProblemLink) { @@ -525,7 +525,7 @@ func (o *Config) SetDefaults() { if o.SupportSettings.ReportAProblemLink == nil { o.SupportSettings.ReportAProblemLink = new(string) - *o.SupportSettings.ReportAProblemLink = "/static/help/report_problem.html" + *o.SupportSettings.ReportAProblemLink = "" } if o.SupportSettings.SupportEmail == nil { diff --git a/webapp/components/header_footer_template.jsx b/webapp/components/header_footer_template.jsx index 8267c73c5..1c9591dbf 100644 --- a/webapp/components/header_footer_template.jsx +++ b/webapp/components/header_footer_template.jsx @@ -16,6 +16,64 @@ export default class NotLoggedIn extends React.Component { $('#root').removeClass('container-fluid'); } render() { + let content = []; + + if (global.window.mm_config.HelpLink) { + content.push( + + + + ); + } + + if (global.window.mm_config.TermsOfServiceLink) { + content.push( + + + + ); + } + + if (global.window.mm_config.PrivacyPolicyLink) { + content.push( + + + + ); + } + + if (global.window.mm_config.AboutLink) { + content.push( + + + + ); + } + return (
@@ -29,42 +87,7 @@ export default class NotLoggedIn extends React.Component {
{'© 2015-2016 Mattermost, Inc.'} - - - - - - - - - - - - + {content}
-- cgit v1.2.3-1-g7c22