Преглед изворни кода

Merge branch 'support/apply-bootstrap4' into support/adjust-modal-about-page-management

itizawa пре 6 година
родитељ
комит
cb1db2ff07
28 измењених фајлова са 114 додато и 116 уклоњено
  1. 1 1
      src/client/js/components/Admin/App/PluginSetting.jsx
  2. 1 1
      src/client/js/components/Admin/Customize/CustomizeFunctionOption.jsx
  3. 1 1
      src/client/js/components/Admin/Customize/CustomizeHighlightSetting.jsx
  4. 4 8
      src/client/js/components/Admin/ExportArchiveData/SelectCollectionsModal.jsx
  5. 1 2
      src/client/js/components/Admin/ImportData/GrowiArchive/ImportForm.jsx
  6. 2 4
      src/client/js/components/Admin/ImportDataPage.jsx
  7. 2 2
      src/client/js/components/Admin/MarkdownSetting/LineBreakForm.jsx
  8. 1 1
      src/client/js/components/Admin/MarkdownSetting/XssForm.jsx
  9. 1 1
      src/client/js/components/Admin/Notification/GlobalNotificationList.jsx
  10. 6 0
      src/client/js/components/Admin/Notification/ManageGlobalNotification.jsx
  11. 1 1
      src/client/js/components/Admin/Notification/SlackAppConfiguration.jsx
  12. 4 2
      src/client/js/components/Admin/Notification/TriggerEventCheckBox.jsx
  13. 2 2
      src/client/js/components/Admin/Security/BasicSecuritySetting.jsx
  14. 2 2
      src/client/js/components/Admin/Security/GitHubSecuritySetting.jsx
  15. 2 2
      src/client/js/components/Admin/Security/GoogleSecuritySetting.jsx
  16. 2 2
      src/client/js/components/Admin/Security/LdapSecuritySetting.jsx
  17. 1 1
      src/client/js/components/Admin/Security/LocalSecuritySetting.jsx
  18. 3 3
      src/client/js/components/Admin/Security/OidcSecuritySetting.jsx
  19. 3 3
      src/client/js/components/Admin/Security/SamlSecuritySetting.jsx
  20. 2 2
      src/client/js/components/Admin/Security/SecuritySetting.jsx
  21. 2 2
      src/client/js/components/Admin/Security/TwitterSecuritySetting.jsx
  22. 2 4
      src/client/js/components/Admin/UserGroupDetail/UserGroupDetailPage.jsx
  23. 1 2
      src/client/js/components/Admin/UserGroupDetail/UserGroupEditForm.jsx
  24. 3 3
      src/client/js/components/Admin/Users/UserInviteModal.jsx
  25. 1 1
      src/client/js/components/PageHistory/PageRevisionList.jsx
  26. 48 48
      src/server/routes/apiv3/security-setting.js
  27. 6 6
      src/server/views/modal/delete.html
  28. 9 9
      src/server/views/modal/rename.html

+ 1 - 1
src/client/js/components/Admin/App/PluginSetting.jsx

