[jqtree] Change 'maybe child' into 'maybe moved'
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 05 Jan 2017 11:08:49 +0100
changeset 2268 96bda704e719
parent 2267 8b4905c6d9c2
child 2269 5afe55a39449
[jqtree] Change 'maybe child' into 'maybe moved' As this is currenly the actual meaning. If it has been properly named, I would probably have returned the proper value for data object (false, not true).
data/cubes.jqtree.js
views/jqtree.py
views/sedatree.py
--- a/data/cubes.jqtree.js	Wed Jan 11 07:56:54 2017 +0100
+++ b/data/cubes.jqtree.js	Thu Jan 05 11:08:49 2017 +0100
@@ -1,4 +1,4 @@
-// copyright 2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+// copyright 2016-2017 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 // contact http://www.logilab.fr -- mailto:contact@logilab.fr
 //
 // This program is free software: you can redistribute it and/or modify it under
@@ -27,7 +27,7 @@
             closedIcon: $('<i class="glyphicon glyphicon-expand"></i>'),
             openedIcon: $('<i class="glyphicon glyphicon-collapse-down"></i>'),
             onCanMove: function(node) {
-                return node.maybeChild;
+                return node.maybeMoved;
             },
             onCanMoveTo: function(moved_node, target_node, position) {
                 if ( target_node.id === undefined ) {
--- a/views/jqtree.py	Wed Jan 11 07:56:54 2017 +0100
+++ b/views/jqtree.py	Thu Jan 05 11:08:49 2017 +0100
@@ -1,4 +1,4 @@
-# copyright 2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2016-2017 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr -- mailto:contact@logilab.fr
 #
 # This program is free software: you can redistribute it and/or modify it under
@@ -41,9 +41,9 @@
         """Return a list of entity type which `entity` may be parent of."""
         return []
 
-    def maybe_child(self):
-        """Return True if entity may be child of another (i.e. may be
-        reparented).
+    def maybe_moved(self):
+        """Return True if entity may be moved from its location to another
+        (i.e. may be reparented).
         """
         return False
 
@@ -59,7 +59,7 @@
             'label': label,
             'id': entity.eid,
             'type': entity.cw_etype,
-            'maybeChild': self.maybe_child(),
+            'maybeMoved': self.maybe_moved(),
             'maybeParentOf': self.maybe_parent_of(),
         }
         if on_demand:
--- a/views/sedatree.py	Wed Jan 11 07:56:54 2017 +0100
+++ b/views/sedatree.py	Thu Jan 05 11:08:49 2017 +0100
@@ -1,4 +1,4 @@
-# copyright 2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2016-2017 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr -- mailto:contact@logilab.fr
 #
 # This program is free software: you can redistribute it and/or modify it under
@@ -64,7 +64,7 @@
     def maybe_parent_of(self):
         return [] if self.entity.is_archive_unit_ref else ['SEDAArchiveUnit']
 
-    def maybe_child(self):
+    def maybe_moved(self):
         return True
 
     def reparent(self, peid):
@@ -92,8 +92,8 @@
     __select__ = (jqtree.IJQTreeAdapter.__select__
                   & is_instance('SEDABinaryDataObject', 'SEDAPhysicalDataObject'))
 
-    def maybe_child(self):
-        return True
+    def maybe_moved(self):
+        return False
 
 
 class SimplifiedBinaryDataObjectIJQTreeAdapter(jqtree.IJQTreeAdapter):
@@ -101,7 +101,7 @@
                   & is_instance('SEDABinaryDataObject') & simplified_profile())
     rtype_to_archivetransfer = 'seda_binary_data_object'
 
-    def maybe_child(self):
+    def maybe_moved(self):
         return True
 
     def reparent(self, peid):