From 5bf5ec8bb2569ae7523e15c8fde76c6b748f4417 Mon Sep 17 00:00:00 2001 From: Brian Pilati Date: Mon, 3 Jun 2024 12:50:25 -0600 Subject: [PATCH] Updates for a few bugs that I have found --- app/models/preprint.ts | 2 -- .../-components/submit/author-assertions/component.ts | 10 +++++----- .../author-assertions/link-widget/link/template.hbs | 2 +- .../submit/author-assertions/public-data/component.ts | 10 +++++----- .../submit/author-assertions/public-data/template.hbs | 2 +- .../public-preregistration/component.ts | 10 +++++----- .../public-preregistration/template.hbs | 2 +- .../-components/submit/author-assertions/template.hbs | 2 +- .../-components/submit/file/upload-file/template.hbs | 2 +- 9 files changed, 20 insertions(+), 22 deletions(-) diff --git a/app/models/preprint.ts b/app/models/preprint.ts index 0ac41ea94a..629b51792c 100644 --- a/app/models/preprint.ts +++ b/app/models/preprint.ts @@ -18,14 +18,12 @@ import SubjectModel from './subject'; export enum PreprintDataLinksEnum { AVAILABLE = 'available', - YES = 'yes', NO = 'no', NOT_APPLICABLE = 'not_applicable', } export enum PreprintPreregLinksEnum { AVAILABLE = 'available', - YES = 'yes', NO = 'no', NOT_APPLICABLE = 'not_applicable', } diff --git a/app/preprints/-components/submit/author-assertions/component.ts b/app/preprints/-components/submit/author-assertions/component.ts index c0252caf05..9c430f0b6b 100644 --- a/app/preprints/-components/submit/author-assertions/component.ts +++ b/app/preprints/-components/submit/author-assertions/component.ts @@ -47,7 +47,7 @@ const AuthorAssertionsFormValidation: ValidationObject = { type: 'empty', }), whyNoData: [(key: string, newValue: string, oldValue: string, changes: any, content: any) => { - if (changes['hasDataLinks'] !== PreprintDataLinksEnum.YES) { + if (changes['hasDataLinks'] !== PreprintDataLinksEnum.AVAILABLE) { return validatePresence({ presence: true, ignoreBlank: true, @@ -57,7 +57,7 @@ const AuthorAssertionsFormValidation: ValidationObject = { return true; }], dataLinks: [(_key: string, newValue: string[], _oldValue: string[], changes: any, _content: any) => { - if (changes['hasDataLinks'] === PreprintDataLinksEnum.YES || newValue) { + if (changes['hasDataLinks'] === PreprintDataLinksEnum.AVAILABLE || newValue) { let isValid = false; if (newValue) { isValid = true; @@ -82,7 +82,7 @@ const AuthorAssertionsFormValidation: ValidationObject = { }), whyNoPrereg: [(key: string, newValue: string, oldValue: string, changes: any, content: any) => { if ( - changes['hasPreregLinks'] !== PreprintPreregLinksEnum.YES + changes['hasPreregLinks'] !== PreprintPreregLinksEnum.AVAILABLE ) { return validatePresence({ presence: true, @@ -93,7 +93,7 @@ const AuthorAssertionsFormValidation: ValidationObject = { return true; }], preregLinks: [(_key: string, newValue: string[], _oldValue: string[], changes: any, _content: any) => { - if (changes['hasPreregLinks'] === PreprintPreregLinksEnum.YES || newValue) { + if (changes['hasPreregLinks'] === PreprintPreregLinksEnum.AVAILABLE || newValue) { let isValid = false; if (newValue) { isValid = true; @@ -112,7 +112,7 @@ const AuthorAssertionsFormValidation: ValidationObject = { } }], preregLinkInfo: [(key: string, newValue: string, oldValue: string, changes: any, content: any) => { - if (changes['hasPreregLinks'] === PreprintPreregLinksEnum.YES || newValue) { + if (changes['hasPreregLinks'] === PreprintPreregLinksEnum.AVAILABLE || newValue) { return validatePresence({ presence: true, ignoreBlank: false, diff --git a/app/preprints/-components/submit/author-assertions/link-widget/link/template.hbs b/app/preprints/-components/submit/author-assertions/link-widget/link/template.hbs index 6f4307605f..c8e1254ced 100644 --- a/app/preprints/-components/submit/author-assertions/link-widget/link/template.hbs +++ b/app/preprints/-components/submit/author-assertions/link-widget/link/template.hbs @@ -12,7 +12,7 @@ { publicDataOptions = [ { - inputValue: PreprintDataLinksEnum.YES, + inputValue: PreprintDataLinksEnum.AVAILABLE, displayText: this.intl.t('general.available'), } as RadioButtonOption, { @@ -49,7 +49,7 @@ export default class PublicData extends Component{ public get displayPublicDataLinks(): boolean { return this.args.changeSet.get('hasDataLinks') === null ? false : - this.args.changeSet.get('hasDataLinks') === PreprintDataLinksEnum.YES; + this.args.changeSet.get('hasDataLinks') === PreprintDataLinksEnum.AVAILABLE; } @action @@ -60,11 +60,11 @@ export default class PublicData extends Component{ @action public updatePublicDataOptions(): void { - if (this.args.changeSet.get('hasDataLinks') === PreprintDataLinksEnum.YES) { - this.args.changeSet.set('whyNoData', ''); + if (this.args.changeSet.get('hasDataLinks') === PreprintDataLinksEnum.AVAILABLE) { + this.args.changeSet.set('whyNoData', null); this.isPublicDataWhyNoStatementDisabled = false; } else if (this.args.changeSet.get('hasDataLinks') === PreprintDataLinksEnum.NO) { - this.args.changeSet.set('whyNoData', ''); + this.args.changeSet.set('whyNoData', null); this.isPublicDataWhyNoStatementDisabled = false; this.placeholder = this.intl.t('preprints.submit.step-assertions.public-data-no-placeholder'); } else { diff --git a/app/preprints/-components/submit/author-assertions/public-data/template.hbs b/app/preprints/-components/submit/author-assertions/public-data/template.hbs index 04a2a5dfac..739925e1d6 100644 --- a/app/preprints/-components/submit/author-assertions/public-data/template.hbs +++ b/app/preprints/-components/submit/author-assertions/public-data/template.hbs @@ -44,7 +44,7 @@ data-test-public-data-description-input @disabled={{this.isPublicDataWhyNoStatementDisabled}} @valuePath={{'whyNoData'}} - {{on 'change' @validate}} + @onKeyUp={{@validate}} local-class='input-container textarea-container' @placeholder={{this.placeholder}} /> diff --git a/app/preprints/-components/submit/author-assertions/public-preregistration/component.ts b/app/preprints/-components/submit/author-assertions/public-preregistration/component.ts index 75f46faef8..2c066401cd 100644 --- a/app/preprints/-components/submit/author-assertions/public-preregistration/component.ts +++ b/app/preprints/-components/submit/author-assertions/public-preregistration/component.ts @@ -52,7 +52,7 @@ export default class PublicPreregistration extends Component diff --git a/app/preprints/-components/submit/author-assertions/template.hbs b/app/preprints/-components/submit/author-assertions/template.hbs index 674b7950c6..3dd5f5f76f 100644 --- a/app/preprints/-components/submit/author-assertions/template.hbs +++ b/app/preprints/-components/submit/author-assertions/template.hbs @@ -43,7 +43,7 @@ data-test-coi-description-input @disabled={{this.isConflictOfInterestStatementDisabled}} @valuePath={{'conflictOfInterestStatement'}} - {{on 'change' this.validate}} + @onKeyUp={{this.validate}} local-class='input-container textarea-container' @placeholder={{t 'preprints.submit.step-assertions.conflict-of-interest-placeholder'}} /> diff --git a/app/preprints/-components/submit/file/upload-file/template.hbs b/app/preprints/-components/submit/file/upload-file/template.hbs index 23207e3eb2..a59e69e1a7 100644 --- a/app/preprints/-components/submit/file/upload-file/template.hbs +++ b/app/preprints/-components/submit/file/upload-file/template.hbs @@ -1,4 +1,4 @@ -{{#if this.prepUrl.isRunning}} +{{#if this.success.isRunning}} {{else}}