瀏覽代碼

[slack] Add Sharing from Editor config flag (#2031)

* [slack] Add share_from_editor config flag
- Secondary feature flag to switch on/off direct sharing from within Hue Editor UI to Slack
Harsh Gupta 4 年之前
父節點
當前提交
1996889a77
共有 3 個文件被更改,包括 32 次插入20 次删除
  1. 3 0
      desktop/conf.dist/hue.ini
  2. 3 0
      desktop/conf/pseudo-distributed.ini.tmpl
  3. 26 20
      desktop/core/src/desktop/conf.py

+ 3 - 0
desktop/conf.dist/hue.ini

@@ -826,6 +826,9 @@
     # Enables Slack application API endpoints
     ## is_enabled=true
 
+    # Enables direct sharing from Editor to Slack
+    ## share_from_editor=false
+
 
   # Configuration options for the request Tracing
   # ------------------------------------------------------------------------

+ 3 - 0
desktop/conf/pseudo-distributed.ini.tmpl

@@ -828,6 +828,9 @@
     # Enables Slack application API endpoints
     ## is_enabled=true
 
+    # Enables direct sharing from Editor to Slack
+    ## share_from_editor=false
+
 
   # Configuration options for the request Tracing
   # ------------------------------------------------------------------------

+ 26 - 20
desktop/core/src/desktop/conf.py

@@ -742,30 +742,36 @@ SLACK = ConfigSection(
       help=_('Enables Slack application API endpoints'),
       type=coerce_bool,
       default=False,
-      ),
+    ),
     SLACK_CLIENT_ID=Config(
-        key='slack_client_id',
-        type=str,
-        dynamic_default=get_slack_client_id,
-      ),
+      key='slack_client_id',
+      type=str,
+      dynamic_default=get_slack_client_id,
+    ),
     SLACK_CLIENT_SECRET=Config(
-        key='slack_client_secret',
-        type=str,
-        private=True,
-        dynamic_default=get_slack_client_secret,
-      ),
+      key='slack_client_secret',
+      type=str,
+      private=True,
+      dynamic_default=get_slack_client_secret,
+    ),
     SLACK_VERIFICATION_TOKEN=Config(
-        key='slack_verification_token',
-        type=str,
-        private=True,
-        dynamic_default=get_slack_verification_token,
-      ),
+      key='slack_verification_token',
+      type=str,
+      private=True,
+      dynamic_default=get_slack_verification_token,
+    ),
     SLACK_BOT_USER_TOKEN=Config(
-        key='slack_bot_user_token',
-        type=str,
-        private=True,
-        dynamic_default=get_slack_bot_user_token,
-      ),
+      key='slack_bot_user_token',
+      type=str,
+      private=True,
+      dynamic_default=get_slack_bot_user_token,
+    ),
+    SHARE_FROM_EDITOR=Config(
+      key='share_from_editor',
+      help=_('Enables direct sharing from Editor to Slack'),
+      type=coerce_bool,
+      default=False,
+    ),
   )
 )