From a5c0ac80a59d00d89461669464d2bd155172f27c Mon Sep 17 00:00:00 2001 From: Jonathan Boiser Date: Wed, 22 Nov 2017 11:23:54 -0800 Subject: [PATCH] Fix double node-adding bug --- .../views/select-content-page/content-tree-viewer.vue | 3 ++- .../src/device_management/views/select-content-page/index.vue | 2 +- .../views/select-content-page/treeViewUtils.js | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/kolibri/plugins/management/assets/src/device_management/views/select-content-page/content-tree-viewer.vue b/kolibri/plugins/management/assets/src/device_management/views/select-content-page/content-tree-viewer.vue index e8bb647ef95..c56a2b4f2bc 100644 --- a/kolibri/plugins/management/assets/src/device_management/views/select-content-page/content-tree-viewer.vue +++ b/kolibri/plugins/management/assets/src/device_management/views/select-content-page/content-tree-viewer.vue @@ -144,8 +144,9 @@ } else { if (this.nodeCompletesParent(node)) { promise = this.addNodeForTransfer(sanitizeNode(this.annotatedTopicNode)); + } else { + promise = this.addNodeForTransfer(sanitized); } - promise = this.addNodeForTransfer(sanitized); } return promise.then(() => { this.disableAll = false; diff --git a/kolibri/plugins/management/assets/src/device_management/views/select-content-page/index.vue b/kolibri/plugins/management/assets/src/device_management/views/select-content-page/index.vue index 8245e3dde74..62dade0d08f 100644 --- a/kolibri/plugins/management/assets/src/device_management/views/select-content-page/index.vue +++ b/kolibri/plugins/management/assets/src/device_management/views/select-content-page/index.vue @@ -31,7 +31,7 @@
find(b.path, { pk: a.pk }); const isDescedantOf = flip(isAncestorOf); const sumTotalResources = sumBy('total_resources'); -// TODO name change!!! const sumOnDeviceResources = sumBy('on_device_resources'); /** @@ -41,7 +40,6 @@ const sumOnDeviceResources = sumBy('on_device_resources'); * */ export function annotateNode(node, selectedNodes) { - // TODO needs to be renamed!!! const { on_device_resources, total_resources } = node; const isIncluded = find(selectedNodes.included, { pk: node.pk }); const isOmitted = find(selectedNodes.omitted, { pk: node.pk });