Example #1
0
        return res;
      },
      {}
    ),

    satellite: {
      example: {
        events: 'exampleChanged',
        existsIf: function(owner){
          return owner.example;
        },
        satelliteClass: UINode.subclass({
          className: namespace + '.Example',
          template: templates.Example,
          binding: {
            example: Value
              .factory('ownerChanged', 'owner')
              .pipe('exampleChanged', 'example')
          }
        })
      },
      description: {
        events: 'descriptionChanged',
        existsIf: function(owner){
          return owner.description;
        },
        satelliteClass: UINode.subclass({
          className: namespace + '.Description',
          template: templates.Description,
          binding: {
            example: Value
              .factory('ownerChanged', 'owner')
Example #2
0
      }
    }]
  },
  action: {
    openLoc: function(){
      if (this.data.loc)
        require('app').notifyLoader('loc', this.data.loc);
    }
  }
});

var TestSuiteNode = TestNode.subclass({
  className: 'TestSuiteNode',

  dataSource: Value.factory('rootChanged', function(node){
    return node.root ? node.root.getChildNodesDataset() : null;
  }).deferred(),  // TODO: investigate why deferred() fixes issue with section selection

  template: resource('./template/test-suite.tmpl'),

  sorting: 'root.basisObjectId',
  childClass: TestNode,
  childFactory: function(config){
    if (config.delegate.data.type == 'case')
      return new TestCaseNode(config);
    else
      return new TestSuiteNode(config);
  }
});

var TestCaseNode = TestNode.subclass({
Example #3
0
var Node = require('basis.ui').Node;
var Value = require('basis.data').Value;
var STATE = require('basis.data').STATE;
var Hotel = require('app.type').Hotel;

module.exports = new Node({
  active: true,
  dataSource: Value.factory('update', function(node){
    return Hotel.byRegion(node.data.id);
  }),

  template: resource('./template/list.tmpl'),
  binding: {
    hasRegion: {
      events: 'targetChanged',
      getter: function(node){
        return Boolean(node.target);
      }
    },
    errorMsg: {
      events: 'childNodesStateChanged',
      getter: function(node){
        if (node.childNodesState == STATE.ERROR)
        {
          var msg = node.childNodesState.data;
          return typeof msg == 'object' ? msg.msg : String(msg);
        }
      }
    }
  },
  
Example #4
0
        getter: function(node){
          var p = node.data.className.split('.');
          p.pop();
          return p.join('.');
        }
      },
      className: {
        events: 'update',
        getter: function(node){
          return node.data.className.split('.').pop();
        }
      }
    },

    dataSource: Value.factory('update', function(node){
      return namespaceClsSplitBySuper.getSubset(node.data.clsId);
    }),
    childClass: basis.Class.SELF,
    sorting: function(child){
      return child.data.className.split('.').pop();
    }
  });

  var viewNamespaceMap = new View({
    viewHeader: 'Namespace class map',
    title: 'Namespace class map',

    template: resource('./template/namespaceMap.tmpl'),
    binding: {
      classMap: new Node({
        template: '<ul class="firstLevel"/>',