itizawa 6 лет назад
Родитель
Сommit
5d699b31f7

+ 1 - 0
resource/locales/en-US/translation.json

@@ -550,6 +550,7 @@
       "register": "Register for %s",
       "register": "Register for %s",
       "change_redirect_url": "Enter <code>%s</code> <br>(where <code>%s</code> is your host name) for \"Authorized redirect URIs\".",
       "change_redirect_url": "Enter <code>%s</code> <br>(where <code>%s</code> is your host name) for \"Authorized redirect URIs\".",
       "Google": {
       "Google": {
+        "enable_google":"enable Google OAuth",
         "name": "Google OAuth",
         "name": "Google OAuth",
         "register_1": "Access <a href=\"%s\" target=\"_blank\">%s</a>",
         "register_1": "Access <a href=\"%s\" target=\"_blank\">%s</a>",
         "register_2": "Create Project if no projects exist",
         "register_2": "Create Project if no projects exist",

+ 1 - 0
resource/locales/ja/translation.json

@@ -545,6 +545,7 @@
       "register": "%sに登録",
       "register": "%sに登録",
       "change_redirect_url": "承認済みのリダイレクトURLに、 <code>%s</code> を入力",
       "change_redirect_url": "承認済みのリダイレクトURLに、 <code>%s</code> を入力",
       "Google": {
       "Google": {
+        "enable_google":"Google OAuth を有効にする",
         "name": "Google OAuth",
         "name": "Google OAuth",
         "register_1": "<a href=\"%s\" target=\"_blank\">%s</a>へアクセス",
         "register_1": "<a href=\"%s\" target=\"_blank\">%s</a>へアクセス",
         "register_2": "プロジェクトがない場合はプロジェクトを作成",
         "register_2": "プロジェクトがない場合はプロジェクトを作成",

+ 32 - 4
src/client/js/components/Admin/Security/GoogleSecuritySetting.jsx

@@ -11,12 +11,40 @@ import AdminGeneralSecurityContainer from '../../../services/AdminGeneralSecurit
 class GoogleSecurityManagement extends React.Component {
 class GoogleSecurityManagement extends React.Component {
 
 
   render() {
   render() {
-    const { t } = this.props;
+    const { t, adminGeneralSecurityContainer } = this.props;
     return (
     return (
 
 
-      <h2 className="alert-anchor border-bottom">
-        { t('security_setting.OAuth.Google.name') } { t('security_setting.configuration') }
-      </h2>
+      <React.Fragment>
+
+        <h2 className="alert-anchor border-bottom">
+          { t('security_setting.OAuth.Google.name') } { t('security_setting.configuration') }
+        </h2>
+
+        <div className="row mb-5">
+          <strong className="col-xs-3 text-right">{ t('security_setting.OAuth.Google.name') }</strong>
+          <div className="col-xs-6 text-left">
+            <div className="checkbox checkbox-success">
+              <input
+                id="isGoogleEnabled"
+                type="checkbox"
+                checked={adminGeneralSecurityContainer.state.isGoogleOAuthEnabled}
+                onChange={() => { adminGeneralSecurityContainer.switchIsGoogleOAuthEnabled() }}
+              />
+              <label htmlFor="isGoogleEnabled">
+                { t('security_setting.OAuth.Google.enable_google') }
+              </label>
+            </div>
+          </div>
+        </div>
+
+        {adminGeneralSecurityContainer.state.isGoogleOAuthEnabled && (
+          // TODO
+          <p>option</p>
+        )}
+
+      </React.Fragment>
+
+
     );
     );
   }
   }
 
 

+ 8 - 0
src/client/js/services/AdminGeneralSecurityContainer.js

@@ -27,6 +27,7 @@ export default class AdminGeneralSecurityContainer extends Container {
       isSamlEnabled: true,
       isSamlEnabled: true,
       isOidcEnabled: true,
       isOidcEnabled: true,
       isBasicEnabled: true,
       isBasicEnabled: true,
+      isGoogleOAuthEnabled: true,
     };
     };
 
 
     this.init();
     this.init();
@@ -89,4 +90,11 @@ export default class AdminGeneralSecurityContainer extends Container {
     this.setState({ isBasicEnabled: !this.state.isBasicEnabled });
     this.setState({ isBasicEnabled: !this.state.isBasicEnabled });
   }
   }
 
 
+  /**
+   * Switch GoogleOAuth enabled
+   */
+  switchIsGoogleOAuthEnabled() {
+    this.setState({ isGoogleOAuthEnabled: !this.state.isGoogleOAuthEnabled });
+  }
+
 }
 }