Răsfoiți Sursa

remove grobal notificaton

itizawa 6 ani în urmă
părinte
comite
7fca73a2c4

+ 0 - 17
src/server/form/admin/notificationGlobal.js

@@ -1,17 +0,0 @@
-const form = require('express-form');
-
-const field = form.field;
-
-module.exports = form(
-  field('notificationGlobal[id]').trim(),
-  field('notificationGlobal[triggerPath]').trim(),
-  field('notificationGlobal[notifyToType]').trim(),
-  field('notificationGlobal[toEmail]').trim(),
-  field('notificationGlobal[slackChannels]').trim(),
-  field('notificationGlobal[triggerEvent:pageCreate]').trim(),
-  field('notificationGlobal[triggerEvent:pageEdit]').trim(),
-  field('notificationGlobal[triggerEvent:pageDelete]').trim(),
-  field('notificationGlobal[triggerEvent:pageMove]').trim(),
-  field('notificationGlobal[triggerEvent:pageLike]').trim(),
-  field('notificationGlobal[triggerEvent:comment]').trim(),
-);

+ 0 - 8
src/server/form/admin/slackIwhSetting.js

@@ -1,8 +0,0 @@
-const form = require('express-form');
-
-const field = form.field;
-
-module.exports = form(
-  field('slackIwhSetting[slack:incomingWebhookUrl]', 'Webhook URL'),
-  field('slackIwhSetting[slack:isIncomingWebhookPrioritized]', 'Prioritize Incoming Webhook than Slack App ').trim().toBooleanStrict(),
-);

+ 0 - 7
src/server/form/admin/slackSetting.js

@@ -1,7 +0,0 @@
-const form = require('express-form');
-
-const field = form.field;
-
-module.exports = form(
-  field('slackSetting[slack:token]', 'token'),
-);

+ 0 - 1
src/server/form/index.js

@@ -21,6 +21,5 @@ module.exports = {
     securityPassportTwitter: require('./admin/securityPassportTwitter'),
     securityPassportOidc: require('./admin/securityPassportOidc'),
     userGroupCreate: require('./admin/userGroupCreate'),
-    notificationGlobal: require('./admin/notificationGlobal'),
   },
 };

+ 0 - 130
src/server/routes/admin.js

@@ -221,100 +221,6 @@ module.exports = function(crowi, app) {
     return res.render('admin/global-notification-detail', { globalNotification });
   };
 
