From 2f51d55075d5da9e4639413c2e6f636c715fc68d Mon Sep 17 00:00:00 2001 From: Brian Pilati Date: Fri, 19 Apr 2024 12:09:06 -0600 Subject: [PATCH] Added the metadata --- app/models/preprint.ts | 1 + .../-components/submit/review/component.ts | 28 ++- .../-components/submit/review/styles.scss | 5 +- .../-components/submit/review/template.hbs | 160 ++++++++++++------ app/router.ts | 1 + mirage/scenarios/preprints.ts | 1 + translations/en-us.yml | 7 + 7 files changed, 144 insertions(+), 59 deletions(-) diff --git a/app/models/preprint.ts b/app/models/preprint.ts index 82a952653f..a26545dd43 100644 --- a/app/models/preprint.ts +++ b/app/models/preprint.ts @@ -59,6 +59,7 @@ export default class PreprintModel extends OsfModel { @attr('string') hasDataLinks!: PreprintDataLinksEnum; @attr('string') hasPreregLinks!: PreprintPreregLinksEnum; @attr('string') conflictOfInterestStatement!: string | null; + @attr('string') publicationCitation!: string; @attr('array') dataLinks!: string[]; @attr('array') preregLinks!: string[]; @attr('string') whyNoData!: string | null; diff --git a/app/preprints/-components/submit/review/component.ts b/app/preprints/-components/submit/review/component.ts index 80f17f9165..9a351adb32 100644 --- a/app/preprints/-components/submit/review/component.ts +++ b/app/preprints/-components/submit/review/component.ts @@ -1,5 +1,11 @@ +import Store from '@ember-data/store'; +import { waitFor } from '@ember/test-waiters'; import Component from '@glimmer/component'; +import { task } from 'ember-concurrency'; +import { taskFor } from 'ember-concurrency-ts'; import PreprintStateMachine from 'ember-osf-web/preprints/-components/submit/preprint-state-machine/component'; +import { inject as service } from '@ember/service'; +import { tracked } from '@glimmer/tracking'; /** * The Review Args @@ -12,8 +18,26 @@ interface ReviewArgs { * The Review Component */ export default class Review extends Component{ - preprint = this.args.manager.preprint; - provider = this.preprint.provider; + @service store!: Store; + @tracked preprint = this.args.manager.preprint; + @tracked provider?: any; + @tracked license?: any; + @tracked subjects?: any; + + constructor(owner: unknown, args: ReviewArgs) { + super(owner, args); + + taskFor(this.loadPreprint).perform(); + } + + @task + @waitFor + private async loadPreprint() { + // this.preprint = await this.store.findRecord('preprint', 'osf-approved-admin'); + this.provider = this.preprint.provider; + this.license = this.preprint.license; + this.subjects = await this.preprint.queryHasMany('subjects'); + } public get providerLogo(): string | undefined { return this.provider.get('assets')?.square_color_no_transparent; diff --git a/app/preprints/-components/submit/review/styles.scss b/app/preprints/-components/submit/review/styles.scss index be6ece038e..f07403dffe 100644 --- a/app/preprints/-components/submit/review/styles.scss +++ b/app/preprints/-components/submit/review/styles.scss @@ -18,9 +18,10 @@ width: 100%; margin-top: 20px; - .title { - font-weight: bold; + h4 { + margin-top: 10px; margin-bottom: 10px; + font-weight: bold; } .display { diff --git a/app/preprints/-components/submit/review/template.hbs b/app/preprints/-components/submit/review/template.hbs index 1687b41916..ef72d310d2 100644 --- a/app/preprints/-components/submit/review/template.hbs +++ b/app/preprints/-components/submit/review/template.hbs @@ -1,67 +1,117 @@
-
-

- {{t 'preprints.submit.step-one.title'}} -

+ {{#if this.loadPreprint.isRunning}} + + {{else}} +
+

+ {{t 'preprints.submit.step-one.title'}} +

-
-
- {{t 'preprints.submit.step-five.select-a-service'}} +
+
+ {{t 'preprints.submit.step-five.select-a-service'}} +
+
+ {{t +
+ {{this.preprint.provider.name}} +
+
-
- {{t -
- {{this.preprint.provider.name}} +
+

+ {{t 'preprints.submit.step-five.preprint-title'}} +

+
+ {{this.preprint.title}}
+
+ +
+
-
-
- {{t 'preprints.submit.step-five.preprint-title'}} +
+

+ {{t 'preprints.submit.step-two.title'}} +

+
+
+ {{t 'preprints.submit.step-five.contributors'}} +
+
+ +
-
- {{this.preprint.title}} +
+
+ +
-
-
-
- {{t 'preprints.submit.step-five.description'}} +
+
+ +
-
- {{this.preprint.description}} +
+
+ +
+
+

+ {{t 'preprints.submit.step-five.publication-doi'}} +

+
+ {{this.preprint.preprintDoiUrl}} +
+
+
+

+ {{t 'preprints.submit.step-five.publication-year'}} +

+
+ {{moment-format this.preprint.originalPublicationDate 'YYYY-MM-DD'}} +
+
+
+

+ {{t 'preprints.submit.step-five.publication-citation'}} +

+
+ {{this.preprint.publicationCitation}} +
+
+
+
+
+

+ {{t 'preprints.submit.step-three.title'}} +

+
+
+
+

+ {{t 'preprints.submit.step-four.title'}} +

+
-
-
-
-

- {{t 'preprints.submit.step-two.title'}} -

-
-
-
-

- {{t 'preprints.submit.step-three.title'}} -

-
-
-
-

- {{t 'preprints.submit.step-four.title'}} -

-
-
+ {{/if}}
\ No newline at end of file diff --git a/app/router.ts b/app/router.ts index b330fbaf33..099d5179d8 100644 --- a/app/router.ts +++ b/app/router.ts @@ -32,6 +32,7 @@ Router.map(function() { this.route('discover', { path: '/:provider_id/discover' }); this.route('detail', { path: '/:provider_id/:guid' }); this.route('submit', { path: '/:provider_id/submit' }); + this.route('edit', { path: '/:provider_id/edit/:guid' }); this.route('select'); }); diff --git a/mirage/scenarios/preprints.ts b/mirage/scenarios/preprints.ts index 4775accd3f..0ff3fa76ae 100644 --- a/mirage/scenarios/preprints.ts +++ b/mirage/scenarios/preprints.ts @@ -54,6 +54,7 @@ function buildOSF( doi: '10.30822/artk.v1i1.79', originalPublicationDate: new Date('2016-11-30T16:00:00.000000Z'), preprintDoiCreated: new Date('2016-11-30T16:00:00.000000Z'), + publicationCitation: 'This is the publication Citation', hasCoi: true, hasDataLinks: PreprintDataLinksEnum.NOT_APPLICABLE, hasPreregLinks: PreprintPreregLinksEnum.NOT_APPLICABLE, diff --git a/translations/en-us.yml b/translations/en-us.yml index 25fa9df2d5..ad323c1891 100644 --- a/translations/en-us.yml +++ b/translations/en-us.yml @@ -1233,6 +1233,13 @@ preprints: select-a-service: 'Select a service' preprint-title: 'Title' description: 'Description' + contributors: 'Contributors' + license: 'License' + subject: 'Subject' + tags: 'Tags' + publication-doi: 'Publication DOI' + publication-year: 'Publication Year' + publication-citation: 'Publication Citation' data-analytics: 'Goto {statusType} tab' status-flow: step-title-and-file: 'Title and File'