Added custom branding to login description (#3710)

Этот коммит содержится в:
David Lu
2016-08-02 08:34:34 -04:00
коммит произвёл Joram Wilander
родитель 42e74b509d
Коммит 2c23a4fe49
9 изменённых файлов: 91 добавлений и 14 удалений

Просмотреть файл

@@ -37,6 +37,7 @@
"RestrictTeamNames": true, "RestrictTeamNames": true,
"EnableCustomBrand": false, "EnableCustomBrand": false,
"CustomBrandText": "", "CustomBrandText": "",
"CustomDescriptionText": "",
"RestrictDirectMessage": "any", "RestrictDirectMessage": "any",
"RestrictTeamInvite": "all", "RestrictTeamInvite": "all",
"RestrictPublicChannelManagement": "all", "RestrictPublicChannelManagement": "all",

Просмотреть файл

@@ -192,6 +192,7 @@ type TeamSettings struct {
RestrictTeamNames *bool RestrictTeamNames *bool
EnableCustomBrand *bool EnableCustomBrand *bool
CustomBrandText *string CustomBrandText *string
CustomDescriptionText *string
RestrictDirectMessage *string RestrictDirectMessage *string
RestrictTeamInvite *string RestrictTeamInvite *string
RestrictPublicChannelManagement *string RestrictPublicChannelManagement *string
@@ -422,6 +423,11 @@ func (o *Config) SetDefaults() {
*o.TeamSettings.CustomBrandText = "" *o.TeamSettings.CustomBrandText = ""
} }
if o.TeamSettings.CustomDescriptionText == nil {
o.TeamSettings.CustomDescriptionText = new(string)
*o.TeamSettings.CustomDescriptionText = ""
}
if o.TeamSettings.EnableOpenServer == nil { if o.TeamSettings.EnableOpenServer == nil {
o.TeamSettings.EnableOpenServer = new(bool) o.TeamSettings.EnableOpenServer = new(bool)
*o.TeamSettings.EnableOpenServer = false *o.TeamSettings.EnableOpenServer = false

Просмотреть файл

@@ -271,6 +271,7 @@ func getClientConfig(c *model.Config) map[string]string {
if *License.Features.CustomBrand { if *License.Features.CustomBrand {
props["EnableCustomBrand"] = strconv.FormatBool(*c.TeamSettings.EnableCustomBrand) props["EnableCustomBrand"] = strconv.FormatBool(*c.TeamSettings.EnableCustomBrand)
props["CustomBrandText"] = *c.TeamSettings.CustomBrandText props["CustomBrandText"] = *c.TeamSettings.CustomBrandText
props["CustomDescriptionText"] = *c.TeamSettings.CustomDescriptionText
} }
if *License.Features.LDAP { if *License.Features.LDAP {

Просмотреть файл

@@ -27,6 +27,7 @@ export default class CustomBrandSettings extends AdminSettings {
if (global.window.mm_license.IsLicensed === 'true' && global.window.mm_license.CustomBrand === 'true') { if (global.window.mm_license.IsLicensed === 'true' && global.window.mm_license.CustomBrand === 'true') {
config.TeamSettings.EnableCustomBrand = this.state.enableCustomBrand; config.TeamSettings.EnableCustomBrand = this.state.enableCustomBrand;
config.TeamSettings.CustomBrandText = this.state.customBrandText; config.TeamSettings.CustomBrandText = this.state.customBrandText;
config.TeamSettings.customDescriptionText = this.state.customDescriptionText;
} }
return config; return config;
@@ -36,7 +37,8 @@ export default class CustomBrandSettings extends AdminSettings {
return { return {
siteName: config.TeamSettings.SiteName, siteName: config.TeamSettings.SiteName,
enableCustomBrand: config.TeamSettings.EnableCustomBrand, enableCustomBrand: config.TeamSettings.EnableCustomBrand,
customBrandText: config.TeamSettings.CustomBrandText customBrandText: config.TeamSettings.CustomBrandText,
customDescriptionText: config.TeamSettings.CustomDescriptionText
}; };
} }
@@ -104,6 +106,30 @@ export default class CustomBrandSettings extends AdminSettings {
disabled={!this.state.enableCustomBrand} disabled={!this.state.enableCustomBrand}
/> />
); );
enterpriseSettings.push(
<TextSetting
key='customDescriptionText'
id='customDescriptionText'
type='textarea'
label={
<FormattedMessage
id='admin.team.brandDescriptionTitle'
defaultMessage='Site Description'
/>
}
helpText={
<FormattedMessage
id='admin.team.brandDescriptionHelp'
defaultMessage='Description of service shown in login screens and UI.'
/>
}
value={this.state.customDescriptionText}
placeholder={Utils.localizeMessage('web.root.signup_info', 'All team communication in one place, searchable and accessible anywhere')}
onChange={this.handleChange}
disabled={!this.state.enableCustomBrand}
/>
);
} }
return ( return (

Просмотреть файл

@@ -35,6 +35,18 @@ export default class CreateTeamController extends React.Component {
} }
render() { render() {
let description = null;
if (global.window.mm_license.IsLicensed === 'true' && global.window.mm_license.CustomBrand === 'true' && global.window.mm_config.EnableCustomBrand === 'true') {
description = global.window.mm_config.CustomDescriptionText;
} else {
description = (
<FormattedMessage
id='web.root.signup_info'
defaultMessage='All team communication in one place, searchable and accessible anywhere'
/>
);
}
return ( return (
<div> <div>
<ErrorBar/> <ErrorBar/>
@@ -50,9 +62,7 @@ export default class CreateTeamController extends React.Component {
<div className='signup-team__container'> <div className='signup-team__container'>
<h1>{global.window.mm_config.SiteName}</h1> <h1>{global.window.mm_config.SiteName}</h1>
<h4 className='color--light'> <h4 className='color--light'>
<FormattedMessage {description}
id='web.root.singup_info'
/>
</h4> </h4>
<div className='signup__content'> <div className='signup__content'>
{React.cloneElement(this.props.children, { {React.cloneElement(this.props.children, {

Просмотреть файл

@@ -549,6 +549,18 @@ export default class LoginController extends React.Component {
} }
} }
let description = null;
if (global.window.mm_license.IsLicensed === 'true' && global.window.mm_license.CustomBrand === 'true' && global.window.mm_config.EnableCustomBrand === 'true') {
description = global.window.mm_config.CustomDescriptionText;
} else {
description = (
<FormattedMessage
id='web.root.signup_info'
defaultMessage='All team communication in one place, searchable and accessible anywhere'
/>
);
}
return ( return (
<div> <div>
<ErrorBar/> <ErrorBar/>
@@ -564,9 +576,7 @@ export default class LoginController extends React.Component {
<div className='signup__content'> <div className='signup__content'>
<h1>{global.window.mm_config.SiteName}</h1> <h1>{global.window.mm_config.SiteName}</h1>
<h4 className='color--light'> <h4 className='color--light'>
<FormattedMessage {description}
id='web.root.singup_info'
/>
</h4> </h4>
{content} {content}
</div> </div>

Просмотреть файл

@@ -212,6 +212,18 @@ export default class SelectTeam extends React.Component {
); );
} }
let description = null;
if (global.window.mm_license.IsLicensed === 'true' && global.window.mm_license.CustomBrand === 'true' && global.window.mm_config.EnableCustomBrand === 'true') {
description = global.window.mm_config.CustomDescriptionText;
} else {
description = (
<FormattedMessage
id='web.root.signup_info'
defaultMessage='All team communication in one place, searchable and accessible anywhere'
/>
);
}
return ( return (
<div> <div>
<ErrorBar/> <ErrorBar/>
@@ -234,9 +246,7 @@ export default class SelectTeam extends React.Component {
/> />
<h1>{global.window.mm_config.SiteName}</h1> <h1>{global.window.mm_config.SiteName}</h1>
<h4 className='color--light'> <h4 className='color--light'>
<FormattedMessage {description}
id='web.root.singup_info'
/>
</h4> </h4>
{content} {content}
{openContent} {openContent}

Просмотреть файл

@@ -765,6 +765,18 @@ export default class SignupUserComplete extends React.Component {
ldapSignup = null; ldapSignup = null;
} }
let description = null;
if (global.window.mm_license.IsLicensed === 'true' && global.window.mm_license.CustomBrand === 'true' && global.window.mm_config.EnableCustomBrand === 'true') {
description = global.window.mm_config.CustomDescriptionText;
} else {
description = (
<FormattedMessage
id='web.root.signup_info'
defaultMessage='All team communication in one place, searchable and accessible anywhere'
/>
);
}
return ( return (
<div> <div>
<div className='signup-header'> <div className='signup-header'>
@@ -783,9 +795,7 @@ export default class SignupUserComplete extends React.Component {
/> />
<h1>{global.window.mm_config.SiteName}</h1> <h1>{global.window.mm_config.SiteName}</h1>
<h4 className='color--light'> <h4 className='color--light'>
<FormattedMessage {description}
id='web.root.singup_info'
/>
</h4> </h4>
<h4 className='color--light'> <h4 className='color--light'>
<FormattedMessage <FormattedMessage

Просмотреть файл

@@ -691,6 +691,9 @@
"admin.team.brandTextDescription": "The custom branding Markdown-formatted text you would like to appear below your custom brand image on your login screen.", "admin.team.brandTextDescription": "The custom branding Markdown-formatted text you would like to appear below your custom brand image on your login screen.",
"admin.team.brandTextTitle": "Custom Brand Text:", "admin.team.brandTextTitle": "Custom Brand Text:",
"admin.team.brandTitle": "Enable Custom Branding: ", "admin.team.brandTitle": "Enable Custom Branding: ",
"admin.team.brandDescriptionTitle": "Site Description",
"admin.team.brandDescriptionHelp": "Description of service shown in login screens and UI.",
"admin.team.brandDescriptionExample": "All team communication in one place, searchable and accessible anywhere",
"admin.team.chooseImage": "Choose New Image", "admin.team.chooseImage": "Choose New Image",
"admin.team.dirDesc": "When true, teams that are configured to show in team directory will show on main page inplace of creating a new team.", "admin.team.dirDesc": "When true, teams that are configured to show in team directory will show on main page inplace of creating a new team.",
"admin.team.dirTitle": "Enable Team Directory: ", "admin.team.dirTitle": "Enable Team Directory: ",
@@ -1748,6 +1751,6 @@
"web.footer.privacy": "Privacy", "web.footer.privacy": "Privacy",
"web.footer.terms": "Terms", "web.footer.terms": "Terms",
"web.header.back": "Back", "web.header.back": "Back",
"web.root.singup_info": "All team communication in one place, searchable and accessible anywhere", "web.root.signup_info": "All team communication in one place, searchable and accessible anywhere",
"youtube_video.notFound": "Video not found" "youtube_video.notFound": "Video not found"
} }