-  actions.globalNotification.create = (req, res) => {
-    const form = req.form.notificationGlobal;
-    let setting;
-
-    switch (form.notifyToType) {
-      case GlobalNotificationSetting.TYPE.MAIL:
-        setting = new GlobalNotificationMailSetting(crowi);
-        setting.toEmail = form.toEmail;
-        break;
-      case GlobalNotificationSetting.TYPE.SLACK:
-        setting = new GlobalNotificationSlackSetting(crowi);
-        setting.slackChannels = form.slackChannels;
-        break;
-      default:
-        logger.error('GlobalNotificationSetting Type Error: undefined type');
-        req.flash('errorMessage', 'Error occurred in creating a new global notification setting: undefined notification type');
-        return res.redirect('/admin/notification#global-notification');
-    }
-
-    setting.triggerPath = form.triggerPath;
-    setting.triggerEvents = getNotificationEvents(form);
-    setting.save();
-
-    return res.redirect('/admin/notification#global-notification');
-  };
-
-  actions.globalNotification.update = async(req, res) => {
-    const form = req.form.notificationGlobal;
-
-    const models = {
-      [GlobalNotificationSetting.TYPE.MAIL]: GlobalNotificationMailSetting,
-      [GlobalNotificationSetting.TYPE.SLACK]: GlobalNotificationSlackSetting,
-    };
-
-    let setting = await GlobalNotificationSetting.findOne({ _id: form.id });
-    setting = setting.toObject();
-
-    // when switching from one type to another,
-    // remove toEmail from slack setting and slackChannels from mail setting
-    if (setting.__t !== form.notifyToType) {
-      setting = models[setting.__t].hydrate(setting);
-      setting.toEmail = undefined;
-      setting.slackChannels = undefined;
-      await setting.save();
-      setting = setting.toObject();
-    }
-
-    switch (form.notifyToType) {
-      case GlobalNotificationSetting.TYPE.MAIL:
-        setting = GlobalNotificationMailSetting.hydrate(setting);
-        setting.toEmail = form.toEmail;
-        break;
-      case GlobalNotificationSetting.TYPE.SLACK:
-        setting = GlobalNotificationSlackSetting.hydrate(setting);
-        setting.slackChannels = form.slackChannels;
-        break;
-      default:
-        logger.error('GlobalNotificationSetting Type Error: undefined type');
-        req.flash('errorMessage', 'Error occurred in updating the global notification setting: undefined notification type');
-        return res.redirect('/admin/notification#global-notification');
-    }
-
-    setting.__t = form.notifyToType;
-    setting.triggerPath = form.triggerPath;
-    setting.triggerEvents = getNotificationEvents(form);
-    await setting.save();
-
-    return res.redirect('/admin/notification#global-notification');
-  };
-
-  actions.globalNotification.remove = async(req, res) => {
-    const id = req.params.id;
-
-    try {
-      await GlobalNotificationSetting.findOneAndRemove({ _id: id });
-      return res.redirect('/admin/notification#global-notification');
-    }
-    catch (err) {
-      req.flash('errorMessage', 'Error in deleting global notification setting');
-      return res.redirect('/admin/notification#global-notification');
-    }
-  };
-
-  const getNotificationEvents = (form) => {
-    const triggerEvents = [];
-    const triggerEventKeys = Object.keys(form).filter((key) => { return key.match(/^triggerEvent/) });
-    triggerEventKeys.forEach((key) => {
-      if (form[key]) {
-        triggerEvents.push(form[key]);
-      }
-    });
-    return triggerEvents;
-  };
-
   actions.search = {};
   actions.search.index = function(req, res) {
     const search = crowi.getSearcher();
@@ -740,23 +646,6 @@ module.exports = function(crowi, app) {
     return res.json({ status: true });
   };
 
-  // app.post('/_api/admin/notifications.remove' , admin.api.notificationRemove);
-  actions.api.notificationRemove = function(req, res) {
-    const UpdatePost = crowi.model('UpdatePost');
-    const id = req.body.id;
-
-    UpdatePost.remove(id)
-      .then(() => {
-        debug('Successfully remove updatePost');
-
-        return res.json(ApiResponse.success({}));
-      })
-      .catch((err) => {
-        debug('Failed to remove updatePost', err);
-        return res.json(ApiResponse.error());
-      });
-  };
-
   // app.get('/_api/admin/users.search' , admin.api.userSearch);
   actions.api.usersSearch = function(req, res) {
     const User = crowi.model('User');
@@ -774,25 +663,6 @@ module.exports = function(crowi, app) {
       });
   };
 
