Skip to content

Commit 3ae9e98

Browse files
bp-cosadlius
authored andcommitted
Fixed eng-5941
1 parent 0156bf7 commit 3ae9e98

File tree

5 files changed

+39
-18
lines changed

5 files changed

+39
-18
lines changed

app/preprints/-components/submit/file/component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,18 @@ export default class PreprintFile extends Component<FileArgs>{
4545
if(file) {
4646
this.file = file;
4747
this.isFileAttached = true;
48+
this.isEdit = true;
49+
this.args.manager.validateFile(true);
4850
}
4951
}
5052

53+
public get isSelectProjectButtonDisabled(): boolean {
54+
return this.isButtonDisabled || this.isEdit;
55+
}
56+
5157
@action
5258
public async validate(file: FileModel): Promise<void> {
59+
this.isEdit = true;
5360
this.file = file;
5461
this.isFileAttached = true;
5562
this.isProjectSelectDisplayed = false;
@@ -77,7 +84,6 @@ export default class PreprintFile extends Component<FileArgs>{
7784

7885
@action
7986
public async addNewfile(): Promise<void> {
80-
this.isEdit = true;
8187
this.file = null;
8288
this.isFileAttached = false;
8389
this.isFileUploadDisplayed = false;

app/preprints/-components/submit/file/template.hbs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,14 @@
3939
data-analytics-name='Select button'
4040
{{on 'click' this.displayFileSelect}}
4141
local-class='btn'
42-
disabled={{this.isButtonDisabled}}
42+
disabled={{this.isSelectProjectButtonDisabled}}
4343
>
4444
{{ t 'preprints.submit.step-file.file-select-label'}}
45+
{{#if this.isSelectProjectButtonDisabled}}
46+
<EmberTooltip>
47+
{{t 'preprints.submit.step-file.project-select-explanation'}}
48+
</EmberTooltip>
49+
{{/if}}
4550
</Button>
4651
</div>
4752
{{#if this.isFileUploadDisplayed}}

app/preprints/-components/submit/preprint-state-machine/component.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,20 +229,24 @@ export default class PreprintStateMachine extends Component<StateMachineArgs>{
229229
this.args.setPageDirty();
230230
}
231231
this.isNextButtonDisabled = true;
232-
if (this.statusFlowIndex === this.getTypeIndex(PreprintStatusTypeEnum.titleAndAbstract) &&
232+
233+
if (
234+
this.statusFlowIndex === this.getTypeIndex(PreprintStatusTypeEnum.titleAndAbstract) &&
233235
this.titleAndAbstractValidation
234236
) {
235237
await this.saveOnStep();
236238
await this.preprint.files;
237-
this.isNextButtonDisabled = !this.metadataValidation;
239+
this.isNextButtonDisabled = !this.fileValidation;
238240
return;
239-
} else if (this.statusFlowIndex === this.getTypeIndex(PreprintStatusTypeEnum.file) &&
241+
} else if (
242+
this.statusFlowIndex === this.getTypeIndex(PreprintStatusTypeEnum.file) &&
240243
this.fileValidation
241244
) {
242245
await this.saveOnStep();
243-
this.isNextButtonDisabled = !this.authorAssertionValidation;
246+
this.isNextButtonDisabled = !this.metadataValidation;
244247
return;
245-
} else if (this.statusFlowIndex === this.getTypeIndex(PreprintStatusTypeEnum.metadata) &&
248+
} else if (
249+
this.statusFlowIndex === this.getTypeIndex(PreprintStatusTypeEnum.metadata) &&
246250
this.metadataValidation
247251
) {
248252
await this.saveOnStep();
@@ -252,13 +256,15 @@ export default class PreprintStateMachine extends Component<StateMachineArgs>{
252256
this.isNextButtonDisabled = !this.supplementValidation;
253257
}
254258
return;
255-
} else if (this.statusFlowIndex === this.getTypeIndex(PreprintStatusTypeEnum.authorAssertions) &&
259+
} else if (
260+
this.statusFlowIndex === this.getTypeIndex(PreprintStatusTypeEnum.authorAssertions) &&
256261
this.authorAssertionValidation
257262
) {
258263
await this.saveOnStep();
259264
this.isNextButtonDisabled = !this.supplementValidation;
260265
return;
261-
} else if (this.statusFlowIndex === this.getTypeIndex(PreprintStatusTypeEnum.supplements) &&
266+
} else if (
267+
this.statusFlowIndex === this.getTypeIndex(PreprintStatusTypeEnum.supplements) &&
262268
this.supplementValidation
263269
) {
264270
await this.saveOnStep();

app/preprints/-components/submit/review/template.hbs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
<div local-class='content-container'>
1717
{{this.providerAgreement}}
1818
</div>
19+
<div local-class='content-container'>
20+
{{t 'preprints.submit.step-review.agreement-provider-two' htmlSafe=true}}
21+
</div>
1922
{{/if}}
2023
<hr>
2124
</div>

translations/en-us.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,17 +1187,18 @@ preprints:
11871187
abstract-input: 'Abstract'
11881188
abstract-input-error: '20 characters'
11891189
step-file:
1190-
title: 'File'
1191-
upload-title: 'Upload your {singularPreprintWord}'
1190+
delete-modal-button: 'Continue'
1191+
delete-modal-button-tooltip: 'Version file'
1192+
delete-modal-title: 'Add a new {singularPreprintWord} file'
1193+
delete-warning: 'This will allow a new version of the {singularPreprintWord} file to be uploaded to the {singularPreprintWord}. The existing file will be retained as a version of the {singularPreprintWord}.'
11921194
uploaded-file-title: 'Attached {singularPreprintWord} file'
1195+
file-select-label: 'Select from an existing OSF project'
11931196
file-upload-label: 'Upload from your computer'
11941197
file-upload-label-one: 'Drag and drop files here to upload'
11951198
file-upload-label-two: 'or click to browse for files.'
1196-
file-select-label: 'Select from an existing OSF project'
1197-
delete-modal-title: 'Add a new {singularPreprintWord} file'
1198-
delete-warning: 'This will allow a new version of the {singularPreprintWord} file to be uploaded to the {singularPreprintWord}. The existing file will be retained as a version of the {singularPreprintWord}.'
1199-
delete-modal-button: 'Continue'
1200-
delete-modal-button-tooltip: 'Version file'
1199+
project-select-explanation: 'A file from a project can only be selected once.'
1200+
title: 'File'
1201+
upload-title: 'Upload your {singularPreprintWord}'
12011202
step-metadata:
12021203
title: 'Metadata'
12031204
contributors-input: 'Contributors'
@@ -1254,8 +1255,8 @@ preprints:
12541255
delete-modal-title: 'Disconnect supplemental material'
12551256
delete-warning: 'This will disconnect the selected project. You can select new supplemental material or re-add the same supplemental material at a later date.'
12561257
step-review:
1257-
agreement-provider: '{providerName} uses {moderationType}. If your preprint is accepted, it will be assigned a DOI and become publicly accessible via OSF. The preprint file cannot be deleted but it can be updated or modified. You can read more about
1258-
<a href="https://help.osf.io/article/592-preprint-moderation" target="_blank">OSF preprints moderation policies on</a> the OSF support center.'
1258+
agreement-provider: '{providerName} uses {moderationType}. If your preprint is accepted, it will be assigned a DOI and become publicly accessible via OSF. The preprint file cannot be deleted but it can be updated or modified.'
1259+
agreement-provider-two: 'You can read more about <a href="https://help.osf.io/article/592-preprint-moderation" target="_blank">OSF preprints moderation policies on</a> the OSF support center.</p>'
12591260
agreement-title: 'Consent to publish'
12601261
agreement-user: 'By submitting this preprint you confirm that all contributors agree with sharing it and that you have the right to share this preprint.'
12611262
conflict-of-interest: 'Conflict of Interest'

0 commit comments

Comments
 (0)