Skip to content

Commit

Permalink
Fix submit; update template-lintrc (#574)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexschiller authored May 31, 2018
1 parent 4884593 commit ed5a077
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* jshint node:true */
'use strict';

module.exports = {
extends: 'recommended',
rules: {
'block-indentation': 4,
'bare-strings': false
'no-bare-strings': false
}
};
8 changes: 7 additions & 1 deletion app/controllers/submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { inject as service } from '@ember/service';
import { merge } from '@ember/polyfills';
import { run } from '@ember/runloop';
import Controller from '@ember/controller';
import { isEmpty } from '@ember/utils';

import config from 'ember-get-config';
import { validator, buildValidations } from 'ember-cp-validations';
Expand Down Expand Up @@ -308,7 +309,12 @@ export default Controller.extend(Analytics, BasicsValidations, NodeActionsMixin,

// Does the pending title differ from the title already saved?
titleChanged: computed('model.title', 'title', function() {
return this.get('model.title') !== this.get('title');
const title = this.get('title');
const modelTitle = this.get('model.title');
if (isEmpty(title) && isEmpty(modelTitle)) {
return false;
}
return modelTitle !== title;
}),

// Pending abstract
Expand Down
1 change: 0 additions & 1 deletion app/routes/submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export default Route.extend(ConfirmationMixin, ResetScrollMixin, CasAuthenticate
// internally during submission process.
return this.get('store').createRecord('preprint', {
subjects: [],
title: '',
});
},
afterModel() {
Expand Down

0 comments on commit ed5a077

Please sign in to comment.