Skip to content

Commit

Permalink
[IN-65][Preprints] Add ESlint, Fix Errors (#565)
Browse files Browse the repository at this point in the history
* merge

Enable Eslint

First eslint pass

Fix eslint issues

Undo lint fix and disable

* Fix merge issues

* Use latest ember-osf

* Add coverage.js and bump ember-cli-code-coverage version

* Fix more ESlint, packages, and remove unneeded comments

* Fix sendAction issue, toggles, and css

* Add daterangepicker back to ember-cli-build
  • Loading branch information
alexschiller authored May 17, 2018
1 parent 1222452 commit 8b38417
Show file tree
Hide file tree
Showing 151 changed files with 3,780 additions and 3,259 deletions.
13 changes: 2 additions & 11 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 6,
sourceType: 'module'
},
extends: 'eslint:recommended',
env: {
browser: true,
es6: true
},
extends: '@centerforopenscience/eslint-config/ember',
globals: {
MathJax: true
MathJax: true,
},
rules: {}
};
2 changes: 1 addition & 1 deletion app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Resolver from './resolver';
const App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver
Resolver,
});

loadInitializers(App, config.modulePrefix);
Expand Down
6 changes: 4 additions & 2 deletions app/components/add-preprint-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import Analytics from 'ember-osf/mixins/analytics';
*/

/**
* Add preprint box - Component of portion of preprints discover page - asks users if they want to create a preprint
* Add preprint box
* Component of portion of preprints discover page.
* Asks users if they want to create a preprint
*
* Sample usage:
* ```handlebars
Expand All @@ -18,5 +20,5 @@ import Analytics from 'ember-osf/mixins/analytics';
* @class add-preprint-box
*/
export default Component.extend(Analytics, {
theme: service()
theme: service(),
});
4 changes: 2 additions & 2 deletions app/components/additional-provider-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export default Component.extend(Analytics, {
const sortedList = this.get('additionalProviders').sort();
const pairedList = [];
for (let i = 0; i < sortedList.get('length'); i += 2) {
let pair = [];
const pair = [];
pair.pushObject(sortedList.objectAt(i));
if (sortedList.objectAt(i + 1)) {
pair.pushObject(sortedList.objectAt(i + 1));
}
pairedList.pushObject(pair);
}
return pairedList;
})
}),
});
11 changes: 7 additions & 4 deletions app/components/confirm-share-preprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import Analytics from 'ember-osf/mixins/analytics';
*/

/**
* Confirm share preprint modal - Requires user to confirm they wish to submit their preprint, thus making it public and searchable
* Confirm share preprint modal
*
* Requires user to confirm they wish to submit their preprint,
* thus making it public and searchable
*
* Sample usage:
* ```handlebars
Expand All @@ -28,9 +31,9 @@ export default Component.extend(Analytics, {
.trackEvent({
category: 'button',
action: 'click',
label: 'Submit - Cancel Share Preprint'
label: 'Submit - Cancel Share Preprint',
});
this.set('isOpen', false);
}
}
},
},
});
23 changes: 13 additions & 10 deletions app/components/convert-or-copy-project.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ import Analytics from 'ember-osf/mixins/analytics';
*/

/**
* Convert Or Copy Widget - very simple, just presents decision, do you want to convert this project or copy file to a new component.
* Convert Or Copy Widget
*
* Will set convertOrCopy to 'convert' or 'copy'. If convert, will set node title as current node title and titleValid to
* true. If 'copy', title will be set equal to null, and titleValid to false. Converting a project requires the user confirm their
* decision in an additional step.
* Very simple, just presents decision, do you want to
* convert this project or copy file to a new component
*
* Will set convertOrCopy to 'convert' or 'copy'.
* If convert, will set node title as current node title and titleValid to true.
* If 'copy', title will be set equal to null, and titleValid to false.
* Converting a project requires the user confirm their decision in an additional step.
*
* Sample usage:
* ```handlebars
Expand Down Expand Up @@ -39,9 +43,8 @@ export default Component.extend(Analytics, {
.trackEvent({
category: 'button',
action: 'click',
label: 'Submit - Make a New Component Selection'
label: 'Submit - Make a New Component Selection',
});

},
chooseConvertExisting() {
// Decision to have the existing project contain the preprint
Expand All @@ -55,7 +58,7 @@ export default Component.extend(Analytics, {
.trackEvent({
category: 'button',
action: 'click',
label: 'Submit - Use the Current Project Selection'
label: 'Submit - Use the Current Project Selection',
});
},
confirmConvert() {
Expand All @@ -67,8 +70,8 @@ export default Component.extend(Analytics, {
.trackEvent({
category: 'button',
action: 'click',
label: 'Submit - Confirm Continue with the Current Project'
label: 'Submit - Confirm Continue with the Current Project',
});
}
}
},
},
});
4 changes: 2 additions & 2 deletions app/components/error-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default Component.extend(Analytics, {
classNames: ['preprint-header', 'preprint-header-error'],
label: '',
translationKey: '',
supportEmail: computed('theme.isProvider', 'theme.provider.emailSupport', function() {
supportEmail: computed('theme.{isProvider,provider.emailSupport}', function() {
return this.get('theme.isProvider') ? this.get('theme.provider.emailSupport') : '[email protected]';
})
}),
});
Loading

0 comments on commit 8b38417

Please sign in to comment.