Merge release branch 'release-1.0.0'
Этот коммит содержится в:
@@ -12,7 +12,7 @@ export default class GitLabSettings extends React.Component {
|
||||
this.handleSubmit = this.handleSubmit.bind(this);
|
||||
|
||||
this.state = {
|
||||
Allow: this.props.config.GitLabSettings.Allow,
|
||||
Enable: this.props.config.GitLabSettings.Enable,
|
||||
saveNeeded: false,
|
||||
serverError: null
|
||||
};
|
||||
@@ -21,12 +21,12 @@ export default class GitLabSettings extends React.Component {
|
||||
handleChange(action) {
|
||||
var s = {saveNeeded: true, serverError: this.state.serverError};
|
||||
|
||||
if (action === 'AllowTrue') {
|
||||
s.Allow = true;
|
||||
if (action === 'EnableTrue') {
|
||||
s.Enable = true;
|
||||
}
|
||||
|
||||
if (action === 'AllowFalse') {
|
||||
s.Allow = false;
|
||||
if (action === 'EnableFalse') {
|
||||
s.Enable = false;
|
||||
}
|
||||
|
||||
this.setState(s);
|
||||
@@ -37,7 +37,7 @@ export default class GitLabSettings extends React.Component {
|
||||
$('#save-button').button('loading');
|
||||
|
||||
var config = this.props.config;
|
||||
config.GitLabSettings.Allow = React.findDOMNode(this.refs.Allow).checked;
|
||||
config.GitLabSettings.Enable = React.findDOMNode(this.refs.Enable).checked;
|
||||
config.GitLabSettings.Secret = React.findDOMNode(this.refs.Secret).value.trim();
|
||||
config.GitLabSettings.Id = React.findDOMNode(this.refs.Id).value.trim();
|
||||
config.GitLabSettings.AuthEndpoint = React.findDOMNode(this.refs.AuthEndpoint).value.trim();
|
||||
@@ -87,7 +87,7 @@ export default class GitLabSettings extends React.Component {
|
||||
<div className='form-group'>
|
||||
<label
|
||||
className='control-label col-sm-4'
|
||||
htmlFor='Allow'
|
||||
htmlFor='Enable'
|
||||
>
|
||||
{'Enable Sign Up With GitLab: '}
|
||||
</label>
|
||||
@@ -95,21 +95,21 @@ export default class GitLabSettings extends React.Component {
|
||||
<label className='radio-inline'>
|
||||
<input
|
||||
type='radio'
|
||||
name='Allow'
|
||||
name='Enable'
|
||||
value='true'
|
||||
ref='Allow'
|
||||
defaultChecked={this.props.config.GitLabSettings.Allow}
|
||||
onChange={this.handleChange.bind(this, 'AllowTrue')}
|
||||
ref='Enable'
|
||||
defaultChecked={this.props.config.GitLabSettings.Enable}
|
||||
onChange={this.handleChange.bind(this, 'EnableTrue')}
|
||||
/>
|
||||
{'true'}
|
||||
</label>
|
||||
<label className='radio-inline'>
|
||||
<input
|
||||
type='radio'
|
||||
name='Allow'
|
||||
name='Enable'
|
||||
value='false'
|
||||
defaultChecked={!this.props.config.GitLabSettings.Allow}
|
||||
onChange={this.handleChange.bind(this, 'AllowFalse')}
|
||||
defaultChecked={!this.props.config.GitLabSettings.Enable}
|
||||
onChange={this.handleChange.bind(this, 'EnableFalse')}
|
||||
/>
|
||||
{'false'}
|
||||
</label>
|
||||
@@ -133,7 +133,7 @@ export default class GitLabSettings extends React.Component {
|
||||
placeholder='Ex "jcuS8PuvcpGhpgHhlcpT1Mx42pnqMxQY"'
|
||||
defaultValue={this.props.config.GitLabSettings.Id}
|
||||
onChange={this.handleChange}
|
||||
disabled={!this.state.Allow}
|
||||
disabled={!this.state.Enable}
|
||||
/>
|
||||
<p className='help-text'>{'Obtain this value via the instructions above for logging into GitLab'}</p>
|
||||
</div>
|
||||
@@ -155,7 +155,7 @@ export default class GitLabSettings extends React.Component {
|
||||
placeholder='Ex "jcuS8PuvcpGhpgHhlcpT1Mx42pnqMxQY"'
|
||||
defaultValue={this.props.config.GitLabSettings.Secret}
|
||||
onChange={this.handleChange}
|
||||
disabled={!this.state.Allow}
|
||||
disabled={!this.state.Enable}
|
||||
/>
|
||||
<p className='help-text'>{'Obtain this value via the instructions above for logging into GitLab.'}</p>
|
||||
</div>
|
||||
@@ -177,7 +177,7 @@ export default class GitLabSettings extends React.Component {
|
||||
placeholder='Ex ""'
|
||||
defaultValue={this.props.config.GitLabSettings.AuthEndpoint}
|
||||
onChange={this.handleChange}
|
||||
disabled={!this.state.Allow}
|
||||
disabled={!this.state.Enable}
|
||||
/>
|
||||
<p className='help-text'>{'Enter <your-gitlab-url>/oauth/authorize (example http://localhost:3000/oauth/authorize). Make sure you use HTTP or HTTPS in your URLs as appropriate.'}</p>
|
||||
</div>
|
||||
@@ -199,7 +199,7 @@ export default class GitLabSettings extends React.Component {
|
||||
placeholder='Ex ""'
|
||||
defaultValue={this.props.config.GitLabSettings.TokenEndpoint}
|
||||
onChange={this.handleChange}
|
||||
disabled={!this.state.Allow}
|
||||
disabled={!this.state.Enable}
|
||||
/>
|
||||
<p className='help-text'>{'Enter <your-gitlab-url>/oauth/token. Make sure you use HTTP or HTTPS in your URLs as appropriate.'}</p>
|
||||
</div>
|
||||
@@ -221,7 +221,7 @@ export default class GitLabSettings extends React.Component {
|
||||
placeholder='Ex ""'
|
||||
defaultValue={this.props.config.GitLabSettings.UserApiEndpoint}
|
||||
onChange={this.handleChange}
|
||||
disabled={!this.state.Allow}
|
||||
disabled={!this.state.Enable}
|
||||
/>
|
||||
<p className='help-text'>{'Enter <your-gitlab-url>/api/v3/user. Make sure you use HTTP or HTTPS in your URLs as appropriate.'}</p>
|
||||
</div>
|
||||
|
||||
@@ -388,7 +388,6 @@ export function toTitleCase(str) {
|
||||
export function applyTheme(theme) {
|
||||
if (theme.sidebarBg) {
|
||||
changeCss('.sidebar--left', 'background:' + theme.sidebarBg, 1);
|
||||
changeCss('@media(max-width: 768px){.search-bar__container', 'background:' + theme.sidebarBg, 1);
|
||||
}
|
||||
|
||||
if (theme.sidebarText) {
|
||||
@@ -423,6 +422,7 @@ export function applyTheme(theme) {
|
||||
changeCss('.sidebar--left .team__header, .sidebar--menu .team__header', 'background:' + theme.sidebarHeaderBg, 1);
|
||||
changeCss('.modal .modal-header', 'background:' + theme.sidebarHeaderBg, 1);
|
||||
changeCss('#navbar .navbar-default', 'background:' + theme.sidebarHeaderBg, 1);
|
||||
changeCss('@media(max-width: 768px){.search-bar__container', 'background:' + theme.sidebarHeaderBg, 1);
|
||||
}
|
||||
|
||||
if (theme.sidebarHeaderTextColor) {
|
||||
@@ -430,8 +430,9 @@ export function applyTheme(theme) {
|
||||
changeCss('.sidebar--left .team__header .user__name, .sidebar--menu .team__header .user__name', 'color:' + changeOpacity(theme.sidebarHeaderTextColor, 0.8), 1);
|
||||
changeCss('.sidebar--left .team__header:hover .user__name, .sidebar--menu .team__header:hover .user__name', 'color:' + theme.sidebarHeaderTextColor, 1);
|
||||
changeCss('.modal .modal-header .modal-title, .modal .modal-header .modal-title .name, .modal .modal-header button.close', 'color:' + theme.sidebarHeaderTextColor, 1);
|
||||
changeCss('#navbar .navbar-default .navbar-brand .heading, ', 'color:' + theme.sidebarHeaderTextColor, 1);
|
||||
changeCss('#navbar .navbar-default .navbar-brand .heading', 'color:' + theme.sidebarHeaderTextColor, 1);
|
||||
changeCss('#navbar .navbar-default .navbar-toggle .icon-bar, ', 'background:' + theme.sidebarHeaderTextColor, 1);
|
||||
changeCss('@media(max-width: 768px){.search-bar__container', 'color:' + theme.sidebarHeaderTextColor, 2);
|
||||
}
|
||||
|
||||
if (theme.onlineIndicator) {
|
||||
@@ -452,7 +453,6 @@ export function applyTheme(theme) {
|
||||
changeCss('.app__content, .markdown__table, .markdown__table tbody tr, .command-box', 'background:' + theme.centerChannelBg, 1);
|
||||
changeCss('#post-list .post-list-holder-by-time', 'background:' + theme.centerChannelBg, 1);
|
||||
changeCss('#post-create', 'background:' + theme.centerChannelBg, 1);
|
||||
changeCss('.search-bar__container .search__form .search-bar', 'background:' + theme.centerChannelBg, 1);
|
||||
changeCss('.date-separator .separator__text, .new-separator .separator__text', 'background:' + theme.centerChannelBg, 1);
|
||||
changeCss('.post-image__column .post-image__details', 'background:' + theme.centerChannelBg, 1);
|
||||
changeCss('.sidebar--right', 'background:' + theme.centerChannelBg, 1);
|
||||
@@ -475,7 +475,7 @@ export function applyTheme(theme) {
|
||||
changeCss('.post-image__column', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 2);
|
||||
changeCss('.post-image__column .post-image__details', 'color:' + theme.centerChannelColor, 2);
|
||||
changeCss('.post-image__column a, .post-image__column a:hover, .post-image__column a:focus', 'color:' + theme.centerChannelColor, 1);
|
||||
changeCss('.search-bar__container .search__form .search-bar', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2) + '; color: ' + theme.centerChannelColor, 2);
|
||||
changeCss('.search-bar__container .search__form .search-bar', 'background:' + changeOpacity(theme.centerChannelColor, 0.2), 1);
|
||||
changeCss('.search-bar__container .search__form', 'border-color:' + changeOpacity(theme.centerChannelColor, 0.2), 1);
|
||||
changeCss('.channel-intro .channel-intro__content', 'background:' + changeOpacity(theme.centerChannelColor, 0.05), 1);
|
||||
changeCss('.date-separator .separator__text', 'color:' + theme.centerChannelColor, 2);
|
||||
@@ -512,7 +512,6 @@ export function applyTheme(theme) {
|
||||
changeCss('.btn.btn-primary', 'color:' + theme.buttonColor, 2);
|
||||
}
|
||||
}
|
||||
|
||||
export function changeCss(className, classValue, classRepeat) {
|
||||
// we need invisible container to store additional css definitions
|
||||
var cssMainContainer = $('#css-modifier-container');
|
||||
|
||||
Ссылка в новой задаче
Block a user