-  actions.api.toggleIsEnabledForGlobalNotification = async(req, res) => {
-    const id = req.query.id;
-    const isEnabled = (req.query.isEnabled === 'true');
-
-    try {
-      if (isEnabled) {
-        await GlobalNotificationSetting.enable(id);
-      }
-      else {
-        await GlobalNotificationSetting.disable(id);
-      }
-
-      return res.json(ApiResponse.success());
-    }
-    catch (err) {
-      return res.json(ApiResponse.error());
-    }
-  };
-
   /**
    * save esa settings, update config cache, and response json
    *

+ 0 - 5
src/server/routes/index.js

@@ -99,14 +99,9 @@ module.exports = function(crowi, app) {
   app.get('/admin/notification'              , loginRequiredStrictly , adminRequired , admin.notification.index);
   app.get('/admin/notification/slackAuth'    , loginRequiredStrictly , adminRequired , admin.notification.slackAuth);
   app.get('/admin/notification/slackSetting/disconnect', loginRequiredStrictly , adminRequired , admin.notification.disconnectFromSlack);
-  app.post('/_api/admin/notification.remove' , loginRequiredStrictly , adminRequired , csrf, admin.api.notificationRemove);
   app.get('/_api/admin/users.search'         , loginRequiredStrictly , adminRequired , admin.api.usersSearch);
   app.get('/admin/global-notification/new'   , loginRequiredStrictly , adminRequired , admin.globalNotification.detail);
   app.get('/admin/global-notification/:id'   , loginRequiredStrictly , adminRequired , admin.globalNotification.detail);
-  app.post('/admin/global-notification/new'  , loginRequiredStrictly , adminRequired , form.admin.notificationGlobal, admin.globalNotification.create);
-  app.post('/_api/admin/global-notification/toggleIsEnabled', loginRequiredStrictly , adminRequired , admin.api.toggleIsEnabledForGlobalNotification);
-  app.post('/admin/global-notification/:id/update', loginRequiredStrictly , adminRequired , form.admin.notificationGlobal, admin.globalNotification.update);
-  app.post('/admin/global-notification/:id/remove', loginRequiredStrictly , adminRequired , admin.globalNotification.remove);
 
   app.get('/admin/users'                , loginRequiredStrictly , adminRequired , admin.user.index);
   app.post('/admin/user/:id/removeCompletely' , loginRequiredStrictly , adminRequired , csrf, admin.user.removeCompletely);

+ 0 - 147
src/server/views/admin/global-notification-detail.html

@@ -30,158 +30,11 @@
     <div class="col-md-3">
       {% include './widget/menu.html' with {current: 'notification'} %}
     </div>
-
     <div class="col-md-9" id="admin-global-notification-setting"
       data-global-notification="{{ globalNotification|json }}">
     </div>
-    <!-- <a href="/admin/notification#global-notification" class="btn btn-default">
-        <i class="icon-fw ti-arrow-left" aria-hidden="true"></i>
-        {{ t('notification_setting.back_to_list') }}
-      </a>
-
-      {% if setting %}
-      {% set actionPath = '/admin/global-notification/' + setting.id + '/update' %}
-      {% else %}
-      {% set actionPath = '/admin/global-notification/new' %}
-      {% endif %}
-
-      <div class="row">
-        <div class="m-t-20 form-box col-md-12">
-          <legend>{{ t('notification_setting.notification_detail') }}</legend>
-
-          <form action="{{ actionPath }}" method="post" class="form-horizontal" role="form">
-            <fieldset class="col-sm-4">
-              <div class="form-group">
-                <h3 for="triggerPath">{{ t('notification_setting.trigger_path') }}
-                  <small>{{ t('notification_setting.trigger_path_help', '<code>*</code>') }}</small></h3>
-                <input class="form-control" type="text" name="notificationGlobal[triggerPath]"
-                  value="{{ setting.triggerPath || '' }}" required>
-              </div>
-
-              <div class="form-group form-inline">
-                <h3>{{ t('notification_setting.notify_to') }}</h3>
-                <div class="radio radio-primary">
-                  <input type="radio" id="mail" name="notificationGlobal[notifyToType]" value="mail"
-                    {% if setting.__t == 'mail' %}checked{% endif %}>
-                  <label for="mail">
-                    <p class="font-weight-bold">Email</p>
-                  </label>
-                </div>
-                <div class="radio radio-primary">
-                  <input type="radio" id="slack" name="notificationGlobal[notifyToType]" value="slack"
-                    {% if setting.__t == 'slack' %}checked{% endif %}>
-                  <label for="slack">
-                    <p class="font-weight-bold">Slack</p>
-                  </label>
-                </div>
-              </div>
-
-              <div class="form-group notify-to-option {% if setting.__t != 'mail' %}d-none{% endif %}" id="mail-input">
-                <input class="form-control" type="text" name="notificationGlobal[toEmail]" placeholder="Email"
-                  value="{{ setting.toEmail || '' }}">
-                <p class="help">
-                  <b>Hint: </b>
-                  <a href="https://ifttt.com/create" target="_blank">{{ t('notification_setting.email.ifttt_link') }} <i
-                      class="icon-share-alt"></i></a>
-                </p>
-              </div>
-
-              <div class="form-group notify-to-option {% if setting.__t != 'slack' %}d-none{% endif %}"
-                id="slack-input">
-                <input class="form-control" type="text" name="notificationGlobal[slackChannels]"
-                  placeholder="Slack Channel" value="{{ setting.slackChannels || '' }}">
-              </div>
-            </fieldset>
-
-            <fieldset class="col-sm-offset-1 col-sm-5">
-              <div class="form-group">
-                <h3>{{ t('notification_setting.trigger_events') }}</h3>
-                <div class="checkbox checkbox-inverse">
-                  <input type="checkbox" id="trigger-event-pageCreate"
-                    name="notificationGlobal[triggerEvent:pageCreate]" value="pageCreate"
-                    {% if setting && (setting.triggerEvents.indexOf('pageCreate') != -1) %}checked{% endif %} />
-                  <label for="trigger-event-pageCreate">
-                    <span class="label label-success"><i class="icon-doc"></i> CREATE</span> -
-                    {{ t('notification_setting.event_pageCreate') }}
-                  </label>
-                </div>
-                <div class="checkbox checkbox-inverse">
-                  <input type="checkbox" id="trigger-event-pageEdit" name="notificationGlobal[triggerEvent:pageEdit]"
-                    value="pageEdit"
-                    {% if setting && (setting.triggerEvents.indexOf('pageEdit') != -1) %}checked{% endif %} />
-                  <label for="trigger-event-pageEdit">
-                    <span class="label label-warning"><i class="icon-pencil"></i> EDIT</span> -
-                    {{ t('notification_setting.event_pageEdit') }}
-                  </label>
-                </div>
-                <div class="checkbox checkbox-inverse">
-                  <input type="checkbox" id="trigger-event-pageMove" name="notificationGlobal[triggerEvent:pageMove]"
-                    value="pageMove"
-                    {% if setting && (setting.triggerEvents.indexOf('pageMove') != -1) %}checked{% endif %} />
-                  <label for="trigger-event-pageMove">
-                    <span class="label label-warning"><i class="icon-action-redo"></i> MOVE</span> -
-                    {{ t('notification_setting.event_pageMove') }}
-                  </label>
-                </div>
-                <div class="checkbox checkbox-inverse">
-                  <input type="checkbox" id="trigger-event-pageDelete"
-                    name="notificationGlobal[triggerEvent:pageDelete]" value="pageDelete"
-                    {% if setting && (setting.triggerEvents.indexOf('pageDelete') != -1) %}checked{% endif %} />
-                  <label for="trigger-event-pageDelete">
-                    <span class="label label-danger"><i class="icon-fire"></i> DELETE</span> -
-                    {{ t('notification_setting.event_pageDelete') }}
-                  </label>
-                </div>
-                <div class="checkbox checkbox-inverse">
-                  <input type="checkbox" id="trigger-event-pageLike" name="notificationGlobal[triggerEvent:pageLike]"
-                    value="pageLike"
-                    {% if setting && (setting.triggerEvents.indexOf('pageLike') != -1) %}checked{% endif %} />
-                  <label for="trigger-event-pageLike">
-                    <span class="label label-info"><i class="icon-like"></i> LIKE</span> -
-                    {{ t('notification_setting.event_pageLike') }}
-                  </label>
-                </div>
-                <div class="checkbox checkbox-inverse">
-                  <input type="checkbox" id="trigger-event-comment" name="notificationGlobal[triggerEvent:comment]"
-                    value="comment"
-                    {% if setting && (setting.triggerEvents.indexOf('comment') != -1) %}checked{% endif %} />
-                  <label for="trigger-event-comment">
-                    <span class="label label-default"><i class="icon-fw icon-bubble"></i> POST</span> -
-                    {{ t('notification_setting.event_comment') }}
-                  </label>
-                </div>
-              </div>
-            </fieldset>
-
-            <div class="col-sm-offset-5 col-sm-12 m-t-20">
-              <input type="hidden" name="notificationGlobal[id]" value="{{ setting.id }}">
-              <input type="hidden" name="_csrf" value="{{ csrf() }}">
-              <button type="submit" class="btn btn-primary">
-                {% if setting %}
-                {{ t('Update') }}
-                {% else %}
-                {{ t('Create') }}
-                {% endif %}
-              </button>
-            </div>
-          </form>
-        </div>
-      </div> -->
-
   </div>
 
-  <script>
-    $('input[name="notificationGlobal[notifyToType]"]').change(function () {
-      var val = $(this).val();
-      $('.notify-to-option').addClass('d-none');
-      $('#' + val + '-input').removeClass('d-none');
-    });
-
-    $('button#global-notificatin-delete').submit(function () {
-      alert(123)
-    });
-
-  </script>
   {% endblock content_main %}
 
   {% block content_footer %}

+ 0 - 124
src/server/views/admin/global-notification.html

@@ -1,124 +0,0 @@
-<a href="/admin/global-notification/new">
-  <p class="btn btn-default">{{ t('notification_setting.add_notification') }}</p>
-</a>
-<h2>{{ t('notification_setting.notification_list') }}</h2>
-
-{% set tags = {
-  pageCreate: '<span class="label label-success" data-toggle="tooltip" data-placement="top" title="Page Create"><i class="icon-doc"></i> CREATE</span>',
-  pageEdit: '<span class="label label-warning" data-toggle="tooltip" data-placement="top" title="Page Edit"><i class="icon-pencil"></i> EDIT</span>',
-  pageMove: '<span class="label label-warning" data-toggle="tooltip" data-placement="top" title="Page Move"><i class="icon-action-redo"></i> MOVE</span>',
-  pageDelete: '<span class="label label-danger" data-toggle="tooltip" data-placement="top" title="Page Delte"><i class="icon-fire"></i> DELETE</span>',
-  pageLike: '<span class="label label-info" data-toggle="tooltip" data-placement="top" title="Page Like"><i class="icon-like"></i> LIKE</span>',
-  comment: '<span class="label label-default" data-toggle="tooltip" data-placement="top" title="New Comment"><i class="icon-fw icon-bubble"></i> POST</span>'
-} %}
-
-<table class="table table-bordered">
-  <thead>
-    <th>ON/OFF</th>
-    <th>{{ t('notification_setting.trigger_path') }} {{ t('notification_setting.trigger_path_help', '<code>*</code>') }}</th>
-    <th>{{ t('notification_setting.trigger_events') }}</th>
-    <th>{{ t('notification_setting.notify_to') }}</th>
-    <th></th>
-  </thead>
-  <tbody class="admin-notif-list">
-    {% for globalNotif in globalNotifications %}
-    {% set detailPageUrl = '/admin/global-notification/' + globalNotif.id %}
-    <tr>
-      <td class="align-middle td-abs-center">
-        <input type="checkbox" class="js-switch" data-size="small" data-id="{{ globalNotif._id.toString() }}" {% if globalNotif.isEnabled %}checked{% endif %} />
-      </td>
-      <td>
-        {{ globalNotif.triggerPath }}
-      </td>
-      <td style="max-width: 200px;">
-        {% for event in globalNotif.triggerEvents %}
-          {{ tags[event] | safe }}
-        {% endfor %}
-      </td>
-      <td>
-        {% if globalNotif.__t == 'mail' %}<span data-toggle="tooltip" data-placement="top" title="Email"><i class="ti-email"></i> {{ globalNotif.toEmail }}</span>
-        {% elseif globalNotif.__t == 'slack' %}<span data-toggle="tooltip" data-placement="top" title="Slack"><i class="fa fa-slack"></i> {{ globalNotif.slackChannels }}</span>
-        {% endif %}
-      </td>
-      <td class="td-abs-center">
-        <div class="btn-group admin-group-menu">
-          <button type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
-            <i class="icon-settings"></i> <span class="caret"></span>
-          </button>
-          <ul class="dropdown-menu" role="menu">
-            <li>
-              <a href="{{ detailPageUrl }}">
-                <i class="icon-fw icon-note"></i> {{ t('Edit') }}
-              </a>
-            </li>
-
-            <li class="btn-delete">
-              <a href="#"
-                  data-setting-id="{{ globalNotif.id }}"
-                  data-target="#admin-delete-global-notification"
-                  data-toggle="modal">
-                <i class="icon-fw icon-fire text-danger"></i> {{ t('Delete') }}
-              </a>
-            </li>
-
-          </ul>
-        </div>
-      </td>
-    </tr>
-    {% endfor %}
-  </tbody>
-</table>
-
-<div class="modal fade" id="admin-delete-global-notification">
-    <div class="modal-dialog">
-      <div class="modal-content">
-        <div class="modal-header bg-danger">
-          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
-          <div class="modal-title">
-            <i class="icon icon-fire"></i> Delete Global Notification Setting
-          </div>
-        </div>
-
-        <div class="modal-body">
-          <span class="text-danger">
-            削除すると元に戻すことはできませんのでご注意ください。
-          </span>
-        </div>
-        <div class="modal-footer">
-          <form action="#" method="post" id="admin-global-notification-setting-delete" class="text-right">
-            <input type="hidden" name="setting-id" value="">
-            <input type="hidden" name="_csrf" value="{{ csrf() }}">
-            <button type="submit" value="" class="btn btn-sm btn-danger">
-              <i class="icon icon-fire"></i> 削除
-            </button>
-          </form>
-        </div>
-
-      </div>
-      <!-- /.modal-content -->
-    </div>
-    <!-- /.modal-dialog -->
-  </div>
-
-<script>
-  $(".btn-delete").on("click", function(event) {
-    var id = $(event.currentTarget).find("a").data("setting-id");
-    $("#admin-global-notification-setting-delete").attr("action", "/admin/global-notification/" + id + "/remove");
-  });
-
-  $(".js-switch").on("change", function(event) {
-    var id = event.currentTarget.dataset.id;
-    var isEnabled = event.currentTarget.checked;
-    $.post('/_api/admin/global-notification/toggleIsEnabled?id=' + id + '&isEnabled=' + isEnabled, function(res) {
-      if (res.ok) {
-        // do nothing
-      }
-      else {
-        $('.admin-notification > .row > .col-md-9').prepend(
-          '<div class=\"alert alert-danger\">Error occurred in deleting global notifcation setting.</div>'
-        );
-        location.reload();
-      }
-    });
-  });
-</script>

+ 1 - 109
src/server/views/admin/notification.html

@@ -16,118 +16,10 @@
     <div class="col-md-3">
       {% include './widget/menu.html' with {current: 'notification'} %}
     </div>
-    <div class="col-md-9" id="admin-notification-setting">
-
-      <ul class="nav nav-tabs" role="tablist">
-        <li role="tab">
-          <a href="#user-trigger-notification" data-toggle="tab" role="tab"><i class="icon-settings"></i> User Trigger Notification</a>
-        </li>
-        <li role="tab">
-          <a href="#global-notification" data-toggle="tab" role="tab"><i class="icon-settings"></i> Global Notification</a>
-        </li>
-      </ul>
-
-        <div id="user-trigger-notification" class="tab-pane" role="tabpanel">
-          <h4>Default Notification Settings for Patterns</h4>
-
-          <table class="table table-bordered">
-            <thead>
-              <th>Pattern</th>
-              <th>Channel</th>
-              <th>Operation</th>
-            </thead>
-            <tbody class="admin-notif-list">
-              <form id="slackNotificationForm">
-              <tr>
-                <td>
-                  <input class="form-control" type="text" name="pathPattern" value="" placeholder="e.g. /projects/xxx/MTG/*">
-                  <p class="help-block">
-                    Path name of wiki. Pattern expression with <code>*</code> can be used.
-                  </p>
-                </td>
-                <td>
-                  <input class="form-control form-inline" type="text" name="channel" value="" placeholder="e.g. project-xxx">
-                  <p class="help-block">
-                    Slack channel name. Without <code>#</code>.
-                  </p>
-                </td>
-                <td>
-                  <input type="hidden" name="_csrf" value="{{ csrf() }}">
-                  <input type="submit" value="Add" class="btn btn-primary">
-                </td>
-              </tr>
-              </form>
-
-              {% for userNotif in userNotifications %}
-              <tr class="admin-notif-row" data-updatepost-id="{{ userNotif._id.toString() }}">
-                <td>
-                  {{ userNotif.pathPattern }}
-                </td>
-                <td>
-                  {{ userNotif.channel }}
-                </td>
-                <td>
-                  <form class="admin-remove-updatepost">
-                    <input type="hidden" name="id" value="{{ userNotif._id.toString() }}">
-                    <input type="hidden" name="_csrf" value="{{ csrf() }}">
-                    <input type="submit" value="Delete" class="btn btn-default">
-                  </form>
-                </td>
-              </tr>
-              {% endfor %}
-            </tbody>
-          </table>
-        </div><!-- /#user-trigger-notification -->
-
-        <div id="global-notification" class="tab-pane" role="tabpanel" >
-          {% include './global-notification.html' %}
-        </div><!-- /#global-notification -->
-
-      </div><!-- /.tab-content -->
-
-    </div>
+    <div class="col-md-9" id="admin-notification-setting"></div>
   </div>
-
-  <script>
-    function activateTab(tab){
-      $('.nav-tabs a[href="#' + tab + '"]').tab('show');
-    };
-
-    function activateSlackIwh() {
-      $("#selectSlackOption").selectpicker('val', '1');
-      $("#slack-app").removeClass('active');
-      $("#slack-incoming-webhooks").addClass('active');
-    }
-
-    function activateSlackApp() {
-      $("#selectSlackOption").selectpicker('val', '2');
-      $("#slack-incoming-webhooks").removeClass('active');
-      $("#slack-app").addClass('active');
-    }
-
-    window.addEventListener('load', function(e) {
-      // hash on page
-      if (location.hash) {
-        if (location.hash == '#global-notification') {
-          activateTab('global-notification');
-        }
-      }
-    });
-
-    $("#selectSlackOption").on('change', function() {
-      if (this.value === "1") {
-        activateSlackIwh();
-      }
-      else if (this.value === "2") {
-        activateSlackApp();
-      }
-    });
-  </script>
 </div>
 {% endblock content_main %}
 
 {% block content_footer %}
 {% endblock content_footer %}
-
-
-