@@ -43,7 +43,7 @@ class PluginSetting extends React.Component {
 
         <div className="row form-group mb-5">
           <div className="offset-3 col-6 text-left">
-            <div className="custom-control custom-switch checkbox-success">
+            <div className="custom-control custom-switch custom-checkbox-success">
               <input
                 id="isEnabledPlugins"
                 className="custom-control-input"

+ 1 - 1
src/client/js/components/Admin/Customize/CustomizeFunctionOption.jsx

@@ -7,7 +7,7 @@ class CustomizeFunctionOption extends React.PureComponent {
   render() {
     return (
       <React.Fragment>
-        <div className="custom-control custom-switch checkbox-success">
+        <div className="custom-control custom-switch custom-checkbox-success">
           <input
             className="custom-control-input"
             type="checkbox"

+ 1 - 1
src/client/js/components/Admin/Customize/CustomizeHighlightSetting.jsx

@@ -114,7 +114,7 @@ class CustomizeHighlightSetting extends React.Component {
 
             <div className="form-group row">
               <div className="offset-3 col-6 text-left">
-                <div className="custom-control custom-switch checkbox-success">
+                <div className="custom-control custom-switch custom-checkbox-success">
                   <input
                     type="checkbox"
                     className="custom-control-input"

+ 4 - 8
src/client/js/components/Admin/ExportArchiveData/SelectCollectionsModal.jsx

@@ -192,30 +192,26 @@ class SelectCollectionsModal extends React.Component {
             </div>
             <div className="row mt-4">
               <div className="col-sm-12">
-                {/* FIXME: use something instead of <legend> */}
-                <legend>Page Collections</legend>
+                <h3 className="admin-setting-header">Page Collections</h3>
                 {this.renderGroups(GROUPS_PAGE)}
               </div>
             </div>
             <div className="row mt-4">
               <div className="col-sm-12">
-                {/* FIXME: use something instead of <legend> */}
-                <legend>User Collections</legend>
+                <h3 className="admin-setting-header">User Collections</h3>
                 {this.renderGroups(GROUPS_USER, 'danger')}
                 {this.renderWarnForUser()}
               </div>
             </div>
             <div className="row mt-4">
               <div className="col-sm-12">
-                {/* FIXME: use something instead of <legend> */}
-                <legend>Config Collections</legend>
+                <h3 className="admin-setting-header">Config Collections</h3>
                 {this.renderGroups(GROUPS_CONFIG)}
               </div>
             </div>
             <div className="row mt-4">
               <div className="col-sm-12">
-                {/* FIXME: use something instead of <legend> */}
-                <legend>Other Collections</legend>
+                <h3 className="admin-setting-header">Other Collections</h3>
                 {this.renderOthers()}
               </div>
             </div>

+ 1 - 2
src/client/js/components/Admin/ImportData/GrowiArchive/ImportForm.jsx

@@ -345,8 +345,7 @@ class ImportForm extends React.Component {
     return (
       <div className="mt-4 row">
         <div className="col-12">
-          {/* FIXME: use something instead of <legend> */}
-          <legend>{groupName} Collections</legend>
+          <h3 className="admin-setting-header">{groupName} Collections</h3>
           { wellContent != null && (
             <div className="card well small" role="alert">
               <ul>

+ 2 - 4
src/client/js/components/Admin/ImportDataPage.jsx

@@ -143,8 +143,7 @@ class ImportDataPage extends React.Component {
           role="form"
         >
           <fieldset>
-            {/* FIXME: use something instead of <legend> */}
-            <legend>{t('admin:importer_management.import_from', { from: 'esa.io' })}</legend>
+            <h2 className="admin-setting-header">{t('admin:importer_management.import_from', { from: 'esa.io' })}</h2>
             <table className="table table-bordered table-mapping">
               <thead>
                 <tr>
@@ -234,8 +233,7 @@ class ImportDataPage extends React.Component {
           role="form"
         >
           <fieldset>
-            {/* FIXME: use something instead of <legend> */}
-            <legend>{t('admin:importer_management.import_from', { from: 'Qiita:Team' })}</legend>
+            <h2 className="admin-setting-header">{t('admin:importer_management.import_from', { from: 'Qiita:Team' })}</h2>
             <table className="table table-bordered table-mapping">
               <thead>
                 <tr>

+ 2 - 2
src/client/js/components/Admin/MarkdownSetting/LineBreakForm.jsx

@@ -46,7 +46,7 @@ class LineBreakForm extends React.Component {
     return (
       <div className="form-group text-left my-3">
         <div className="col-8 offset-4">
-          <div className="custom-control custom-switch checkbox-success">
+          <div className="custom-control custom-switch custom-checkbox-success">
             <input
               type="checkbox"
               className="custom-control-input"
@@ -73,7 +73,7 @@ class LineBreakForm extends React.Component {
     return (
       <div className="form-group text-left my-3">
         <div className="col-8 offset-4">
-          <div className="custom-control custom-switch checkbox-success">
+          <div className="custom-control custom-switch custom-checkbox-success">
             <input
               type="checkbox"
               className="custom-control-input"

+ 1 - 1
src/client/js/components/Admin/MarkdownSetting/XssForm.jsx

@@ -133,7 +133,7 @@ class XssForm extends React.Component {
         <fieldset className="col-12">
           <div className="form-group">
             <div className="col-8 offset-4 my-3">
-              <div className="custom-control custom-switch checkbox-success">
+              <div className="custom-control custom-switch custom-checkbox-success">
                 <input
                   type="checkbox"
                   className="custom-control-input"

+ 1 - 1
src/client/js/components/Admin/Notification/GlobalNotificationList.jsx

@@ -76,7 +76,7 @@ class GlobalNotificationList extends React.Component {
           return (
             <tr key={notification._id}>
               <td className="align-middle td-abs-center">
-                <div className="custom-control custom-switch checkbox-success">
+                <div className="custom-control custom-switch custom-checkbox-success">
                   <input
                     type="checkbox"
                     className="custom-control-input"

+ 6 - 0
src/client/js/components/Admin/Notification/ManageGlobalNotification.jsx

@@ -200,6 +200,7 @@ class ManageGlobalNotification extends React.Component {
             <div className="form-group">
               <h3>{t('notification_setting.trigger_events')}</h3>
               <TriggerEventCheckBox
+                checkbox="success"
                 event="pageCreate"
                 checked={this.state.triggerEvents.has('pageCreate')}
                 onChange={() => this.onChangeTriggerEvents('pageCreate')}
@@ -209,6 +210,7 @@ class ManageGlobalNotification extends React.Component {
                 </span>
               </TriggerEventCheckBox>
               <TriggerEventCheckBox
+                checkbox="warning"
                 event="pageEdit"
                 checked={this.state.triggerEvents.has('pageEdit')}
                 onChange={() => this.onChangeTriggerEvents('pageEdit')}
@@ -218,6 +220,7 @@ class ManageGlobalNotification extends React.Component {
                 </span>
               </TriggerEventCheckBox>
               <TriggerEventCheckBox
+                checkbox="warning"
                 event="pageMove"
                 checked={this.state.triggerEvents.has('pageMove')}
                 onChange={() => this.onChangeTriggerEvents('pageMove')}
@@ -227,6 +230,7 @@ class ManageGlobalNotification extends React.Component {
                 </span>
               </TriggerEventCheckBox>
               <TriggerEventCheckBox
+                checkbox="danger"
                 event="pageDelete"
                 checked={this.state.triggerEvents.has('pageDelete')}
                 onChange={() => this.onChangeTriggerEvents('pageDelete')}
@@ -236,6 +240,7 @@ class ManageGlobalNotification extends React.Component {
                 </span>
               </TriggerEventCheckBox>
               <TriggerEventCheckBox
+                checkbox="info"
                 event="pageLike"
                 checked={this.state.triggerEvents.has('pageLike')}
                 onChange={() => this.onChangeTriggerEvents('pageLike')}
@@ -245,6 +250,7 @@ class ManageGlobalNotification extends React.Component {
                 </span>
               </TriggerEventCheckBox>
               <TriggerEventCheckBox
+                checkbox="secondary"
                 event="comment"
                 checked={this.state.triggerEvents.has('comment')}
                 onChange={() => this.onChangeTriggerEvents('comment')}

+ 1 - 1
src/client/js/components/Admin/Notification/SlackAppConfiguration.jsx

@@ -77,7 +77,7 @@ class SlackAppConfiguration extends React.Component {
 
             <div className="row mb-3">
               <div className="offset-3 col-6 text-left">
-                <div className="custom-control custom-switch checkbox-success">
+                <div className="custom-control custom-switch custom-checkbox-success">
                   <input
                     type="checkbox"
                     className="custom-control-input"

+ 4 - 2
src/client/js/components/Admin/Notification/TriggerEventCheckBox.jsx

@@ -6,14 +6,15 @@ const TriggerEventCheckBox = (props) => {
   const { t } = props;
 
   return (
-    <div className="checkbox">
+    <div className={`custom-control custom-checkbox custom-checkbox-${props.checkbox}`}>
       <input
+        className="custom-control-input"
         type="checkbox"
         id={`trigger-event-${props.event}`}
         checked={props.checked}
         onChange={props.onChange}
       />
-      <label htmlFor={`trigger-event-${props.event}`}>
+      <label className="custom-control-label" htmlFor={`trigger-event-${props.event}`}>
         {props.children}{' '}
         {t(`notification_setting.event_${props.event}`)}
       </label>
@@ -25,6 +26,7 @@ const TriggerEventCheckBox = (props) => {
 TriggerEventCheckBox.propTypes = {
   t: PropTypes.func.isRequired, // i18next
 
+  checkbox: PropTypes.string.isRequired,
   checked: PropTypes.bool.isRequired,
   onChange: PropTypes.func.isRequired,
   event: PropTypes.string.isRequired,

+ 2 - 2
src/client/js/components/Admin/Security/BasicSecuritySetting.jsx

@@ -69,7 +69,7 @@ class BasicSecurityManagement extends React.Component {
 
         <div className="row mb-5">
           <div className="col-6 offset-3">
-            <div className="custom-control custom-switch checkbox-success">
+            <div className="custom-control custom-switch custom-checkbox-success">
               <input
                 id="isBasicEnabled"
                 className="custom-control-input"
@@ -96,7 +96,7 @@ class BasicSecurityManagement extends React.Component {
         <React.Fragment>
           <div className="row mb-5">
             <div className="offset-3 col-6">
-              <div className="custom-control custom-switch checkbox-success">
+              <div className="custom-control custom-switch custom-checkbox-success">
                 <input
                   id="bindByEmail-basic"
                   className="custom-control-input"

+ 2 - 2
src/client/js/components/Admin/Security/GitHubSecuritySetting.jsx

@@ -70,7 +70,7 @@ class GitHubSecurityManagement extends React.Component {
 
         <div className="row mb-5">
           <div className="offset-3 col-6 text-left">
-            <div className="custom-control custom-switch checkbox-success">
+            <div className="custom-control custom-switch custom-checkbox-success">
               <input
                 id="isGitHubEnabled"
                 className="custom-control-input"
@@ -149,7 +149,7 @@ class GitHubSecurityManagement extends React.Component {
 
             <div className="row mb-5">
               <div className="offset-3 col-6 text-left">
-                <div className="custom-control custom-switch checkbox-success">
+                <div className="custom-control custom-switch custom-checkbox-success">
                   <input
                     id="bindByUserNameGitHub"
                     className="custom-control-input"

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

@@ -70,7 +70,7 @@ class GoogleSecurityManagement extends React.Component {
 
         <div className="row mb-5">
           <div className="offset-3 col-6">
-            <div className="custom-control custom-switch checkbox-success">
+            <div className="custom-control custom-switch custom-checkbox-success">
               <input
                 id="isGoogleEnabled"
                 className="custom-control-input"
@@ -149,7 +149,7 @@ class GoogleSecurityManagement extends React.Component {
 
             <div className="row mb-5">
               <div className="offset-3 col-6">
-                <div className="custom-control custom-switch checkbox-success">
+                <div className="custom-control custom-switch custom-checkbox-success">
                   <input
                     id="bindByUserNameGoogle"
                     className="custom-control-input"

+ 2 - 2
src/client/js/components/Admin/Security/LdapSecuritySetting.jsx

@@ -75,7 +75,7 @@ class LdapSecuritySetting extends React.Component {
 
         <div className="row mb-5">
           <div className="col-6 offset-3">
-            <div className="custom-control custom-switch checkbox-success">
+            <div className="custom-control custom-switch custom-checkbox-success">
               <input
                 id="isLdapEnabled"
                 className="custom-control-input"
@@ -275,7 +275,7 @@ class LdapSecuritySetting extends React.Component {
 
             <div className="row mb-5">
               <div className="offset-3 col-6">
-                <div className="custom-control custom-switch checkbox-success">
+                <div className="custom-control custom-switch custom-checkbox-success">
                   <input
                     type="checkbox"
                     className="custom-control-input"

+ 1 - 1
src/client/js/components/Admin/Security/LocalSecuritySetting.jsx

@@ -76,7 +76,7 @@ class LocalSecuritySetting extends React.Component {
 
         <div className="row mb-5">
           <div className="col-6 offset-3">
-            <div className="custom-control custom-switch checkbox-success">
+            <div className="custom-control custom-switch custom-checkbox-success">
               <input
                 type="checkbox"
                 className="custom-control-input"

+ 3 - 3
src/client/js/components/Admin/Security/OidcSecuritySetting.jsx

@@ -65,7 +65,7 @@ class OidcSecurityManagement extends React.Component {
 
         <div className="row mb-5">
           <div className="offset-3 col-6">
-            <div className="custom-control custom-switch checkbox-success">
+            <div className="custom-control custom-switch custom-checkbox-success">
               <input
                 id="isOidcEnabled"
                 className="custom-control-input"
@@ -262,7 +262,7 @@ class OidcSecurityManagement extends React.Component {
 
             <div className="row mb-3">
               <div className="offset-3 col-6">
-                <div className="custom-control custom-switch checkbox-success">
+                <div className="custom-control custom-switch custom-checkbox-success">
                   <input
                     id="bindByUserName-oidc"
                     className="custom-control-input"
@@ -284,7 +284,7 @@ class OidcSecurityManagement extends React.Component {
 
             <div className="row mb-5">
               <div className="offset-3 col-6">
-                <div className="custom-control custom-switch checkbox-success">
+                <div className="custom-control custom-switch custom-checkbox-success">
                   <input
                     id="bindByEmail-oidc"
                     className="custom-control-input"

+ 3 - 3
src/client/js/components/Admin/Security/SamlSecuritySetting.jsx

@@ -91,7 +91,7 @@ class SamlSecurityManagement extends React.Component {
 
         <div className="row mb-5">
           <div className="col-6 offset-3">
-            <div className="custom-control custom-switch checkbox-success">
+            <div className="custom-control custom-switch custom-checkbox-success">
               <input
                 id="isSamlEnabled"
                 className="custom-control-input"
@@ -422,7 +422,7 @@ pWVdnzS1VCO8fKsJ7YYIr+JmHvseph3kFUOI5RqkCcMZlKUv83aUThsTHw==
 
             <div className="row mb-5">
               <div className="offset-3 col-6 text-left">
-                <div className="custom-control custom-switch checkbox-success">
+                <div className="custom-control custom-switch custom-checkbox-success">
                   <input
                     id="bindByUserName-SAML"
                     className="custom-control-input"
@@ -444,7 +444,7 @@ pWVdnzS1VCO8fKsJ7YYIr+JmHvseph3kFUOI5RqkCcMZlKUv83aUThsTHw==
 
             <div className="row mb-5">
               <div className="offset-3 col-6 text-left">
-                <div className="custom-control custom-switch checkbox-success">
+                <div className="custom-control custom-switch custom-checkbox-success">
                   <input
                     id="bindByEmail-SAML"
                     className="custom-control-input"

+ 2 - 2
src/client/js/components/Admin/Security/SecuritySetting.jsx

@@ -104,7 +104,7 @@ class SecuritySetting extends React.Component {
         <div className="row mb-5">
           <strong className="col-3 text-right" dangerouslySetInnerHTML={{ __html: t('security_setting.page_listing_1') }} />
           <div className="col-6">
-            <div className="custom-control custom-switch checkbox-success">
+            <div className="custom-control custom-switch custom-checkbox-success">
               <input
                 type="checkbox"
                 className="custom-control-input"
@@ -122,7 +122,7 @@ class SecuritySetting extends React.Component {
         <div className="row mb-5">
           <strong className="col-3 text-right" dangerouslySetInnerHTML={{ __html: t('security_setting.page_listing_2') }} />
           <div className="col-6">
-            <div className="custom-control custom-switch checkbox-success">
+            <div className="custom-control custom-switch custom-checkbox-success">
               <input
                 type="checkbox"
                 className="custom-control-input"

+ 2 - 2
src/client/js/components/Admin/Security/TwitterSecuritySetting.jsx

@@ -70,7 +70,7 @@ class TwitterSecurityManagement extends React.Component {
 
         <div className="row mb-5">
           <div className="offset-3 col-6">
-            <div className="custom-control custom-switch checkbox-success">
+            <div className="custom-control custom-switch custom-checkbox-success">
               <input
                 id="isTwitterEnabled"
                 className="custom-control-input"
@@ -149,7 +149,7 @@ class TwitterSecurityManagement extends React.Component {
 
             <div className="row mb-5">
               <div className="offset-3 col-6">
-                <div className="custom-control custom-switch checkbox-success">
+                <div className="custom-control custom-switch custom-checkbox-success">
                   <input
                     id="bindByUserNameTwitter"
                     className="custom-control-input"

+ 2 - 4
src/client/js/components/Admin/UserGroupDetail/UserGroupDetailPage.jsx

@@ -23,12 +23,10 @@ class UserGroupDetailPage extends React.Component {
         <div className="m-t-20 form-box">
           <UserGroupEditForm />
         </div>
-        {/* FIXME: use something instead of <legend> */}
-        <legend className="m-t-20">{t('admin:user_group_management.user_list')}</legend>
+        <h2 className="admin-setting-header m-t-20">{t('admin:user_group_management.user_list')}</h2>
         <UserGroupUserTable />
         <UserGroupUserModal />
-        {/* FIXME: use something instead of <legend> */}
-        <legend className="m-t-20">{t('Page')}</legend>
+        <h2 className="admin-setting-header m-t-20">{t('Page')}</h2>
         <div className="page-list">
           <UserGroupPageList />
         </div>

+ 1 - 2
src/client/js/components/Admin/UserGroupDetail/UserGroupEditForm.jsx

@@ -63,8 +63,7 @@ class UserGroupEditForm extends React.Component {
     return (
       <form className="form-horizontal" onSubmit={this.handleSubmit}>
         <fieldset>
-          {/* FIXME: use something instead of <legend> */}
-          <legend>{t('admin:user_group_management.basic_info')}</legend>
+          <h2 className="admin-setting-header">{t('admin:user_group_management.basic_info')}</h2>
           <div className="form-group">
             <label htmlFor="name" className="col-sm-2 control-label">{t('Name')}</label>
             <div className="col-sm-4">

+ 3 - 3
src/client/js/components/Admin/Users/UserInviteModal.jsx

@@ -78,9 +78,9 @@ class UserInviteModal extends React.Component {
 
     return (
       <>
-        <div className="checkbox checkbox-success text-left" onChange={this.handleCheckBox} style={{ flex: 0.95 }}>
-          <input type="checkbox" id="sendEmail" className="form-check-input" name="sendEmail" defaultChecked={this.state.sendEmail} />
-          <label htmlFor="sendEmail">
+        <div className="ccustom-control custom-switch custom-checkbox-info text-left" onChange={this.handleCheckBox} style={{ flex: 0.95 }}>
+          <input type="checkbox" id="sendEmail" className="custom-control-input" name="sendEmail" defaultChecked={this.state.sendEmail} />
+          <label className="custom-control-label" htmlFor="sendEmail">
             {t('admin:user_management.invite_modal.invite_thru_email')}
           </label>
         </div>

+ 1 - 1
src/client/js/components/PageHistory/PageRevisionList.jsx

@@ -95,7 +95,7 @@ export default class PageRevisionList extends React.Component {
 
     return (
       <React.Fragment>
-        <div className="custom-control custom-switch float-right">
+        <div className="custom-control custom-checkbox custom-checkbox-info float-right">
           <input
             type="checkbox"
             id="cbCompactize"

+ 48 - 48
src/server/routes/apiv3/security-setting.js

@@ -12,17 +12,17 @@ const removeNullPropertyFromObject = require('../../../lib/util/removeNullProper
 
 const validator = {
   generalSetting: [
-    body('restrictGuestMode').isString().isIn([
+    body('restrictGuestMode').if(value => value != null).isString().isIn([
       'Deny', 'Readonly',
     ]),
-    body('pageCompleteDeletionAuthority').isString().isIn([
+    body('pageCompleteDeletionAuthority').if(value => value != null).isString().isIn([
       'anyOne', 'adminOnly', 'adminAndAuthor',
     ]),
-    body('hideRestrictedByOwner').if((value, { req }) => req.body.hideRestrictedByOwner).isBoolean(),
-    body('hideRestrictedByGroup').if((value, { req }) => req.body.hideRestrictedByGroup).isBoolean(),
+    body('hideRestrictedByOwner').if(value => value != null).isBoolean(),
+    body('hideRestrictedByGroup').if(value => value != null).isBoolean(),
   ],
   authenticationSetting: [
-    body('isEnabled').if((value, { req }) => req.body.isEnabled).isBoolean(),
+    body('isEnabled').if(value => value != null).isBoolean(),
     body('authId').isString().isIn([
       'local', 'ldap', 'saml', 'oidc', 'basic', 'google', 'github', 'twitter',
     ]),
@@ -31,65 +31,65 @@ const validator = {
     body('registrationMode').isString().isIn([
       'Open', 'Restricted', 'Closed',
     ]),
-    body('registrationWhiteList').if((value, { req }) => req.body.registrationWhiteList).isArray().customSanitizer((value, { req }) => {
+    body('registrationWhiteList').if(value => value != null).isArray().customSanitizer((value, { req }) => {
       return value.filter(email => email !== '');
     }),
   ],
   ldapAuth: [
-    body('serverUrl').if((value, { req }) => req.body.serverUrl).isString(),
-    body('isUserBind').if((value, { req }) => req.body.isUserBind).isBoolean(),
-    body('ldapBindDN').if((value, { req }) => req.body.ldapBindDN).isString(),
-    body('ldapBindDNPassword').if((value, { req }) => req.body.ldapBindDNPassword).isString(),
-    body('ldapSearchFilter').if((value, { req }) => req.body.ldapSearchFilter).isString(),
-    body('ldapAttrMapUsername').if((value, { req }) => req.body.ldapAttrMapUsername).isString(),
-    body('isSameUsernameTreatedAsIdenticalUser').if((value, { req }) => req.body.isSameUsernameTreatedAsIdenticalUser).isBoolean(),
-    body('ldapAttrMapMail').if((value, { req }) => req.body.ldapAttrMapMail).isString(),
-    body('ldapAttrMapName').if((value, { req }) => req.body.ldapAttrMapName).isString(),
-    body('ldapGroupSearchBase').if((value, { req }) => req.body.ldapGroupSearchBase).isString(),
-    body('ldapGroupSearchFilter').if((value, { req }) => req.body.ldapGroupSearchFilter).isString(),
-    body('ldapGroupDnProperty').if((value, { req }) => req.body.ldapGroupDnProperty).isString(),
+    body('serverUrl').if(value => value != null).isString(),
+    body('isUserBind').if(value => value != null).isBoolean(),
+    body('ldapBindDN').if(value => value != null).isString(),
+    body('ldapBindDNPassword').if(value => value != null).isString(),
+    body('ldapSearchFilter').if(value => value != null).isString(),
+    body('ldapAttrMapUsername').if(value => value != null).isString(),
+    body('isSameUsernameTreatedAsIdenticalUser').if(value => value != null).isBoolean(),
+    body('ldapAttrMapMail').if(value => value != null).isString(),
+    body('ldapAttrMapName').if(value => value != null).isString(),
+    body('ldapGroupSearchBase').if(value => value != null).isString(),
+    body('ldapGroupSearchFilter').if(value => value != null).isString(),
+    body('ldapGroupDnProperty').if(value => value != null).isString(),
   ],
   samlAuth: [
-    body('entryPoint').if((value, { req }) => req.body.samlEntryPoint).isString(),
-    body('issuer').if((value, { req }) => req.body.samlIssuer).isString(),
-    body('cert').if((value, { req }) => req.body.samlCert).isString(),
-    body('attrMapId').if((value, { req }) => req.body.samlAttrMapId).isString(),
-    body('attrMapUsername').if((value, { req }) => req.body.samlAttrMapUsername).isString(),
-    body('attrMapMail').if((value, { req }) => req.body.samlAttrMapMail).isString(),
-    body('attrMapFirstName').if((value, { req }) => req.body.samlAttrMapFirstName).isString(),
-    body('attrMapLastName').if((value, { req }) => req.body.samlAttrMapLastName).isString(),
-    body('isSameUsernameTreatedAsIdenticalUser').if((value, { req }) => req.body.isSameUsernameTreatedAsIdenticalUser).isBoolean(),
-    body('isSameEmailTreatedAsIdenticalUser').if((value, { req }) => req.body.isSameEmailTreatedAsIdenticalUser).isBoolean(),
-    body('ABLCRule').if((value, { req }) => req.body.samlABLCRule).isString(),
+    body('entryPoint').if(value => value != null).isString(),
+    body('issuer').if(value => value != null).isString(),
+    body('cert').if(value => value != null).isString(),
+    body('attrMapId').if(value => value != null).isString(),
+    body('attrMapUsername').if(value => value != null).isString(),
+    body('attrMapMail').if(value => value != null).isString(),
+    body('attrMapFirstName').if(value => value != null).isString(),
+    body('attrMapLastName').if(value => value != null).isString(),
+    body('isSameUsernameTreatedAsIdenticalUser').if(value => value != null).isBoolean(),
+    body('isSameEmailTreatedAsIdenticalUser').if(value => value != null).isBoolean(),
+    body('ABLCRule').if(value => value != null).isString(),
   ],
   oidcAuth: [
-    body('oidcProviderName').if((value, { req }) => req.body.oidcProviderName).isString(),
-    body('oidcIssuerHost').if((value, { req }) => req.body.oidcIssuerHost).isString(),
-    body('oidcClientId').if((value, { req }) => req.body.oidcClientId).isString(),
-    body('oidcClientSecret').if((value, { req }) => req.body.oidcClientSecret).isString(),
-    body('oidcAttrMapId').if((value, { req }) => req.body.oidcAttrMapId).isString(),
-    body('oidcAttrMapUserName').if((value, { req }) => req.body.oidcAttrMapUserName).isString(),
-    body('oidcAttrMapEmail').if((value, { req }) => req.body.oidcAttrMapEmail).isString(),
-    body('isSameUsernameTreatedAsIdenticalUser').if((value, { req }) => req.body.isSameUsernameTreatedAsIdenticalUser).isBoolean(),
-    body('isSameEmailTreatedAsIdenticalUser').if((value, { req }) => req.body.isSameEmailTreatedAsIdenticalUser).isBoolean(),
+    body('oidcProviderName').if(value => value != null).isString(),
+    body('oidcIssuerHost').if(value => value != null).isString(),
+    body('oidcClientId').if(value => value != null).isString(),
+    body('oidcClientSecret').if(value => value != null).isString(),
+    body('oidcAttrMapId').if(value => value != null).isString(),
+    body('oidcAttrMapUserName').if(value => value != null).isString(),
+    body('oidcAttrMapEmail').if(value => value != null).isString(),
+    body('isSameUsernameTreatedAsIdenticalUser').if(value => value != null).isBoolean(),
+    body('isSameEmailTreatedAsIdenticalUser').if(value => value != null).isBoolean(),
   ],
   basicAuth: [
-    body('isSameUsernameTreatedAsIdenticalUser').if((value, { req }) => req.body.isSameUsernameTreatedAsIdenticalUser).isBoolean(),
+    body('isSameUsernameTreatedAsIdenticalUser').if(value => value != null).isBoolean(),
   ],
   googleOAuth: [
-    body('googleClientId').if((value, { req }) => req.body.googleClientId).isString(),
-    body('googleClientSecret').if((value, { req }) => req.body.googleClientSecret).isString(),
-    body('isSameUsernameTreatedAsIdenticalUser').if((value, { req }) => req.body.isSameUsernameTreatedAsIdenticalUser).isBoolean(),
+    body('googleClientId').if(value => value != null).isString(),
+    body('googleClientSecret').if(value => value != null).isString(),
+    body('isSameUsernameTreatedAsIdenticalUser').if(value => value != null).isBoolean(),
   ],
   githubOAuth: [
-    body('githubClientId').if((value, { req }) => req.body.githubClientId).isString(),
-    body('githubClientSecret').if((value, { req }) => req.body.githubClientSecret).isString(),
-    body('isSameUsernameTreatedAsIdenticalUser').if((value, { req }) => req.body.isSameUsernameTreatedAsIdenticalUser).isBoolean(),
+    body('githubClientId').if(value => value != null).isString(),
+    body('githubClientSecret').if(value => value != null).isString(),
+    body('isSameUsernameTreatedAsIdenticalUser').if(value => value != null).isBoolean(),
   ],
   twitterOAuth: [
-    body('twitterConsumerKey').if((value, { req }) => req.body.twitterConsumerKey).isString(),
-    body('twitterConsumerSecret').if((value, { req }) => req.body.twitterConsumerSecret).isString(),
-    body('isSameUsernameTreatedAsIdenticalUser').if((value, { req }) => req.body.isSameUsernameTreatedAsIdenticalUser).isBoolean(),
+    body('twitterConsumerKey').if(value => value != null).isString(),
+    body('twitterConsumerSecret').if(value => value != null).isString(),
+    body('isSameUsernameTreatedAsIdenticalUser').if(value => value != null).isBoolean(),
   ],
 };
 

+ 6 - 6
src/server/views/modal/delete.html

@@ -23,18 +23,18 @@
           <hr>
 
           {% if page.grant != 2 %}
-          <div class="checkbox checkbox-warning">
-            <input name="recursively" id="cbDeleteRecursively" value="1" type="checkbox" checked>
-            <label for="cbDeleteRecursively">
+          <div class="custom-control custom-checkbox custom-checkbox-warning">
+            <input class="custom-control-input" name="recursively" id="cbDeleteRecursively" value="1" type="checkbox" checked>
+            <label class="custom-control-label" for="cbDeleteRecursively">
               {{ t('modal_delete.delete_recursively') }}
               <p class="help-block mt-0"> {{ t('modal_delete.recursively', page.path) }}</p>
             </label>
           </div>
           {% endif %}
           {% if not page.isDeleted() %}
-          <div class="checkbox checkbox-danger">
-            <input name="completely" id="cbDeleteCompletely" {% if !user.canDeleteCompletely(page.creator._id) %} disabled="disabled" {% endif %} value="1"  type="checkbox">
-            <label for="cbDeleteCompletely" class="text-danger">
+          <div class="custom-control custom-checkbox custom-checkbox-danger">
+            <input class="custom-control-input" name="completely" id="cbDeleteCompletely" {% if !user.canDeleteCompletely(page.creator._id) %} disabled="disabled" {% endif %} value="1"  type="checkbox">
+            <label class="custom-control-label" for="cbDeleteCompletely" class="text-danger">
               {{ t('modal_delete.delete_completely') }}
               <p class="help-block mt-0"> {{ t('modal_delete.completely') }}</p>
             </label>

+ 9 - 9
src/server/views/modal/rename.html

@@ -29,25 +29,25 @@
 
           <hr>
 
-          <div class="checkbox checkbox-warning">
-            <input name="recursively" id="cbRenameRecursively" value="1" type="checkbox" checked>
-            <label for="cbRenameRecursively">
+          <div class="custom-control custom-checkbox custom-checkbox-warning">
+            <input class="custom-control-input" name="recursively" id="cbRenameRecursively" value="1" type="checkbox" checked >
+            <label class="custom-control-label" for="cbRenameRecursively">
               {{ t('modal_rename.label.Recursively') }}
               <p class="help-block mt-0">{{ t('modal_rename.help.recursive', page.path) }}</p>
             </label>
           </div>
 
-          <div class="checkbox checkbox-success">
-            <input name="create_redirect" id="cbRenameRedirect" value="1" type="checkbox">
-            <label for="cbRenameRedirect">
+          <div class="custom-control custom-checkbox custom-checkbox-success">
+            <input class="custom-control-input" name="create_redirect" id="cbRenameRedirect" value="1" type="checkbox">
+            <label class="custom-control-label" for="cbRenameRedirect">
               {{ t('modal_rename.label.Redirect') }}
               <p class="help-block mt-0">{{ t('modal_rename.help.redirect', page.path) }}</p>
             </label>
           </div>
 
-          <div class="checkbox checkbox-inverse">
-            <input name="remain_metadata" id="cbRenameMetadata" value="1" type="checkbox">
-            <label for="cbRenameMetadata">
+          <div class="custom-control custom-checkbox custom-checkbox-primary">
+            <input class="custom-control-input" name="remain_metadata" id="cbRenameMetadata" value="1" type="checkbox">
+            <label class="custom-control-label" for="cbRenameMetadata">
               {{ t('modal_rename.label.Do not update metadata') }}
               <p class="help-block mt-0">{{ t('modal_rename.help.metadata') }}</p>
             </label>