Forráskód Böngészése

HUE 9096 [doc] Add a feature flag to link sharing

Romain 6 éve
szülő
commit
7739245a82

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

@@ -296,6 +296,9 @@
   # Turn on the Gist snippet sharing.
   ## enable_gist=false
 
+  # Turn on the direct link sharing of saved document.
+  ## enable_link_sharing=false
+
   # Administrators
   # ----------------
   [[django_admins]]

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

@@ -300,6 +300,9 @@
   # Turn on the Gist snippet sharing.
   ## enable_gist=false
 
+  # Turn on the direct link sharing of saved document.
+  ## enable_link_sharing=false
+
   # Administrators
   # ----------------
   [[django_admins]]

+ 7 - 0
desktop/core/src/desktop/conf.py

@@ -1870,6 +1870,13 @@ ENABLE_GIST = Config(
   help=_('Turn on the Gist snippet sharing.')
 )
 
+ENABLE_LINK_SHARING = Config(
+  key='enable_link_sharing',
+  default=False,
+  type=coerce_bool,
+  help=_('Turn on the direct link sharing of saved document.')
+)
+
 ENABLE_CONNECTORS = Config(
   key='enable_connectors',
   default=False,

+ 2 - 0
desktop/core/src/desktop/js/ko/components/ko.shareDocModal.js

@@ -34,6 +34,7 @@ const TEMPLATE = `
   </div>
   <div class="modal-body" style="overflow: visible; height: 240px">
 
+    <!-- ko if: window.HAS_LINK_SHARING -->
     <a href="javascript:void(0)"  title="${ I18n(
       'Share the query selection via a link'
     ) }">
@@ -54,6 +55,7 @@ const TEMPLATE = `
         </div>
       </div>
     </div>
+    <!-- /ko -->
 
     <!-- ko with: definition -->
     <div class="row-fluid" data-bind="visible: !$parent.hasErrors()" style="max-height: 114px;" id="scrolldiv">

+ 2 - 1
desktop/core/src/desktop/templates/global_js_constants.mako

@@ -20,7 +20,7 @@
   from desktop import conf
   from desktop.auth.backend import is_admin
   from desktop.conf import APP_SWITCHER_ALTUS_BASE_URL, APP_SWITCHER_MOW_BASE_URL, DISPLAY_APP_SWITCHER, IS_K8S_ONLY, IS_MULTICLUSTER_ONLY, \
-      USE_DEFAULT_CONFIGURATION, USE_NEW_SIDE_PANELS, VCS, ENABLE_GIST
+      USE_DEFAULT_CONFIGURATION, USE_NEW_SIDE_PANELS, VCS, ENABLE_GIST, ENABLE_LINK_SHARING
   from desktop.models import hue_version, _get_apps, get_cluster_config
 
   from beeswax.conf import DOWNLOAD_BYTES_LIMIT, DOWNLOAD_ROW_LIMIT, LIST_PARTITIONS_LIMIT
@@ -104,6 +104,7 @@
   window.AUTO_UPLOAD_OPTIMIZER_STATS = '${ OPTIMIZER.AUTO_UPLOAD_STATS.get() }' === 'True';
 
   window.HAS_GIST = '${ ENABLE_GIST.get() }' === 'True';
+  window.HAS_LINK_SHARING = '${ ENABLE_LINK_SHARING.get() }' === 'True';
 
   ## In the past was has_workload_analytics()
   window.HAS_WORKLOAD_ANALYTICS = '${ ENABLE_QUERY_ANALYSIS.get() }' === 'True';