From ced3f7d2d26aa9191019a7a5fe91966d1a6ac536 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Wed, 18 Mar 2015 15:50:39 -0800 Subject: [PATCH] WIP - rebuilding from ground up --- app/adapters/application.js | 2 +- app/models/strain.js | 13 ++++++++ app/router.js | 3 ++ app/routes/strains.js | 4 +++ app/routes/strains/index.js | 7 +++++ app/routes/strains/show.js | 4 +++ app/templates/application.hbs | 4 ++- app/templates/strains.hbs | 1 + app/templates/strains/index.hbs | 19 ++++++++++++ app/templates/strains/show.hbs | 40 +++++++++++++++++++++++++ server/mocks/measurements.js | 2 +- server/mocks/strains.js | 2 +- tests/unit/models/strain-test.js | 15 ++++++++++ tests/unit/routes/strains-test.js | 14 +++++++++ tests/unit/routes/strains/index-test.js | 14 +++++++++ tests/unit/routes/strains/show-test.js | 14 +++++++++ 16 files changed, 154 insertions(+), 4 deletions(-) create mode 100644 app/models/strain.js create mode 100644 app/routes/strains.js create mode 100644 app/routes/strains/index.js create mode 100644 app/routes/strains/show.js create mode 100644 app/templates/strains.hbs create mode 100644 app/templates/strains/index.hbs create mode 100644 app/templates/strains/show.hbs create mode 100644 tests/unit/models/strain-test.js create mode 100644 tests/unit/routes/strains-test.js create mode 100644 tests/unit/routes/strains/index-test.js create mode 100644 tests/unit/routes/strains/show-test.js diff --git a/app/adapters/application.js b/app/adapters/application.js index 1295b07..70db61e 100644 --- a/app/adapters/application.js +++ b/app/adapters/application.js @@ -2,6 +2,6 @@ import DS from 'ember-data'; import config from '../config/environment'; export default DS.RESTAdapter.reopen({ - namespace: 'api', + namespace: 'api/hymenobacter', host: config.apiURL }); diff --git a/app/models/strain.js b/app/models/strain.js new file mode 100644 index 0000000..3bd7de2 --- /dev/null +++ b/app/models/strain.js @@ -0,0 +1,13 @@ +import DS from 'ember-data'; + +export default DS.Model.extend({ + strainName: DS.attr('string'), + strainType: DS.attr('string'), + etymology: DS.attr('string'), + accessionBanks: DS.attr('string'), + genbankEmblDdb: DS.attr('string'), + isolatedFrom: DS.attr('string'), + createdAt: DS.attr('date'), + updatedAt: DS.attr('date'), + deletedAt: DS.attr('date') +}); diff --git a/app/router.js b/app/router.js index b4acf36..4f8d6ef 100644 --- a/app/router.js +++ b/app/router.js @@ -8,6 +8,9 @@ var Router = Ember.Router.extend({ Router.map(function() { this.route('login'); this.route('about'); + this.resource('strains', function() { + this.route('show', { path: ':strain_id' }); + }); }); export default Router; diff --git a/app/routes/strains.js b/app/routes/strains.js new file mode 100644 index 0000000..26d9f31 --- /dev/null +++ b/app/routes/strains.js @@ -0,0 +1,4 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ +}); diff --git a/app/routes/strains/index.js b/app/routes/strains/index.js new file mode 100644 index 0000000..eb8fe88 --- /dev/null +++ b/app/routes/strains/index.js @@ -0,0 +1,7 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ + model: function() { + return this.store.findAll('strain'); + } +}); diff --git a/app/routes/strains/show.js b/app/routes/strains/show.js new file mode 100644 index 0000000..26d9f31 --- /dev/null +++ b/app/routes/strains/show.js @@ -0,0 +1,4 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ +}); diff --git a/app/templates/application.hbs b/app/templates/application.hbs index e0162e3..37e6b90 100644 --- a/app/templates/application.hbs +++ b/app/templates/application.hbs @@ -3,7 +3,9 @@ {{/link-to}}