import Ember from 'ember';
import ENV from 'plenario-explorer/config/environment';

export default Ember.Controller.extend({
  modelArrived: Ember.observer('model', function() {
    const nodeList = this.get('model.nodes');
    const nodeTuples = nodeList.map(node => {
      return [node.properties.id, node.properties];
    });
    const nodeMap = new Map(nodeTuples);
    this.set('nodeMap', nodeMap);
    // TODO: Move magic node id to environment config
    this.set('selectedNode', nodeMap.get(ENV.defaultNode));
  }),

  actions: {
    onSelect(nodeId) {
      const newNode = this.get('nodeMap').get(nodeId);
      this.set('selectedNode', newNode);
    }
  }
});

@@ -20,16 +20,19 @@
 ember';%0A
+// 
 import E
@@ -405,62 +405,8 @@
 p);%0A
-    // TODO: Move magic node id to environment config%0A
     
@@ -438,32 +438,26 @@
 node
-Map.get(ENV.defaultNode)
+List%5B0%5D.properties
 );%0A 

Set default node as first returned from API