Skip to content

Commit

Permalink
Merge 2f51d55 into a91c37b
Browse files Browse the repository at this point in the history
  • Loading branch information
bp-cos committed Apr 19, 2024
2 parents a91c37b + 2f51d55 commit ec945ad
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 59 deletions.
1 change: 1 addition & 0 deletions app/models/preprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
28 changes: 26 additions & 2 deletions app/preprints/-components/submit/review/component.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -12,8 +18,26 @@ interface ReviewArgs {
* The Review Component
*/
export default class Review extends Component<ReviewArgs>{
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;
Expand Down
5 changes: 3 additions & 2 deletions app/preprints/-components/submit/review/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
width: 100%;
margin-top: 20px;

.title {
font-weight: bold;
h4 {
margin-top: 10px;
margin-bottom: 10px;
font-weight: bold;
}

.display {
Expand Down
160 changes: 105 additions & 55 deletions app/preprints/-components/submit/review/template.hbs
Original file line number Diff line number Diff line change
@@ -1,67 +1,117 @@
<div local-class='preprint-input-container {{if (is-mobile) 'mobile'}}'>
<div local-class='step-container'>
<h3 local-class='title'
data-test-title-step-one
>
{{t 'preprints.submit.step-one.title'}}
</h3>
{{#if this.loadPreprint.isRunning}}
<LoadingIndicator data-test-loading-indicator @dark={{true}} />
{{else}}
<div local-class='step-container'>
<h3 local-class='title'
data-test-title-step-one
>
{{t 'preprints.submit.step-one.title'}}
</h3>

<div local-class='content-container'>
<div local-class='title'>
{{t 'preprints.submit.step-five.select-a-service'}}
<div local-class='content-container'>
<div local-class='title'>
{{t 'preprints.submit.step-five.select-a-service'}}
</div>
<div local-class='display'>
<img
data-test-provider-image
local-class='image'
src={{this.providerLogo}}
alt={{t 'preprints.submit.step-one.title'}}
/>
<div local-class='text'>
{{this.preprint.provider.name}}
</div>
</div>
</div>
<div local-class='display'>
<img
data-test-provider-image
local-class='image'
src={{this.providerLogo}}
alt={{t 'preprints.submit.step-one.title'}}
/>
<div local-class='text'>
{{this.preprint.provider.name}}
<div local-class='content-container'>
<h4>
{{t 'preprints.submit.step-five.preprint-title'}}
</h4>
<div local-class='display'>
{{this.preprint.title}}
</div>
</div>
<div local-class='content-container'>
<Preprints::-Components::PreprintAbstract @preprint={{this.preprint}} />
</div>
<hr>
</div>
<div local-class='content-container'>
<div local-class='title'>
{{t 'preprints.submit.step-five.preprint-title'}}
<div local-class='step-container'>
<h3 local-class='title'
data-test-title-step-two
>
{{t 'preprints.submit.step-two.title'}}
</h3>
<div local-class='content-container'>
<div local-class='title'>
{{t 'preprints.submit.step-five.contributors'}}
</div>
<div local-class='display'>
<ContributorList
@model={{this.preprint}}
@shouldTruncate={{false}}
@shouldLinkUsers={{true}}
/>
</div>
</div>
<div local-class='display'>
{{this.preprint.title}}
<div local-class='content-container'>
<div local-class='display'>
<Preprints::-Components::PreprintLicense @preprint={{this.preprint}} />
</div>
</div>
</div>
<div local-class='content-container'>
<div local-class='title'>
{{t 'preprints.submit.step-five.description'}}
<div local-class='content-container'>
<div local-class='display'>
<Preprints::-Components::PreprintDiscipline @subjects={{this.subjects}} />
</div>
</div>
<div local-class='display'>
{{this.preprint.description}}
<div local-class='content-container'>
<div local-class='display'>
<Preprints::-Components::PreprintTag @preprint={{this.preprint}} />
</div>
</div>
<div local-class='content-container'>
<h4>
{{t 'preprints.submit.step-five.publication-doi'}}
</h4>
<div local-class='display'>
{{this.preprint.preprintDoiUrl}}
</div>
</div>
<div local-class='content-container'>
<h4>
{{t 'preprints.submit.step-five.publication-year'}}
</h4>
<div local-class='display'>
{{moment-format this.preprint.originalPublicationDate 'YYYY-MM-DD'}}
</div>
</div>
<div local-class='content-container'>
<h4>
{{t 'preprints.submit.step-five.publication-citation'}}
</h4>
<div local-class='display'>
{{this.preprint.publicationCitation}}
</div>
</div>
<hr>
</div>
<div local-class='step-container'>
<h3 local-class='title'
data-test-title-step-three
>
{{t 'preprints.submit.step-three.title'}}
</h3>
<hr />
</div>
<div local-class='step-container'>
<h3 local-class='title'
data-test-title-step-four
>
{{t 'preprints.submit.step-four.title'}}
</h3>
<hr>
</div>
<hr>
</div>
<div local-class='step-container'>
<h3 local-class='title'
data-test-title-step-two
>
{{t 'preprints.submit.step-two.title'}}
</h3>
<hr>
</div>
<div local-class='step-container'>
<h3 local-class='title'
data-test-title-step-three
>
{{t 'preprints.submit.step-three.title'}}
</h3>
<hr />
</div>
<div local-class='step-container'>
<h3 local-class='title'
data-test-title-step-four
>
{{t 'preprints.submit.step-four.title'}}
</h3>
<hr>
</div>
{{/if}}
</div>
1 change: 1 addition & 0 deletions app/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

Expand Down
1 change: 1 addition & 0 deletions mirage/scenarios/preprints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions translations/en-us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit ec945ad

Please sign in to comment.