-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
108 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import OsfAdapter from './osf-adapter'; | ||
|
||
export default OsfAdapter.extend({ | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import Ember from 'ember'; | ||
import DS from 'ember-data'; | ||
|
||
import OsfModel from './osf-model'; | ||
|
||
export default OsfModel.extend({ | ||
currentUser: Ember.inject.service('current-user'), | ||
|
||
title: DS.attr('fixstring'), | ||
shortTitle: DS.attr('fixstring'), | ||
summary: DS.attr('fixstring'), | ||
created: DS.attr('date'), | ||
modified: DS.attr('date'), | ||
dateParsed: DS.attr('date'), | ||
hasBibliography: DS.attr('boolean'), | ||
nodeCitation: DS.attr('fixstring'), | ||
|
||
fetchCitation(node) { | ||
const citationLink = node.get('links.relationships.citation.links.related.href'); | ||
const id = this.get('id'); | ||
|
||
return this.get('currentUser').authenticatedAJAX({ url: `${citationLink}${id}` }) | ||
.done(response => { | ||
this.set('nodeCitation', response.data.attributes.citation); | ||
}); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import OsfSerializer from './osf-serializer'; | ||
|
||
export default OsfSerializer.extend({ | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'ember-osf/adapters/citation-style'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'ember-osf/models/citation-style'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'ember-osf/serializers/citation-style'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import FactoryGuy from 'ember-data-factory-guy'; | ||
import faker from 'faker'; | ||
|
||
FactoryGuy.define('citation-style', { | ||
default: { | ||
title: () => faker.lorem.word(), | ||
shortTitle: () => faker.lorem.words(3), | ||
summary: () => faker.lorem.words(10), | ||
created: () => faker.date.past(1), | ||
modified: () => faker.date.recent(1), | ||
dateParsed: () => faker.date.recent(1), | ||
hasBibliography: () => faker.random.boolean(), | ||
nodeCitation: () => faker.lorem.words(10) | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { moduleForModel, test } from 'ember-qunit'; | ||
|
||
moduleForModel('citation-style', 'Unit | Model | citation style', { | ||
// Specify the other units that are required for this test. | ||
needs: [] | ||
}); | ||
|
||
test('it exists', function(assert) { | ||
let model = this.subject(); | ||
assert.ok(!!model); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters