Skip to content

Conversation

@hmoco
Copy link
Contributor

@hmoco hmoco commented Dec 14, 2017

Purpose

It would be nice to allow users to retrieve citations other than MLA, chicago and APA, just like projects do, specially since the API, and citeproc-py engine are already in place. This adds that section to the citation-widget currently used in preprints.

Summary of Changes

Add a citation picker to the citation-widget, allowing users to cite their preprints in any of our supported citation styles

Side Effects / Testing Notes

Due to the large amount of citation styles, pressing something usual, like a and then waiting will make quite a few requests. Doing that a few times will probably trigger some 429 responses.

Ticket

https://openscience.atlassian.net/browse/EOSF-883

Reviewer Checklist

  • meets requirements
  • easy to understand
  • DRY
  • testable and includes test(s) (asynchronous)
  • changes described in CHANGELOG.md

hmoco added 5 commits October 26, 2017 10:29
 * Added ember-concurrency for debouncing requests through .restartable()
 * Debounce logic using ember-concurrency's task, with yield
 * Styling and usage of the selected style onto template
@hmoco hmoco changed the title Feature/citation widget [EOSF-883] Add citation picker to citation-widget Dec 14, 2017
Copy link

@baylee-d baylee-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few small things.

<span> {{mla}} </span>
<div class="f-w-xl m-t-md">Chicago</div>
<span> {{chicago}} </span>
<div class="">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to have an empty class identifier?

}
},
_citationText: Ember.observer('selectedStyle', function() {
const citationLink = this.get('node.links.relationships.citation.links.related.href');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is also being set up in didReceiveAttrs(), would it make more sense to make a new variable citationLink: null up above and change the value of it in didReceiveAttrs() if needed? Then you'd only need to make a call to that variable here.

}
}
},
_citationText: Ember.observer('selectedStyle', function() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any way you can use a computed here instead of an observer?

Copy link

@baylee-d baylee-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just update to the latest develop to fix conflicts and get the changes for the ember-power-select style import.

@@ -0,0 +1,2 @@

@import "ember-power-select";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took back what I said earlier since there should be a fix for this now. You shouldn't have to do the @import "ember-power-select" with the newest version of ember-osf.

Copy link

@baylee-d baylee-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of super small last things, but after that it might be good to go

"ember-ace": "^1.2.0",
"ember-bootstrap-datepicker": "^2.0.3",
"ember-cli-babel": "6.4.1",
"ember-concurrency": "0.8.12",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to have ember-concurrency twice here in the same section?

Copy link
Contributor Author

@hmoco hmoco Feb 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope! fixed, good catch

<div>
<div id="citationList" class="m-b-md">
<div class="f-w-xl">APA</div>
<span>{{apa}} </span>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should maybe add a space in front of the APA citation to keep it consistent with the other styles

Copy link

@baylee-d baylee-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM!

@alexschiller alexschiller changed the title [EOSF-883] Add citation picker to citation-widget [IN-71][Preprints] Add citation picker to citation-widget Feb 8, 2018
@alexschiller alexschiller changed the base branch from develop to release/next-interfaces February 8, 2018 20:39
Copy link
Contributor

@alexschiller alexschiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I thought I saw merge conflicts on changelog, but I think changing base cleared those up 🤣

@alexschiller alexschiller merged commit b05df49 into CenterForOpenScience:release/next-interfaces Feb 9, 2018
@alexschiller alexschiller changed the title [IN-71][Preprints] Add citation picker to citation-widget [IN-71][EOSF] Add citation picker to citation-widget Feb 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants