From 9724f31b880d6a35e33fdb44a9c8a7d8de6ae95c Mon Sep 17 00:00:00 2001 From: Albert Backenhof Date: Thu, 20 Jun 2019 08:14:42 +0200 Subject: [PATCH] Disable visual selections in snapshots and locked dims Issue: QLIK-96528, QLIK-96531 --- src/bridgepicassospec.js | 8 ++++---- src/controller.js | 5 ++++- src/converthypercube.js | 1 + 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/bridgepicassospec.js b/src/bridgepicassospec.js index bc3e5f4..79a4c63 100644 --- a/src/bridgepicassospec.js +++ b/src/bridgepicassospec.js @@ -1,7 +1,7 @@ import ThemeManager from './theme'; import { interactionsSetup } from './interactions.js'; -export default function (element, layout, direction, isEditMode) { +export default function (element, layout, direction, isInteractable) { let labels = { startvalue: layout.labelsshow ? "Start Value" : layout.startName, endvalue: layout.labelsshow ? "End Value" : layout.endName, @@ -34,7 +34,7 @@ export default function (element, layout, direction, isEditMode) { } return { - interactions: (isEditMode ? [] : interactionsSetup()), + interactions: (!isInteractable ? [] : interactionsSetup()), scales: { v: { data: { @@ -110,7 +110,7 @@ export default function (element, layout, direction, isEditMode) { displayOrder: 0 }, brush: { - trigger: (isEditMode ? [] : [{ + trigger: (!isInteractable ? [] : [{ on: 'tap', contexts: ['highlight'], globalPropagation: 'stop', @@ -182,7 +182,7 @@ export default function (element, layout, direction, isEditMode) { } }, brush: { - trigger: (isEditMode ? [] : [{ + trigger: (!isInteractable ? [] : [{ on: 'tap', contexts: ['highlight'], globalPropagation: 'stop', diff --git a/src/controller.js b/src/controller.js index 5f74a27..97a24ca 100644 --- a/src/controller.js +++ b/src/controller.js @@ -55,7 +55,10 @@ export default ['$scope', '$element', function($scope, $element) { if (isEditMode || typeof $scope.chart.settings === 'undefined') { up.settings = bridgepicassospec( - $scope.chart.element, layout, $scope.$parent.options.direction, isEditMode); + $scope.chart.element, + layout, + $scope.$parent.options.direction, + !isEditMode && !$scope.backendApi.isSnapshot && !layout.qHyperCube.qDimensionInfo[0].qLocked); } $scope.chart.update(up); diff --git a/src/converthypercube.js b/src/converthypercube.js index d2dca2b..328526e 100644 --- a/src/converthypercube.js +++ b/src/converthypercube.js @@ -45,6 +45,7 @@ class ConvertHypercube { qMax: dimInfo.qMax, qMin: dimInfo.qMin, qSortIndicator: dimInfo.qSortIndicator, + qLocked: dimInfo.qLocked, qStateCounts: { qAlternative: dimInfo.qStateCounts.qAlternative, qDeselected: dimInfo.qStateCounts.qDeselected,