diff --git a/.travis.yml b/.travis.yml index 895b134..de8dc13 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ branches: only: - master node_js: - - "6" + - "9" sudo: required dist: trusty addons: diff --git a/app/components/collection/detail-container.js b/app/components/collection/detail-container.js index 28057bb..66f9ba1 100644 --- a/app/components/collection/detail-container.js +++ b/app/components/collection/detail-container.js @@ -22,7 +22,7 @@ export default Component.extend({ { label: 'Species', valuePath: 'species.commonName' }, { label: 'Count', valuePath: 'count' }, { label: 'Count Estimated?', valuePath: 'countEstimated' }, - { label: 'Sex', valuePath: 'sex' }, + { label: 'Sex', valuePath: 'sex.name' }, ], envMeasColumns: [ diff --git a/app/controllers/collections/create.js b/app/controllers/collections/create.js index beb3511..9234268 100644 --- a/app/controllers/collections/create.js +++ b/app/controllers/collections/create.js @@ -16,7 +16,8 @@ export default Controller.extend(ValidationMixin, { options: computed('projectOptions', 'studyLocationOptions', 'collectionTypeOptions', 'collectionMethodOptions', - 'speciesOptions', 'adfgPermitOptions', function() { + 'speciesOptions', 'adfgPermitOptions', 'sexOptions', + function() { return { projects: this.get('projectOptions'), studyLocations: this.get('studyLocationOptions'), @@ -24,6 +25,7 @@ export default Controller.extend(ValidationMixin, { collectionMethods: this.get('collectionMethodOptions'), species: this.get('speciesOptions'), adfgPermits: this.get('adfgPermitOptions'), + sexes: this.get('sexOptions'), }; }), diff --git a/app/controllers/collections/detail/edit.js b/app/controllers/collections/detail/edit.js index 309a93c..6133707 100644 --- a/app/controllers/collections/detail/edit.js +++ b/app/controllers/collections/detail/edit.js @@ -16,7 +16,8 @@ export default Controller.extend(ValidationMixin, { options: computed('projectOptions', 'studyLocationOptions', 'collectionTypeOptions', 'collectionMethodOptions', - 'speciesOptions', 'adfgPermitOptions', function() { + 'speciesOptions', 'adfgPermitOptions', 'sexOptions', + function() { return { projects: this.get('projectOptions'), studyLocations: this.get('studyLocationOptions'), @@ -24,6 +25,7 @@ export default Controller.extend(ValidationMixin, { collectionMethods: this.get('collectionMethodOptions'), species: this.get('speciesOptions'), adfgPermits: this.get('adfgPermitOptions'), + sexes: this.get('sexOptions'), }; }), diff --git a/app/models/collection-species.js b/app/models/collection-species.js index 72d7c55..5839d7c 100644 --- a/app/models/collection-species.js +++ b/app/models/collection-species.js @@ -3,7 +3,7 @@ import DS from 'ember-data'; const { Model, attr, belongsTo } = DS; export default Model.extend({ - sex: attr('string'), + sex: belongsTo('sex'), count: attr('number'), countEstimated: attr('boolean', { defaultValue: false }), diff --git a/app/models/sex.js b/app/models/sex.js new file mode 100644 index 0000000..6f3b265 --- /dev/null +++ b/app/models/sex.js @@ -0,0 +1,8 @@ +import DS from 'ember-data'; + +const { Model, attr } = DS; + +export default Model.extend({ + name: attr('string'), + sortOrder: attr('number'), +}); diff --git a/app/routes/collections/create.js b/app/routes/collections/create.js index f31deb6..a0d9830 100644 --- a/app/routes/collections/create.js +++ b/app/routes/collections/create.js @@ -12,6 +12,7 @@ export default Route.extend({ collectionMethodOptions: store.findAll('collection-method'), speciesOptions: store.findAll('species'), adfgPermitOptions: store.findAll('adfg-permit'), + sexOptions: store.findAll('sex'), }); }, diff --git a/app/routes/collections/detail/edit.js b/app/routes/collections/detail/edit.js index 47edc53..7cd72a8 100644 --- a/app/routes/collections/detail/edit.js +++ b/app/routes/collections/detail/edit.js @@ -13,6 +13,7 @@ export default Route.extend({ collectionMethodOptions: store.findAll('collection-method'), speciesOptions: store.findAll('species'), adfgPermitOptions: store.findAll('adfg-permit'), + sexOptions: store.findAll('sex'), }); }, diff --git a/app/templates/components/collection/create-container.hbs b/app/templates/components/collection/create-container.hbs index c0c9fa0..0167738 100644 --- a/app/templates/components/collection/create-container.hbs +++ b/app/templates/components/collection/create-container.hbs @@ -143,7 +143,15 @@