Skip to content

Commit 7b847dd

Browse files
bp-cosadlius
authored andcommitted
Fixed the strings for selecting a file from a project
1 parent 3ae9e98 commit 7b847dd

File tree

3 files changed

+33
-17
lines changed

3 files changed

+33
-17
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ export default class PreprintFile extends Component<FileArgs>{
5050
}
5151
}
5252

53+
public get isSelectProjectButtonDisplayed(): boolean {
54+
return !this.args.manager.isEditFlow;
55+
}
56+
5357
public get isSelectProjectButtonDisabled(): boolean {
5458
return this.isButtonDisabled || this.isEdit;
5559
}
@@ -111,9 +115,13 @@ export default class PreprintFile extends Component<FileArgs>{
111115
this.validate(file);
112116
}
113117

118+
public get getSelectExplanationText(): string {
119+
return this.intl.t('preprints.submit.step-file.project-select-explanation',
120+
{ singularPreprintWord: this.args.manager.provider.documentType.singularCapitalized });
121+
}
122+
114123
public get getUploadText(): string {
115124
return this.intl.t('preprints.submit.step-file.upload-title',
116125
{ singularPreprintWord: this.args.manager.provider.documentType.singularCapitalized });
117-
118126
}
119127
}

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

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
>
55
{{t 'preprints.submit.step-file.title'}}
66
</h3>
7+
{{#if this.isSelectProjectButtonDisplayed}}
8+
<p>
9+
{{t 'preprints.submit.step-file.upload-warning'}}
10+
</p>
11+
{{/if}}
712
{{#if this.loadFiles.isRunning}}
813
<LoadingIndicator data-test-loading-indicator @dark={{true}} />
914
{{else}}
@@ -34,20 +39,22 @@
3439
>
3540
{{ t 'preprints.submit.step-file.file-upload-label'}}
3641
</Button>
37-
<Button
38-
data-test-select-button
39-
data-analytics-name='Select button'
40-
{{on 'click' this.displayFileSelect}}
41-
local-class='btn'
42-
disabled={{this.isSelectProjectButtonDisabled}}
43-
>
44-
{{ 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}}
50-
</Button>
42+
{{#if this.isSelectProjectButtonDisplayed}}
43+
<Button
44+
data-test-select-button
45+
data-analytics-name='Select button'
46+
{{on 'click' this.displayFileSelect}}
47+
local-class='btn'
48+
disabled={{this.isSelectProjectButtonDisabled}}
49+
>
50+
{{ t 'preprints.submit.step-file.file-select-label'}}
51+
{{#if this.isEdit}}
52+
<EmberTooltip>
53+
{{this.getSelectExplanationText}}
54+
</EmberTooltip>
55+
{{/if}}
56+
</Button>
57+
{{/if}}
5158
</div>
5259
{{#if this.isFileUploadDisplayed}}
5360
{{#let (unique-id 'preprint-upload-files-dropzone') as |id|}}

translations/en-us.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,14 +1191,15 @@ preprints:
11911191
delete-modal-button-tooltip: 'Version file'
11921192
delete-modal-title: 'Add a new {singularPreprintWord} file'
11931193
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}.'
1194-
uploaded-file-title: 'Attached {singularPreprintWord} file'
11951194
file-select-label: 'Select from an existing OSF project'
11961195
file-upload-label: 'Upload from your computer'
11971196
file-upload-label-one: 'Drag and drop files here to upload'
11981197
file-upload-label-two: 'or click to browse for files.'
1199-
project-select-explanation: 'A file from a project can only be selected once.'
1198+
project-select-explanation: 'A file is attach to this {singularPreprintWord} draft. You can upload a new file version using the “Upload from your computer” option. Start a new {singularPreprintWord} if you need to attach a file from a project.'
12001199
title: 'File'
1200+
uploaded-file-title: 'Attached {singularPreprintWord} file'
12011201
upload-title: 'Upload your {singularPreprintWord}'
1202+
upload-warning: 'You cannot switch options once a file is attached.'
12021203
step-metadata:
12031204
title: 'Metadata'
12041205
contributors-input: 'Contributors'

0 commit comments

Comments
 (0)