-
Notifications
You must be signed in to change notification settings - Fork 17
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
36 changed files
with
1,174 additions
and
719 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,23 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
[*.scss] | ||
indent_size = 2 | ||
|
||
[*.hbs] | ||
insert_final_newline = false | ||
|
||
[*.{diff,md}] | ||
trim_trailing_whitespace = false |
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,3 @@ | ||
{ | ||
"ignore_dirs": ["tmp", "dist"] | ||
} |
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 |
---|---|---|
@@ -1,21 +1,43 @@ | ||
import { filterBy } from '@ember/object/computed'; | ||
import { computed } from '@ember/object'; | ||
import Component from '@ember/component'; | ||
import { loadRelation } from 'ember-osf/utils/load-relationship'; | ||
import { inject as service } from '@ember/service'; | ||
|
||
import { task } from 'ember-concurrency'; | ||
|
||
|
||
export default Component.extend({ | ||
store: service(), | ||
|
||
const ContributorListComponent = Component.extend({ | ||
tagName: 'ul', | ||
node: null, | ||
|
||
bibliographicContributors: filterBy('contributors', 'bibliographic', true), | ||
bibliographicContributors: filterBy('contributorsList', 'bibliographic', true), | ||
|
||
didReceiveAttrs() { | ||
this.set('contributorsList', this.get('contributors') || []); | ||
if (!this.get('contributors.length') || this.get('contributors.content.meta.total') > this.get('contributors.length')) { | ||
this.get('fetchData').perform(); | ||
} | ||
}, | ||
|
||
fetchData: task(function* () { | ||
const node = this.get('node.content'); | ||
const query = { | ||
'page[size]': 100, | ||
page: 1, | ||
}; | ||
|
||
contributors: computed('node', function() { | ||
return loadRelation(this.get('node'), 'contributors'); | ||
let response = yield this.get('loadContributors').perform(node, query); | ||
|
||
while (response.links.next) { | ||
query.page++; | ||
response = yield this.get('loadContributors').perform(node, query); | ||
} | ||
}), | ||
}); | ||
|
||
ContributorListComponent.reopenClass({ | ||
positionalParams: ['node'], | ||
loadContributors: task(function* (node, query) { | ||
const results = yield this.get('store').queryHasMany(node, 'contributors', query); | ||
this.get('contributorsList').pushObjects(results.toArray()); | ||
return results; | ||
}), | ||
}); | ||
|
||
export default ContributorListComponent; |
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,8 @@ | ||
.file-renderer--skeleton { | ||
height: 700px; | ||
width: 99%; | ||
} | ||
|
||
.ember-content-placeholders-img { | ||
height: 100%; | ||
} |
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,3 @@ | ||
{{#content-placeholders as |placeholder|}} | ||
<div class="file-renderer--skeleton">{{placeholder.img}}</div> | ||
{{/content-placeholders}} |
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 |
---|---|---|
@@ -1,7 +1,5 @@ | ||
& { | ||
.file-list { | ||
padding: 15px; | ||
display: flex; | ||
justify-content: flex-start; | ||
} | ||
.file-list { | ||
display: flex; | ||
justify-content: flex-start; | ||
padding: 15px; | ||
} |
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
Oops, something went wrong.