Skip to content

Commit

Permalink
Fixed bug ENG-5823
Browse files Browse the repository at this point in the history
  • Loading branch information
bp-cos committed Jun 20, 2024
1 parent 8f61b2a commit 73aab04
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions app/preprints/-components/submit/file/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { task } from 'ember-concurrency';
import { waitFor } from '@ember/test-waiters';
import FileModel from 'ember-osf-web/models/file';
import NodeModel from 'ember-osf-web/models/node';
import { inject as service } from '@ember/service';
import Intl from 'ember-intl/services/intl';

/**
* The File Args
Expand All @@ -19,6 +21,8 @@ interface FileArgs {
* The File Component
*/
export default class PreprintFile extends Component<FileArgs>{
@service intl!: Intl;

@tracked isFileUploadDisplayed = false;
@tracked isProjectSelectDisplayed = false;
@tracked isFileSelectDisplayed = false;
Expand Down Expand Up @@ -88,4 +92,10 @@ export default class PreprintFile extends Component<FileArgs>{
await taskFor(this.args.manager.addProjectFile).perform(file);
this.validate(file);
}

public get getUploadText(): string {
return this.intl.t('preprints.submit.step-file.upload-title',
{ singularPreprintWord: this.args.manager.provider.documentType.singularCapitalized });

}
}
2 changes: 1 addition & 1 deletion app/preprints/-components/submit/file/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{{else}}
<div local-class='upload-container'>
<label data-test-upload-label>
{{t 'preprints.submit.step-file.upload-title'}}
{{this.getUploadText}}
<span local-class='required'>*</span>
</label>
<div local-class='button-container'>
Expand Down
2 changes: 1 addition & 1 deletion translations/en-us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ preprints:
abstract-input-error: '20 characters'
step-file:
title: 'File'
upload-title: 'Upload your preprint'
upload-title: 'Upload your {singularPreprintWord}'
uploaded-file-title: 'Attached preprint file'
file-upload-label: 'Upload from your computer'
file-upload-label-one: 'Drag and drop files here to upload'
Expand Down

0 comments on commit 73aab04

Please sign in to comment.