Răsfoiți Sursa

Merge pull request #1715 from weseek/feat/prevent-global-notifications

Feat/prevent global notifications
Yuki Takei 6 ani în urmă
părinte
comite
bc5ff131e7

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

@@ -552,6 +552,10 @@
     "channel": "チャンネル名",
     "channel": "チャンネル名",
     "pattern_desc": "Wiki のパス名。 パスには <code>*</code> を使用できます。",
     "pattern_desc": "Wiki のパス名。 パスには <code>*</code> を使用できます。",
     "channel_desc": "<code>#</code> を除いた Slack チャンネル名",
     "channel_desc": "<code>#</code> を除いた Slack チャンネル名",
+    "valid_page": "通知の有効 / 無効",
+    "link_notification_help": "<strong>linkを知っている人のみ閲覧できるページ</strong>は常に通知されません。",
+    "just_me_notification_help": "<strong>'自分のみ'に閲覧制限をしているページ</strong>に変更を加えた際に通知する",
+    "group_notification_help": "<strong>'特定グループにのみ'に閲覧制限をしているページ</strong>に変更を加えた際に通知する",
     "notification_list": "通知設定の一覧",
     "notification_list": "通知設定の一覧",
     "add_notification": "通知設定の追加",
     "add_notification": "通知設定の追加",
     "trigger_path": "トリガーパス",
     "trigger_path": "トリガーパス",

+ 42 - 9
src/client/js/components/Admin/Notification/GlobalNotification.jsx

@@ -40,12 +40,45 @@ class GlobalNotification extends React.Component {
     return (
     return (
       <React.Fragment>
       <React.Fragment>
 
 
-        {/* TODO GW-1279 i18n */}
-        <h2 className="border-bottom mb-5">通知が有効になるページ</h2>
+        <h2 className="border-bottom">{t('notification_setting.valid_page')}</h2>
+
+        <p className="well">
+          {/* eslint-disable-next-line react/no-danger */}
+          <span dangerouslySetInnerHTML={{ __html: t('notification_setting.link_notification_help') }} />
+        </p>
+
+
+        <div className="row mb-4">
+          <div className="col-md-8 col-md-offset-2">
+            <div className="checkbox checkbox-success">
+              <input
+                id="isNotificationForOwnerPageEnabled"
+                type="checkbox"
+              />
+              <label htmlFor="isNotificationForOwnerPageEnabled">
+                {/* eslint-disable-next-line react/no-danger */}
+                <span dangerouslySetInnerHTML={{ __html: t('notification_setting.just_me_notification_help') }} />
+
+              </label>
+            </div>
+          </div>
+        </div>
 
 
-        {/* TODO GW-1279 add checkbox for display isNotificationForOwnerPageEnabled */}
 
 
-        {/* TODO GW-1279 add checkbox for display isNotificationForGroupPageEnabled */}
+        <div className="row mb-4">
+          <div className="col-md-8 col-md-offset-2">
+            <div className="checkbox checkbox-success">
+              <input
+                id="isNotificationForGroupPageEnabled"
+                type="checkbox"
+              />
+              <label htmlFor="isNotificationForGroupPageEnabled">
+                {/* eslint-disable-next-line react/no-danger */}
+                <span dangerouslySetInnerHTML={{ __html: t('notification_setting.group_notification_help') }} />
+              </label>
+            </div>
+          </div>
+        </div>
 
 
         <div className="row my-3">
         <div className="row my-3">
           <div className="col-xs-offset-4 col-xs-5">
           <div className="col-xs-offset-4 col-xs-5">
@@ -59,11 +92,11 @@ class GlobalNotification extends React.Component {
           </div>
           </div>
         </div>
         </div>
 
 
-        <a href="/admin/global-notification/new">
-          <p className="btn btn-default">{t('notification_setting.add_notification')}</p>
-        </a>
-
-        <h2 className="border-bottom mb-5">{t('notification_setting.notification_list')}</h2>
+        <h2 className="border-bottom mb-5">{t('notification_setting.notification_list')}
+          <a href="/admin/global-notification/new">
+            <p className="btn btn-default pull-right">{t('notification_setting.add_notification')}</p>
+          </a>
+        </h2>
 
 
         <table className="table table-bordered">
         <table className="table table-bordered">
           <thead>
           <thead>