Skip to content

Commit

Permalink
Add deposit status retry support
Browse files Browse the repository at this point in the history
  • Loading branch information
rpoet-jh committed Jan 23, 2025
1 parent e3866f4 commit b3003ad
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/components/submission-repo-details/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export default class SubmissionRepoDetails extends Component {
return 'failed';
}

if (deposit && get(deposit, 'depositStatus') === 'retry') {
return 'retry';
}

// Failed aggregatedDepositStatus means deposit never created
if (!deposit && source == 'pass' && get(this, 'submission.aggregatedDepositStatus') === 'failed') {
return 'failed';
Expand All @@ -51,6 +55,8 @@ export default class SubmissionRepoDetails extends Component {
return 'Your funder is aware of this publication and is expecting the deposit of your manuscript.';
case 'failed':
return `The system failed to receive the files for this submission.${depositStatusMsg} Please try again by starting a new submission`;
case 'retry':
return `The system failed to connect to the target repository. The deposit will be automatically retried later.`;
case 'rejected':
return 'This target repository has rejected your submission. Please contact us for more details or try to submit your manuscript again.';
case 'not-submitted':
Expand Down
2 changes: 2 additions & 0 deletions app/styles/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,8 @@ footer {
.stalled .fa-info-circle,
.failed > .fa-circle,
.failed .fa-info-circle,
.retry > .fa-circle,
.retry .fa-info-circle,
.rejected > .fa-circle,
.rejected .fa-info-circle {
color: #ff9e1b;
Expand Down
13 changes: 13 additions & 0 deletions tests/integration/components/submission-repo-details-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,17 @@ module('Integration | Component | submission repo details', (hooks) => {
'The system failed to receive the files for this submission. Please try again by starting a new submission',
);
});

test('renders deposit status message when present on retry', async function (assert) {
this.set('submission', EmberObject.create({ submitted: true }));
this.set('deposit', EmberObject.create({ depositStatus: 'retry' }));

await render(hbs`<SubmissionRepoDetails @deposit={{this.deposit}} @submission={{this.submission}} />`);
assert
.dom('span.retry')
.hasAttribute(
'tooltip',
'The system failed to connect to the target repository. The deposit will be automatically retried later.',
);
});
});

0 comments on commit b3003ad

Please sign in to comment.