Skip to content

Commit

Permalink
Feature/provider defaults (#760)
Browse files Browse the repository at this point in the history
* [ENG-4460] Toggle assertions based on preprint-provider flag (#756)

* Toggle assertions based on preprint-provider flag

* Update test

* Point package.json to eosf feature branch temporarily

* Add tests for assertionsEnabled

* Update yarn.lock (#757)

* [ENG-4585] Remove Chronos (#759)

* remove chronos

* remove styles and translations

---------

Co-authored-by: Yuhuai Liu <yuhuai@cos.io>
  • Loading branch information
futa-ikeda and adlius committed Sep 15, 2023
1 parent dc08eea commit 684a30a
Show file tree
Hide file tree
Showing 18 changed files with 383 additions and 566 deletions.
136 changes: 0 additions & 136 deletions app/components/chronos-submission-panel/component.js

This file was deleted.

28 changes: 0 additions & 28 deletions app/components/chronos-submission-panel/template.hbs

This file was deleted.

49 changes: 0 additions & 49 deletions app/components/chronos-submission-status-list-row/component.js

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions app/components/chronos-submission-status-list/component.js

This file was deleted.

9 changes: 0 additions & 9 deletions app/components/chronos-submission-status-list/template.hbs

This file was deleted.

28 changes: 0 additions & 28 deletions app/components/chronos-widget/component.js

This file was deleted.

1 change: 0 additions & 1 deletion app/components/chronos-widget/template.hbs

This file was deleted.

5 changes: 0 additions & 5 deletions app/controllers/content/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,6 @@ export default Controller.extend(Analytics, {
return `mailto:?subject=${titleEncoded}&body=${hrefEncoded}`;
}),

isChronosProvider: computed('model.provider.id', function() {
const { chronosProviders } = config;
return Array.isArray(chronosProviders) && chronosProviders.includes(this.get('model.provider.id'));
}),

actions: {
toggleLicenseText() {
const licenseState = this.toggleProperty('showLicenseText') ? 'Expand' : 'Contract';
Expand Down
33 changes: 22 additions & 11 deletions app/controllers/submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ export default Controller.extend(Analytics, BasicsValidations, COIValidations, N
doiValid: alias('validations.attrs.basicsDOI.isValid'),
originalPublicationDateValid: alias('validations.attrs.basicsOriginalPublicationDate.isValid'),

assertionsEnabled: alias('selectedProvider.assertionsEnabled'),
coiStatementValid: alias('validations.attrs.coiStatement.isValid'),

// Basics fields that are being validated are abstract, license and doi
Expand Down Expand Up @@ -315,12 +316,20 @@ export default Controller.extend(Analytics, BasicsValidations, COIValidations, N

moderationType: alias('currentProvider.reviewsWorkflow'),

Check warning on line 317 in app/controllers/submit.js

View workflow job for this annotation

GitHub Actions / test-with-coverage

The "moderationType" single-line function should be above the "savedAuthorAssertions" multi-line function on line 298

_names: ['Server', 'File', 'Assertions', 'Basics', 'Discipline', 'Authors', 'COI', 'Supplemental'],
_names: computed('assertionsEnabled', function () {
if (this.get('assertionsEnabled')) {
return ['Server', 'File', 'Assertions', 'Basics', 'Discipline', 'Authors', 'COI', 'Supplemental'];
}
return ['Server', 'File', 'Basics', 'Discipline', 'Authors', 'Supplemental'];
}),

// Preprint can be published once all required sections have been saved.
allSectionsValid: computed('savedTitle', 'savedFile', 'savedAbstract', 'savedSubjects', 'authorsValid', 'savedCoi', 'savedAuthorAssertions', function() {
allSectionsValid: computed('savedTitle', 'savedFile', 'savedAbstract', 'savedSubjects', 'authorsValid', 'savedCoi', 'savedAuthorAssertions', 'assertionsEnabled', function() {
const allSectionsValid = this.get('savedTitle') && this.get('savedFile') && this.get('savedAbstract') && this.get('savedSubjects') && this.get('authorsValid');
return allSectionsValid && this.get('savedCoi') && this.get('savedAuthorAssertions');
if (this.get('assertionsEnabled')) {
return allSectionsValid && this.get('savedCoi') && this.get('savedAuthorAssertions');
}
return allSectionsValid;
}),

supplementalChanged: computed('supplementalProjectTitle', 'pendingSupplementalProjectTitle', 'selectedSupplementalProject', 'node', function() {
Expand Down Expand Up @@ -1418,14 +1427,16 @@ export default Controller.extend(Analytics, BasicsValidations, COIValidations, N
label: `${this.get('editMode') ? 'Edit' : 'Submit'} - Save and Continue Author Assertions Section`,
});
const model = this.get('model');
model.set('hasDataLinks', this.get('hasDataLinks'));
model.set('dataLinks', this.get('dataLinks'));
model.set('whyNoData', this.get('whyNoData'));

model.set('hasPreregLinks', this.get('hasPreregLinks'));
model.set('preregLinks', this.get('preregLinks'));
model.set('preregLinkInfo', this.get('preregLinkInfo'));
model.set('whyNoPrereg', this.get('whyNoPrereg'));
if (this.get('assertionsEnabled')) {
model.set('hasDataLinks', this.get('hasDataLinks'));
model.set('dataLinks', this.get('dataLinks'));
model.set('whyNoData', this.get('whyNoData'));

model.set('hasPreregLinks', this.get('hasPreregLinks'));
model.set('preregLinks', this.get('preregLinks'));
model.set('preregLinkInfo', this.get('preregLinkInfo'));
model.set('whyNoPrereg', this.get('whyNoPrereg'));
}

model.save().then(this._moveFromAuthorAssertions.bind(this))
.catch(error => this._failMoveFromAuthorAssertions.bind(this)(error));
Expand Down
11 changes: 0 additions & 11 deletions app/locales/en/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,17 +353,6 @@ export default {
title: 'Claim Account',
success_message: 'Email will arrive shortly. Please check {{email}}',
},
'chronos-submission-status-list-row': {
drafted: 'Drafted to <i>{{title}}</i>',
submitted: 'Submitted to <i>{{title}}</i>',
accepted: 'Accepted to <i>{{title}}</i>',
rejected: 'Rejected from <i>{{title}}</i>',
published: 'Published in <i>{{title}}</i>',
},
'chronos-submission-panel': {
link_text: 'Submit to an APA-published journal (beta)',
helper_text: 'A new tab will open to complete submission on Chronos.',
},
'error-page': {
email_message: 'If this should not have occurred and the issue persists, please report it to',
go_to: 'Go to {{brand}}',
Expand Down
21 changes: 0 additions & 21 deletions app/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -435,27 +435,6 @@ $color-bg-color-grey: #333333;
$color-bg-color-light: #EEEEEE;
$color-border-light: #DDDDDD;

/* Chronos Submission Status */
.chronos-status-drafted {
color: $color-alert-text-warning;
}

.chronos-status-submitted {
color: $color-alert-text-warning;
}

.chronos-status-accepted {
color: $color-alert-text-success;
}

.chronos-status-rejected {
color: $color-alert-text-danger;
}

.chronos-status-published {
color: $color-alert-text-success;
}

.preprint-status-pending-pre {
background-color: $color-alert-bg-warning;
border: 1px solid $color-alert-border-warning;
Expand Down
Loading

0 comments on commit 684a30a

Please sign in to comment.