diff --git a/app/components/chronos-submission-panel/component.js b/app/components/chronos-submission-panel/component.js
deleted file mode 100644
index dcc883543..000000000
--- a/app/components/chronos-submission-panel/component.js
+++ /dev/null
@@ -1,136 +0,0 @@
-import Component from '@ember/component';
-import { inject as service } from '@ember/service';
-import { task, timeout, all } from 'ember-concurrency';
-import { A } from '@ember/array';
-import config from 'ember-get-config';
-
-export default Component.extend({
- store: service(),
- toast: service(),
- isLoading: false,
- canLoadMore: false,
- page: 1,
- selectedJournal: null,
- keyword: '',
- preprint: null,
- journals: A(),
- publisherFilterKeyword: null,
- isOpen: false,
-
- didReceiveAttrs() {
- this.get('_fetchAllApprovedJournals').perform();
- },
-
- actions: {
- /*
- This action is not used because we only need 7 journals from APA
- */
- getInitialJournals(keyword) {
- this.get('_fetchInitialJournals').perform(keyword);
- },
- /*
- This action is not used because we only need 7 journals from APA
- */
- getMoreJournals() {
- this.get('_fetchMoreJournals').perform();
- },
- journalSelected(journal) {
- this.set('selectedJournal', journal);
- },
- cancelSubmission() {
- this.set('selectedJournal', null);
- },
- },
-
- _fetchAllApprovedJournals: task(function* () {
- const approvedJournals = yield this.get('store').query(
- 'chronos-journal',
- {
- page: 1,
- 'filter[id]': config.approvedChronosJournalIds.join(','),
- 'page[size]': 100,
- },
- );
- this.set('journals', approvedJournals);
- }),
- /*
- This function is not used because we only need 7 journals for APA.
- */
- _fetchInitialJournals: task(function* (keyword) {
- // Wait a bit for the user to finish typing.
- yield timeout(500);
- // Reset the list of journals
- this.set('journals', A());
- // Reset page number
- this.set('page', 1);
- this.set('isLoading', true);
- const journals = yield this.get('store').query('chronos-journal', { page: 1, 'filter[title]': keyword, 'filter[name]': this.get('publisherFilterKeyword') });
- this.set('isLoading', false);
- const canLoadMore = !(journals.get('meta.total_pages') === this.get('page'));
- // Set the keyword
- this.set('keyword', keyword);
- this.set('canLoadMore', canLoadMore);
- this.set('journals', journals);
- }).restartable(),
-
- /*
- This function is not used because we only need 7 journals for APA.
- */
- _fetchMoreJournals: task(function* () {
- const journals = this.get('journals');
- const page = this.get('page');
- const keyword = this.get('keyword');
- this.set('isLoading', true);
- const moreJournals = yield this.get('store').query('chronos-journal', { page: page + 1, 'filter[title]': keyword, 'filter[name]': this.get('publisherFilterKeyword') });
- journals.pushObjects(moreJournals.toArray().map(item => item._internalModel));
- this.set('isLoading', false);
- const canLoadMore = page + 1 < journals.get('meta.total_pages');
- if (canLoadMore) {
- this.set('page', page + 1);
- }
- this.set('canLoadMore', canLoadMore);
- }).enqueue(),
- /*
- Update all chronos-submissions status
- */
- _updateChronosSubmissions: task(function* () {
- if (this.get('isOpen')) {
- this.set('isOpen', false);
- return;
- } else {
- this.set('isOpen', true);
- }
- const submissions = yield this.get('store').peekAll('chronos-submission');
- const childTasks = [];
- submissions.forEach(function (item) {
- if (item.get('preprint.id') === this.get('preprint.id')) {
- childTasks.push(this.get('_updateStatus').perform(item));
- }
- }.bind(this));
- yield all(childTasks);
- }).drop(),
- /*
- Update status of a single chronos-submission, called by _updateChronosSubmissions.
- */
- _updateStatus: task(function* (chronosSubmission) {
- yield chronosSubmission.save();
- }).drop().maxConcurrency(7),
- /*
- Task to submit to chronos
- */
- _submit: task(function* () {
- const newTab = window.open();
- const submission = this.get('store').createRecord('chronos-submission', {
- journal: this.get('selectedJournal'),
- preprint: this.get('preprint'),
- });
- try {
- yield submission.save();
- newTab.location.href = submission.get('submissionUrl');
- window.location.reload(true);
- } catch (e) {
- newTab.close();
- this.get('toast').error(e.errors[0].detail);
- }
- }).drop(),
-});
diff --git a/app/components/chronos-submission-panel/template.hbs b/app/components/chronos-submission-panel/template.hbs
deleted file mode 100644
index f6c6816bf..000000000
--- a/app/components/chronos-submission-panel/template.hbs
+++ /dev/null
@@ -1,28 +0,0 @@
-{{#cp-panel}}
- {{#cp-panel-toggle}}
-
{{t 'components.chronos-submission-panel.link_text'}}
- {{/cp-panel-toggle}}
-
- {{#cp-panel-body}}
-
- {{!-- This section is commented out because we only need 7 APA journals.
- {{#power-select search=(perform _fetchInitialJournals) optionsComponent=(component 'lazy-options' loadMore=(action "getMoreJournals") isLoading=isLoading canLoadMore=canLoadMore) options=journals placeholder="Select a journal" selected=selectedJournal onfocus=(action "getInitialJournals" "") oninput=(action "getInitialJournals") onchange=(action "journalSelected") as |journal|}}
- {{journal.title}}
- {{/power-select}}
- --}}
- {{#power-select options=journals placeholder="Select a journal" selected=selectedJournal onchange=(action "journalSelected") searchField="title" as |journal|}}
- {{journal.title}}
- {{/power-select}}
-
- {{#if selectedJournal}}
-
-
{{t 'components.chronos-submission-panel.helper_text'}}
-
-
-
-
-
-
- {{/if}}
- {{/cp-panel-body}}
-{{/cp-panel}}
diff --git a/app/components/chronos-submission-status-list-row/component.js b/app/components/chronos-submission-status-list-row/component.js
deleted file mode 100644
index 5cda3c373..000000000
--- a/app/components/chronos-submission-status-list-row/component.js
+++ /dev/null
@@ -1,49 +0,0 @@
-import Component from '@ember/component';
-import { inject as service } from '@ember/service';
-import { computed } from '@ember/object';
-
-const DRAFTED = 'DRAFT';
-const SUBMITTED = 'SUBMITTED';
-const ACCEPTED = 'ACCEPTED';
-const REJECTED = 'CANCELLED';
-const PUBLISHED = 'PUBLISHED';
-
-const STATUS_ICON = {
- [DRAFTED]: 'fa-file-text-o',
- [SUBMITTED]: 'fa-hourglass-o',
- [ACCEPTED]: 'fa-check-circle-o',
- [REJECTED]: 'fa-times-circle-o',
- [PUBLISHED]: 'fa-book',
-};
-
-const ICON_CLASS = {
- [DRAFTED]: 'chronos-status-drafted',
- [SUBMITTED]: 'chronos-status-submitted',
- [ACCEPTED]: 'chronos-status-accepted',
- [REJECTED]: 'chronos-status-rejected',
- [PUBLISHED]: 'chronos-status-published',
-};
-
-const STATUS_LANGUAGE = {
- [DRAFTED]: 'components.chronos-submission-status-list-row.drafted',
- [SUBMITTED]: 'components.chronos-submission-status-list-row.submitted',
- [ACCEPTED]: 'components.chronos-submission-status-list-row.accepted',
- [REJECTED]: 'components.chronos-submission-status-list-row.rejected',
- [PUBLISHED]: 'components.chronos-submission-status-list-row.published',
-};
-
-
-export default Component.extend({
- i18n: service(),
- submission: null,
- isContributor: false,
- statusIcon: computed('submission.status', function () {
- return STATUS_ICON[this.get('submission.status')];
- }),
- statusIconClass: computed('submission.status', function () {
- return ICON_CLASS[this.get('submission.status')];
- }),
- statusLanguage: computed('submission.{status,journal.title}', function () {
- return this.get('i18n').t(STATUS_LANGUAGE[this.get('submission.status')], { title: this.get('submission.journal.title') });
- }),
-});
diff --git a/app/components/chronos-submission-status-list-row/template.hbs b/app/components/chronos-submission-status-list-row/template.hbs
deleted file mode 100644
index 24140bd55..000000000
--- a/app/components/chronos-submission-status-list-row/template.hbs
+++ /dev/null
@@ -1,6 +0,0 @@
-
- {{fa-icon statusIcon class=statusIconClass}} {{statusLanguage}}
- {{#if submission.submissionUrl}}
-
- {{/if}}
-
diff --git a/app/components/chronos-submission-status-list/component.js b/app/components/chronos-submission-status-list/component.js
deleted file mode 100644
index cdcffa828..000000000
--- a/app/components/chronos-submission-status-list/component.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import Component from '@ember/component';
-import { inject as service } from '@ember/service';
-
-export default Component.extend({
- store: service(),
- submissions: null,
-});
diff --git a/app/components/chronos-submission-status-list/template.hbs b/app/components/chronos-submission-status-list/template.hbs
deleted file mode 100644
index 517324918..000000000
--- a/app/components/chronos-submission-status-list/template.hbs
+++ /dev/null
@@ -1,9 +0,0 @@
-{{#each submissions as |submission|}}
- {{#if isContributor}}
- {{chronos-submission-status-list-row submission=submission isContributor=isContributor}}
- {{else}}
- {{#if (or (eq submission.status "ACCEPTED") (eq submission.status "PUBLISHED"))}}
- {{chronos-submission-status-list-row submission=submission isContributor=isContributor}}
- {{/if}}
- {{/if}}
-{{/each}}
diff --git a/app/components/chronos-widget/component.js b/app/components/chronos-widget/component.js
deleted file mode 100644
index 422e23a1f..000000000
--- a/app/components/chronos-widget/component.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import Component from '@ember/component';
-import { inject as service } from '@ember/service';
-import { task } from 'ember-concurrency';
-
-export default Component.extend({
- store: service(),
- preprint: null,
- submissions: null,
- isAllowSubmissions: false,
- isAdmin: false,
- isContributor: false,
- didReceiveAttrs() {
- this.get('fetchSubmissions').perform(this.get('preprint.id'));
- },
- fetchSubmissions: task(function* (preprintId) {
- const submissions = yield this.get('store').query('chronos-submission', { preprintId });
- this.set('submissions', submissions);
- const submittedOrRejectedSubmissions = submissions.filter((item) => {
- const status = item.get('status');
- return status === 'SUBMITTED' || status === 'PUBLISHED' || status === 'ACCEPTED';
- });
- if (submittedOrRejectedSubmissions.length > 0) {
- this.set('isAllowSubmissions', false);
- } else if (this.get('isAdmin') && this.get('preprint.reviewsState') === 'accepted' && (this.get('preprint.provider.reviewsWorkflow') === 'pre-moderation' || this.get('preprint.provider.reviewsWorkflow') === 'post-moderation')) {
- this.set('isAllowSubmissions', true);
- }
- }),
-});
diff --git a/app/components/chronos-widget/template.hbs b/app/components/chronos-widget/template.hbs
deleted file mode 100644
index 2164b5517..000000000
--- a/app/components/chronos-widget/template.hbs
+++ /dev/null
@@ -1 +0,0 @@
-{{ yield preprint submissions isAllowSubmissions isContributor }}
\ No newline at end of file
diff --git a/app/controllers/content/index.js b/app/controllers/content/index.js
index a66bb25f4..7bd0eef2c 100644
--- a/app/controllers/content/index.js
+++ b/app/controllers/content/index.js
@@ -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';
diff --git a/app/controllers/submit.js b/app/controllers/submit.js
index 319a51232..50ab46b80 100644
--- a/app/controllers/submit.js
+++ b/app/controllers/submit.js
@@ -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
@@ -315,12 +316,20 @@ export default Controller.extend(Analytics, BasicsValidations, COIValidations, N
moderationType: alias('currentProvider.reviewsWorkflow'),
- _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() {
@@ -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));
diff --git a/app/locales/en/translations.js b/app/locales/en/translations.js
index c635cd3f1..e9aed9b4f 100644
--- a/app/locales/en/translations.js
+++ b/app/locales/en/translations.js
@@ -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 {{title}}',
- submitted: 'Submitted to {{title}}',
- accepted: 'Accepted to {{title}}',
- rejected: 'Rejected from {{title}}',
- published: 'Published in {{title}}',
- },
- '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}}',
diff --git a/app/styles/app.scss b/app/styles/app.scss
index d5b05703b..648c706eb 100644
--- a/app/styles/app.scss
+++ b/app/styles/app.scss
@@ -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;
diff --git a/app/templates/content/index.hbs b/app/templates/content/index.hbs
index 759d927ed..39949460d 100644
--- a/app/templates/content/index.hbs
+++ b/app/templates/content/index.hbs
@@ -129,19 +129,6 @@
}}
-
- {{#if (and this.isChronosProvider this.features.enableChronos)}}
-
- {{#chronos-widget preprint=model isContributor=userIsContrib isAdmin=isAdmin as | preprint submissions isAllowSubmissions isContributor | }}
- {{chronos-submission-status-list submissions=submissions isContributor=isContributor}}
- {{#if isAllowSubmissions }}
-
- {{chronos-submission-panel preprint=preprint publisherFilterKeyword="American Psychological Association"}}
-
- {{/if}}
- {{/chronos-widget}}
-
- {{/if}}