diff --git a/app/adapters/_baseAdapter.js b/app/adapters/_baseAdapter.js index a78d44b5f4ce3bad1e86a0d98e39dbf2e0a24745..e9850c6f0b688b71aa5ad7cb4db00bda324947a7 100644 --- a/app/adapters/_baseAdapter.js +++ b/app/adapters/_baseAdapter.js @@ -1,7 +1,8 @@ import Ember from 'ember'; import RESTAdapter from 'ember-data/adapters/rest'; +import FixtureAdapter from 'ember-data-fixture-adapter'; -export default RESTAdapter.extend({ +export default FixtureAdapter.extend({ host: 'http://localhost:8080', // TODO: replace with live url namespace: 'v1', session: Ember.inject.service() diff --git a/app/components/architecture-visualisation-cytoscape/component.js b/app/components/architecture-visualisation-cytoscape/component.js index f07e1506fb173002d294fa1388aee455bcfff283..e72a6b97ec5e755d99bb75d28550d2c5f01cbcba 100644 --- a/app/components/architecture-visualisation-cytoscape/component.js +++ b/app/components/architecture-visualisation-cytoscape/component.js @@ -41,6 +41,7 @@ export default Ember.Component.extend({ // padding: 6, // ungrabifyWhileSimulating: true, // infinite: false + // TODO: avoidOverlap: true has shaky behavior (enabled by default). Find workaround } }); diff --git a/app/models/communication.js b/app/models/communication.js index 7be2d6cda64671dda9eb14f478a13146913de0ca..eba5c338de071703561a4967b40b90b6652e2584 100644 --- a/app/models/communication.js +++ b/app/models/communication.js @@ -1,9 +1,82 @@ import BaseEntity from './baseentity'; import attr from 'ember-data/attr'; -export default BaseEntity.extend({ +const Model = BaseEntity.extend({ technology: attr('string'), sourceId: attr('string'), targetId: attr('string'), workload: attr('number') }); + +Model.reopenClass({ + FIXTURES: [ + { + "type":"communication", + "id":"test-system123-communication-1", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123", + "sourceId":"test-system123-service-1", + "targetId":"test-system123-service-2", + "technology":"REST" + }, + { + "type":"communication", + "id":"test-system123-communication-2", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123", + "sourceId":"test-system123-service-2", + "targetId":"test-system123-service-3", + "technology":"TCP/IP" + }, + { + "type":"communication", + "id":"test-system123-communication-3", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123", + "sourceId":"test-system123-service-3", + "targetId":"test-system123-service-4", + "technology":"TCP/IP" + }, + { + "type":"communication", + "id":"test-system123-communication-4", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123", + "sourceId":"test-system123-service-3", + "targetId":"test-system123-service-5", + "technology":"TCP/IP" + }, + { + "type":"communication", + "id":"test-system123-communication-5", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123", + "sourceId":"test-system123-service-4", + "targetId":"test-system123-service-5", + "technology":"TCP/IP" + }, + { + "type":"communication", + "id":"test-system123-communication-6", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123", + "sourceId":"test-system123-service-5", + "targetId":"test-system123-service-6", + "technology":"TCP/IP" + } + ] +}); + +export default Model; diff --git a/app/models/communicationinstance.js b/app/models/communicationinstance.js index df39e8e6ddbaab5fe85a03567fdbe2cbf6e55523..bbda2584c6f14b77bc42a22c5eb1dfe6bbf6a0fd 100644 --- a/app/models/communicationinstance.js +++ b/app/models/communicationinstance.js @@ -1,9 +1,88 @@ import BaseEntity from './baseentity'; import attr from 'ember-data/attr'; -export default BaseEntity.extend({ +const Model = BaseEntity.extend({ sourceId: attr('string'), targetId: attr('string'), communicationId: attr('string'), workload: attr('number') }); + +Model.reopenClass({ + FIXTURES: [ + { + "type": "communicationInstance", + "id": "test-system123-communicationInstance-1", + "changelogSequence": 0, + "lastUpdate": "2016-06-22T16:49:49.146+02:00", + "revisionNumber": 0, + "systemId": "system123", + "communicationId": "test-system123-communication-1", + "sourceId": "test-system123-serviceInstance-1", + "targetId": "test-system123-serviceInstance-2", + "workload": 10 + }, + { + "type": "communicationInstance", + "id": "test-system123-communicationInstance-2", + "changelogSequence": 0, + "lastUpdate": "2016-06-22T16:49:49.146+02:00", + "revisionNumber": 0, + "systemId": "system123", + "communicationId": "test-system123-communication-2", + "sourceId": "test-system123-serviceInstance-2", + "targetId": "test-system123-serviceInstance-3", + "workload": 20 + }, + { + "type": "communicationInstance", + "id": "test-system123-communicationInstance-3", + "changelogSequence": 0, + "lastUpdate": "2016-06-22T16:49:49.146+02:00", + "revisionNumber": 0, + "systemId": "system123", + "communicationId": "test-system123-communication-3", + "sourceId": "test-system123-serviceInstance-3", + "targetId": "test-system123-serviceInstance-4", + "workload": 10 + }, + { + "type": "communicationInstance", + "id": "test-system123-communicationInstance-4", + "changelogSequence": 0, + "lastUpdate": "2016-06-22T16:49:49.146+02:00", + "revisionNumber": 0, + "systemId": "system123", + "communicationId": "test-system123-communication-4", + "sourceId": "test-system123-serviceInstance-3", + "targetId": "test-system123-serviceInstance-5", + "workload": 15 + }, + { + "type": "communicationInstance", + "id": "test-system123-communicationInstance-5", + "changelogSequence": 0, + "lastUpdate": "2016-06-22T16:49:49.146+02:00", + "revisionNumber": 0, + "systemId": "system123", + "communicationId": "test-system123-communication-5", + "sourceId": "test-system123-serviceInstance-4", + "targetId": "test-system123-serviceInstance-5", + "workload": 10 + }, + { + "type": "communicationInstance", + "id": "test-system123-communicationInstance-6", + "changelogSequence": 0, + "lastUpdate": "2016-06-22T16:49:49.146+02:00", + "revisionNumber": 0, + "systemId": "system123", + "communicationId": "test-system123-communication-6", + "sourceId": "test-system123-serviceInstance-5", + "targetId": "test-system123-serviceInstance-6", + "workload": 15 + } + ] +}); + +export default Model; diff --git a/app/models/node.js b/app/models/node.js index 8d50dbc3708129a8e04fb500085a67a2f96bd0f4..595993f2496c08f9e72fb44b5849ec166073283a 100644 --- a/app/models/node.js +++ b/app/models/node.js @@ -1,9 +1,63 @@ import BaseEntity from './baseentity'; import attr from 'ember-data/attr'; -export default BaseEntity.extend({ +const Model = BaseEntity.extend({ name: attr('string'), ip: attr('string'), hostname: attr('string'), nodeGroupId: attr('string') }); + +Model.reopenClass({ + FIXTURES: [{ + "type":"node", + "id":"test-system123-node-2", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123", + "hostname":"host2", + "ip":"10.0.0.2", + "name":"Logicnode FIXTURE", + "nodeGroupId":"test-system123-nodeGroup-1" + }, + { + "type":"node", + "id":"test-system123-node-3", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123", + "hostname":"host3", + "ip":"10.0.0.2", + "name":"Adapter", + "nodeGroupId":"test-system123-nodeGroup-1" + }, + { + "type":"node", + "id":"test-system123-node-4", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123", + "hostname":"host4", + "ip":"10.0.0.2", + "name":"Database", + "nodeGroupId":"test-system123-nodeGroup-1" + }, + { + "type":"node", + "id":"test-system123-node-1", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123", + "hostname":"test hostname", + "ip":"10.0.0.1", + "name":"WebNode", + "nodeGroupId":"test-system123-nodeGroup-1" + }] + +}) + +export default Model; \ No newline at end of file diff --git a/app/models/nodegroup.js b/app/models/nodegroup.js index eb8d434155be05df8481dd8eb96ca39b6837f480..41b2125d943196cea0c4d02c89123b4474054441 100644 --- a/app/models/nodegroup.js +++ b/app/models/nodegroup.js @@ -1,7 +1,22 @@ import BaseEntity from './baseentity'; import attr from 'ember-data/attr'; -export default BaseEntity.extend({ +const Model = BaseEntity.extend({ name: attr('string') +}); +Model.reopenClass({ + FIXTURES: [ + { + "type":"nodeGroup", + "id":"test-system123-nodeGroup-1", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123", + "name":"CoCoMe" + } + ] }); + +export default Model; \ No newline at end of file diff --git a/app/models/service.js b/app/models/service.js index 572f4e32a4d6340550852944de33e2c7ddb82b05..a6a12320ae76e5b5130423ba80bdad0964cc863e 100644 --- a/app/models/service.js +++ b/app/models/service.js @@ -1,7 +1,62 @@ import BaseEntity from './baseentity'; import attr from 'ember-data/attr'; -export default BaseEntity.extend({ +const Model = BaseEntity.extend({ name: attr('string'), description: attr('string') }); + +Model.reopenClass({ + FIXTURES: [ + { + "type":"service", + "id":"test-system123-service-1", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123" + }, + { + "type":"service", + "id":"test-system123-service-2", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123" + }, + { + "type":"service", + "id":"test-system123-service-3", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123" + }, + { + "type":"service", + "id":"test-system123-service-4", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123" + }, + { + "type":"service", + "id":"test-system123-service-5", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123" + }, + { + "type":"service", + "id":"test-system123-service-6", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123" + } + ] +}); + +export default Model; \ No newline at end of file diff --git a/app/models/serviceinstance.js b/app/models/serviceinstance.js index ca04171c010117a091d256af786b839dd0fcb1b1..60c4e7051760531e8e1cbbd1eba28c7cb9b315f4 100644 --- a/app/models/serviceinstance.js +++ b/app/models/serviceinstance.js @@ -1,8 +1,81 @@ import BaseEntity from './baseentity'; import attr from 'ember-data/attr'; -export default BaseEntity.extend({ +const Model = BaseEntity.extend({ name: attr('string'), nodeId: attr('string'), serviceId: attr('string') }); + +Model.reopenClass({ + FIXTURES: [ + { + "type":"serviceInstance", + "id":"test-system123-serviceInstance-4", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123", + "name":"Inventory", + "nodeId":"test-system123-node-2", + "serviceId":"test-system123-service-4" + }, + { + "type":"serviceInstance", + "id":"test-system123-serviceInstance-5", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123", + "name":"Data", + "nodeId":"test-system123-node-3", + "serviceId":"test-system123-service-5" + }, + { + "type":"serviceInstance", + "id":"test-system123-serviceInstance-6", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123", + "name":"PostgreSQL", + "nodeId":"test-system123-node-4", + "serviceId":"test-system123-service-6" + }, + { + "type":"serviceInstance", + "id":"test-system123-serviceInstance-1", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123", + "name":"FrontEnd", + "nodeId":"test-system123-node-1", + "serviceId":"test-system123-service-1" + }, + { + "type":"serviceInstance", + "id":"test-system123-serviceInstance-2", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123", + "name":"WebService", + "nodeId":"test-system123-node-2", + "serviceId":"test-system123-service-2" + }, + { + "type":"serviceInstance", + "id":"test-system123-serviceInstance-3", + "changelogSequence":0, + "lastUpdate":"2016-06-20T12:46:29.818+02:00", + "revisionNumber":0, + "systemId":"system123", + "name":"CashDesk", + "nodeId":"test-system123-node-2", + "serviceId":"test-system123-service-3" + } + ] +}); + +export default Model; \ No newline at end of file diff --git a/app/models/system.js b/app/models/system.js index fc060574809a5265660f51e7923cce9781db94dd..037318cd56e3ad7c567603a96cbe0df0d2e4075a 100644 --- a/app/models/system.js +++ b/app/models/system.js @@ -1,6 +1,16 @@ import BaseEntity from './baseentity'; import attr from 'ember-data/attr'; -export default BaseEntity.extend({ +const Model = BaseEntity.extend({ name: attr('string') }); + +Model.reopenClass({ + FIXTURES: [{ + "type": "system", + "id": "system123", + "name": "Test System" + }] +}); + +export default Model; \ No newline at end of file diff --git a/package.json b/package.json index 9ee82e6cf77dc6b73517314ec6933ab1e46d093e..14e3fa5464904c407696cc93b7354e9ad337dfb8 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "ember-cli-uglify": "^1.2.0", "ember-cli-yuidoc": "0.8.3", "ember-data": "^2.4.0", + "ember-data-fixture-adapter": "1.13.0", "ember-data-url-templates": "0.1.1", "ember-debug-logger": "0.2.0", "ember-disable-proxy-controllers": "^1.0.1",