|
@@ -39,10 +39,10 @@ class GoogleSecurityManagement extends React.Component {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async onClickSubmit() {
|
|
async onClickSubmit() {
|
|
|
- const { t, adminGeneralSecurityContainer, adminGoogleSecurityContainer } = this.props;
|
|
|
|
|
|
|
+ const { t, adminGoogleSecurityContainer } = this.props;
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- await adminGoogleSecurityContainer.updateGoogleSetting(adminGeneralSecurityContainer.state.isGoogleOAuthEnabled);
|
|
|
|
|
|
|
+ await adminGoogleSecurityContainer.updateGoogleSetting();
|
|
|
toastSuccess(t('security_setting.OAuth.Google.updated_google'));
|
|
toastSuccess(t('security_setting.OAuth.Google.updated_google'));
|
|
|
}
|
|
}
|
|
|
catch (err) {
|
|
catch (err) {
|
|
@@ -58,17 +58,17 @@ class GoogleSecurityManagement extends React.Component {
|
|
|
<React.Fragment>
|
|
<React.Fragment>
|
|
|
|
|
|
|
|
<h2 className="alert-anchor border-bottom">
|
|
<h2 className="alert-anchor border-bottom">
|
|
|
- { t('security_setting.OAuth.Google.name') } { t('security_setting.configuration') }
|
|
|
|
|
|
|
+ {t('security_setting.OAuth.Google.name')} {t('security_setting.configuration')}
|
|
|
</h2>
|
|
</h2>
|
|
|
|
|
|
|
|
{this.state.retrieveError != null && (
|
|
{this.state.retrieveError != null && (
|
|
|
- <div className="alert alert-danger">
|
|
|
|
|
- <p>{t('Error occurred')} : {this.state.err}</p>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div className="alert alert-danger">
|
|
|
|
|
+ <p>{t('Error occurred')} : {this.state.err}</p>
|
|
|
|
|
+ </div>
|
|
|
)}
|
|
)}
|
|
|
|
|
|
|
|
<div className="row mb-5">
|
|
<div className="row mb-5">
|
|
|
- <strong className="col-xs-3 text-right">{ t('security_setting.OAuth.Google.name') }</strong>
|
|
|
|
|
|
|
+ <strong className="col-xs-3 text-right">{t('security_setting.OAuth.Google.name')}</strong>
|
|
|
<div className="col-xs-6 text-left">
|
|
<div className="col-xs-6 text-left">
|
|
|
<div className="checkbox checkbox-success">
|
|
<div className="checkbox checkbox-success">
|
|
|
<input
|
|
<input
|
|
@@ -78,14 +78,14 @@ class GoogleSecurityManagement extends React.Component {
|
|
|
onChange={() => { adminGeneralSecurityContainer.switchIsGoogleOAuthEnabled() }}
|
|
onChange={() => { adminGeneralSecurityContainer.switchIsGoogleOAuthEnabled() }}
|
|
|
/>
|
|
/>
|
|
|
<label htmlFor="isGoogleEnabled">
|
|
<label htmlFor="isGoogleEnabled">
|
|
|
- { t('security_setting.OAuth.Google.enable_google') }
|
|
|
|
|
|
|
+ {t('security_setting.OAuth.Google.enable_google')}
|
|
|
</label>
|
|
</label>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div className="row mb-5">
|
|
<div className="row mb-5">
|
|
|
- <label className="col-xs-3 text-right">{ t('security_setting.callback_URL') }</label>
|
|
|
|
|
|
|
+ <label className="col-xs-3 text-right">{t('security_setting.callback_URL')}</label>
|
|
|
<div className="col-xs-6">
|
|
<div className="col-xs-6">
|
|
|
<input
|
|
<input
|
|
|
className="form-control"
|
|
className="form-control"
|
|
@@ -93,15 +93,15 @@ class GoogleSecurityManagement extends React.Component {
|
|
|
value={adminGoogleSecurityContainer.state.callbackUrl}
|
|
value={adminGoogleSecurityContainer.state.callbackUrl}
|
|
|
readOnly
|
|
readOnly
|
|
|
/>
|
|
/>
|
|
|
- <p className="help-block small">{ t('security_setting.desc_of_callback_URL', { AuthName: 'OAuth' }) }</p>
|
|
|
|
|
|
|
+ <p className="help-block small">{t('security_setting.desc_of_callback_URL', { AuthName: 'OAuth' })}</p>
|
|
|
{!adminGeneralSecurityContainer.state.appSiteUrl && (
|
|
{!adminGeneralSecurityContainer.state.appSiteUrl && (
|
|
|
- <div className="alert alert-danger">
|
|
|
|
|
- <i
|
|
|
|
|
- className="icon-exclamation"
|
|
|
|
|
- // eslint-disable-next-line max-len
|
|
|
|
|
- dangerouslySetInnerHTML={{ __html: t('security_setting.alert_siteUrl_is_not_set', { link: `<a href="/admin/app">${t('App settings')}<i class="icon-login"></i></a>` }) }}
|
|
|
|
|
- />
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div className="alert alert-danger">
|
|
|
|
|
+ <i
|
|
|
|
|
+ className="icon-exclamation"
|
|
|
|
|
+ // eslint-disable-next-line max-len
|
|
|
|
|
+ dangerouslySetInnerHTML={{ __html: t('security_setting.alert_siteUrl_is_not_set', { link: `<a href="/admin/app">${t('App settings')}<i class="icon-login"></i></a>` }) }}
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
)}
|
|
)}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -111,7 +111,7 @@ class GoogleSecurityManagement extends React.Component {
|
|
|
<React.Fragment>
|
|
<React.Fragment>
|
|
|
|
|
|
|
|
<div className="row mb-5">
|
|
<div className="row mb-5">
|
|
|
- <label htmlFor="googleClientId" className="col-xs-3 text-right">{ t('security_setting.clientID') }</label>
|
|
|
|
|
|
|
+ <label htmlFor="googleClientId" className="col-xs-3 text-right">{t('security_setting.clientID')}</label>
|
|
|
<div className="col-xs-6">
|
|
<div className="col-xs-6">
|
|
|
<input
|
|
<input
|
|
|
className="form-control"
|
|
className="form-control"
|
|
@@ -127,7 +127,7 @@ class GoogleSecurityManagement extends React.Component {
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div className="row mb-5">
|
|
<div className="row mb-5">
|
|
|
- <label htmlFor="googleClientSecret" className="col-xs-3 text-right">{ t('security_setting.client_secret') }</label>
|
|
|
|
|
|
|
+ <label htmlFor="googleClientSecret" className="col-xs-3 text-right">{t('security_setting.client_secret')}</label>
|
|
|
<div className="col-xs-6">
|
|
<div className="col-xs-6">
|
|
|
<input
|
|
<input
|
|
|
className="form-control"
|
|
className="form-control"
|
|
@@ -167,7 +167,7 @@ class GoogleSecurityManagement extends React.Component {
|
|
|
|
|
|
|
|
<div className="row my-3">
|
|
<div className="row my-3">
|
|
|
<div className="col-xs-offset-3 col-xs-5">
|
|
<div className="col-xs-offset-3 col-xs-5">
|
|
|
- <button type="button" className="btn btn-primary" disabled={this.state.retrieveError != null} onClick={this.onClickSubmit}>{ t('Update') }</button>
|
|
|
|
|
|
|
+ <button type="button" className="btn btn-primary" disabled={this.state.retrieveError != null} onClick={this.onClickSubmit}>{t('Update')}</button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -176,15 +176,15 @@ class GoogleSecurityManagement extends React.Component {
|
|
|
<div style={{ minHeight: '300px' }}>
|
|
<div style={{ minHeight: '300px' }}>
|
|
|
<h4>
|
|
<h4>
|
|
|
<i className="icon-question" aria-hidden="true"></i>
|
|
<i className="icon-question" aria-hidden="true"></i>
|
|
|
- <a href="#collapseHelpForGoogleOauth" data-toggle="collapse"> { t('security_setting.OAuth.how_to.google') }</a>
|
|
|
|
|
|
|
+ <a href="#collapseHelpForGoogleOauth" data-toggle="collapse"> {t('security_setting.OAuth.how_to.google')}</a>
|
|
|
</h4>
|
|
</h4>
|
|
|
<ol id="collapseHelpForGoogleOauth" className="collapse">
|
|
<ol id="collapseHelpForGoogleOauth" className="collapse">
|
|
|
{/* eslint-disable-next-line max-len */}
|
|
{/* eslint-disable-next-line max-len */}
|
|
|
- <li dangerouslySetInnerHTML={{ __html: t('security_setting.OAuth.Google.register_1', { link: '<a href="https://console.cloud.google.com/apis/credentials" target=_blank>Google Cloud Platform API Manager</a>' }) }} />
|
|
|
|
|
- <li dangerouslySetInnerHTML={{ __html: t('security_setting.OAuth.Google.register_2') }} />
|
|
|
|
|
- <li dangerouslySetInnerHTML={{ __html: t('security_setting.OAuth.Google.register_3') }} />
|
|
|
|
|
- <li dangerouslySetInnerHTML={{ __html: t('security_setting.OAuth.Google.register_4', { url: adminGoogleSecurityContainer.state.callbackUrl }) }} />
|
|
|
|
|
- <li dangerouslySetInnerHTML={{ __html: t('security_setting.OAuth.Google.register_5') }} />
|
|
|
|
|
|
|
+ <li dangerouslySetInnerHTML={{ __html: t('security_setting.OAuth.Google.register_1', { link: '<a href="https://console.cloud.google.com/apis/credentials" target=_blank>Google Cloud Platform API Manager</a>' }) }} />
|
|
|
|
|
+ <li dangerouslySetInnerHTML={{ __html: t('security_setting.OAuth.Google.register_2') }} />
|
|
|
|
|
+ <li dangerouslySetInnerHTML={{ __html: t('security_setting.OAuth.Google.register_3') }} />
|
|
|
|
|
+ <li dangerouslySetInnerHTML={{ __html: t('security_setting.OAuth.Google.register_4', { url: adminGoogleSecurityContainer.state.callbackUrl }) }} />
|
|
|
|
|
+ <li dangerouslySetInnerHTML={{ __html: t('security_setting.OAuth.Google.register_5') }} />
|
|
|
</ol>
|
|
</ol>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|