Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/preprint details page #2026

Closed
wants to merge 170 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
a8b8f89
[ENG-4450] Add new share-search models (#1835)
futa-ikeda Apr 19, 2023
9426827
Add basic search page layout (#1850)
futa-ikeda Apr 24, 2023
b6cb9c4
[ENG-4465] Left panel facets manager (#1858)
futa-ikeda May 15, 2023
7f12095
[ENG-4469] Add object filter and sort dropdown to search (#1864)
futa-ikeda May 23, 2023
0bd1fca
[No ticket] Update SHARE endpoints (#1879)
futa-ikeda Jun 21, 2023
0de159b
[ENG-4568] Componentize search page (#1886)
futa-ikeda Jun 27, 2023
cb960b2
[ENG-4574] Preprint discover rewrite (#1896)
futa-ikeda Jul 11, 2023
d35126c
[ENG-4573] Registry discover (#1900)
adlius Jul 13, 2023
6b6666d
[ENG-4574] Preprint discover fixes (#1905)
futa-ikeda Jul 13, 2023
54039ec
[ENG-4535] Search help feature (#1907)
futa-ikeda Aug 1, 2023
af7d42e
[No Ticket] Change queryparam passed to SHARE when filtering by resou…
adlius Aug 8, 2023
55be328
[No ticket] Preprint branding rework (#1913)
futa-ikeda Aug 8, 2023
8f4caf7
Preprints branding update (#1922)
futa-ikeda Aug 10, 2023
5b24e17
Test prerpint discover page
futa-ikeda Jul 7, 2023
13d7881
Group CR feedback re: search-page component arguments
futa-ikeda Jul 10, 2023
9de71f5
Added new preprints index to the new branch
bp-cos Jul 5, 2023
b9532d3
Added translation strings
bp-cos Jul 5, 2023
c4f0158
Fixed a rebase
bp-cos Aug 1, 2023
2513c6c
Rebase fix
bp-cos Aug 1, 2023
9e5f8ab
Removed the add-ons and moved search-help-modal to osf-components
bp-cos Jul 7, 2023
676611b
Fixed a merge conflict
bp-cos Aug 8, 2023
7744dab
Fixed a few git merge conflicts
bp-cos Jul 12, 2023
5cdb00f
Added more logic to get the page to render
bp-cos Jul 13, 2023
48423c4
Added the taxonomy top list component and integrated it into the inde…
bp-cos Jul 14, 2023
170fa04
Updates to the preprints template file to remove bootstrap
bp-cos Jul 17, 2023
b83711f
Fixed the css for the taxonomy-top-list
bp-cos Jul 17, 2023
9cf21b3
Removed an unnecessary import for analytics
bp-cos Jul 17, 2023
27d895f
Added more information for the providers
bp-cos Jul 18, 2023
916d58c
Added the advisory board attribute
bp-cos Jul 18, 2023
2f7ba52
Finished the html transformation for preprints
bp-cos Jul 25, 2023
e578f1d
Fixed the routing to use a single template
bp-cos Jul 25, 2023
4306233
Updates to remove unused variables and added branding
bp-cos Jul 26, 2023
cd4022d
Fixed the css for the steering committee
bp-cos Jul 27, 2023
30c6d1f
Updates for comments from PR
bp-cos Jul 28, 2023
9bf17c3
Fixed some css and updated the mirage for global classes
bp-cos Aug 3, 2023
5d77c5f
Updates for branding
bp-cos Aug 4, 2023
ba61024
Added more styling for mobile
bp-cos Aug 7, 2023
99e189c
Added more information for preprints
bp-cos Aug 8, 2023
d207ff2
Added more information for the taxomony
bp-cos Aug 8, 2023
aeb0e98
Added a branded footer for preprints
bp-cos Aug 8, 2023
054bf95
Fixed the preprint provider logic ... again
bp-cos Aug 8, 2023
6783e52
Fixed the branded header search
bp-cos Aug 8, 2023
f220a75
Fixed the page title logic
bp-cos Aug 8, 2023
13771d6
Removed useless test
bp-cos Aug 10, 2023
9110d7b
Move preprint specific components to the app/preprints/-components
bp-cos Aug 11, 2023
884868c
Added taxonomy tests
bp-cos Aug 11, 2023
4418e68
Added another test
bp-cos Aug 11, 2023
2730806
Added another test
bp-cos Aug 14, 2023
eaf0d97
Added additional tests for the branded header
bp-cos Aug 15, 2023
eb5dd11
Added Branded footer tests
bp-cos Aug 15, 2023
6dc8676
Pruned an unused providerModel from the branded-header
bp-cos Aug 15, 2023
4954048
Added more tests
bp-cos Aug 18, 2023
0b93b40
Added a test file
bp-cos Aug 18, 2023
80aedb6
Added the initial template and attempt to have it compiled
bp-cos Aug 18, 2023
f024470
Added the controller and the styles -- first pass
bp-cos Aug 18, 2023
9c46c9c
Added a router and continued to clean-up the controller
bp-cos Aug 21, 2023
1733363
Removed chronos
bp-cos Aug 21, 2023
6c1383a
Fixed an the computed and actions
bp-cos Aug 21, 2023
8bfb63b
Cleaned-up computed method
bp-cos Aug 21, 2023
d71dfbc
Removed unused route code
bp-cos Aug 21, 2023
af42f6a
Added routing and a factory to mirage for preprints
bp-cos Aug 22, 2023
b92c931
Fixed the routing, mirage and prototyped the model is working
bp-cos Aug 23, 2023
222c978
Initial steps to update the template
bp-cos Aug 23, 2023
0d0b2bb
mirage updates
bp-cos Aug 25, 2023
78360f8
Updated users to have html link
bp-cos Aug 28, 2023
758b09c
Added logic to have the contributors displayed using the pre-build co…
bp-cos Aug 30, 2023
46cc133
Updates for preprint details
bp-cos Sep 1, 2023
1e6f6c3
Added more details for the preprint details page
bp-cos Sep 5, 2023
6bc11da
Added information for the primaryFile
bp-cos Sep 6, 2023
ce61357
Added the ability to display a pdf from a local assets
bp-cos Sep 7, 2023
103c644
Finished the abstract section
bp-cos Sep 7, 2023
99560db
Added the license information
bp-cos Sep 8, 2023
7d68556
Added some miscellaneous logic for licenses
bp-cos Sep 8, 2023
7dad3c2
Added original date published
bp-cos Sep 8, 2023
8244d75
Added tags to the preprint detail page
bp-cos Sep 11, 2023
14955bf
Added citations and a lot of stuff that I have no idea about without …
bp-cos Sep 11, 2023
94df045
Added the preprint doi
bp-cos Sep 12, 2023
056294e
Added the supplemental material
bp-cos Sep 12, 2023
1dd1e66
Added the download option, with metrics
bp-cos Sep 13, 2023
8598cb9
Initial work on the social icons
bp-cos Sep 13, 2023
1e4a9e0
Added the plaudit widget
bp-cos Sep 14, 2023
52743f7
Added the final touches for mobile views
bp-cos Sep 15, 2023
c5bf733
Initial pass for withdrawn preprints
bp-cos Sep 15, 2023
e93251a
Initial commit for the preprint-status-banner component
bp-cos Sep 26, 2023
a001240
Additional refactors to bring the ts file up-to-date with latest ember
bp-cos Sep 27, 2023
4525d65
Added a current state icon method
bp-cos Sep 27, 2023
700b05e
Refactored all the constants to be typescript compatible
bp-cos Sep 27, 2023
3c45bc9
Appears the preprint status banner will now compile
bp-cos Sep 27, 2023
d1a3538
Fixed mirage logic and some refactors
bp-cos Sep 27, 2023
57ed28b
Added more styling and translations
bp-cos Sep 28, 2023
913f591
Added a bunch of serializer, mirage and scenario logic
bp-cos Sep 29, 2023
71fe122
Added a bunch of mirage love
bp-cos Oct 3, 2023
045b81e
Finished all the conditional statements for the details page
bp-cos Oct 4, 2023
3c72211
Fixing scenarios with contributors
bp-cos Oct 4, 2023
8854959
Finished adding all the preprint checks
bp-cos Oct 4, 2023
d3d93ac
refactored the doi to be a stand-alone component
bp-cos Oct 5, 2023
d878421
Renamed doi to be preprint-doi
bp-cos Oct 5, 2023
f5525c3
Added the preprint-license
bp-cos Oct 5, 2023
1112a1b
Added the tombstone page
bp-cos Oct 6, 2023
1ec3ca4
Added the preprint disciplines component
bp-cos Oct 6, 2023
fedd3ed
pruned some code
bp-cos Oct 6, 2023
d774635
Converted the preprint-tag page
bp-cos Oct 6, 2023
2b7b4d5
added the tombstone component
bp-cos Oct 6, 2023
7987187
Added the abstract component and refactored the tombstone and detail …
bp-cos Oct 6, 2023
1ecf28e
Added the initial author-assertions
bp-cos Oct 10, 2023
0952f2c
Added the preprint assertion link
bp-cos Oct 10, 2023
b000e36
Fixed the css for author assertions, coi and data
bp-cos Oct 11, 2023
f341f72
Finished author assertion for pre registration links
bp-cos Oct 11, 2023
3aa233d
Removed unecessary comments
bp-cos Oct 11, 2023
ba54c55
Fixed a few issues recommended by Futa after the mega-merge
bp-cos Oct 12, 2023
d195c7e
Fixed pagination for branded preprint provider, added a provider with…
bp-cos Oct 16, 2023
22d8c14
Removed all the `import config from ember-get-config`
bp-cos Oct 17, 2023
7e19857
Removed some comments
bp-cos Oct 17, 2023
8f7b5a0
Removed some commentted out router code
bp-cos Oct 17, 2023
e41232b
Defined the data-test
bp-cos Oct 17, 2023
6ece716
Removed a bootstrap and eslint-ignore
bp-cos Oct 17, 2023
c53e815
Removed comments
bp-cos Oct 17, 2023
46f707e
Removed an unnecessary max-len
bp-cos Oct 17, 2023
354df51
Removed comments
bp-cos Oct 17, 2023
efc6ea3
Removed comments
bp-cos Oct 17, 2023
3a81346
Fixed a length and added an enum
bp-cos Oct 17, 2023
93cc53d
Added enums to a model
bp-cos Oct 17, 2023
9b3d6dd
Renamed a method
bp-cos Oct 17, 2023
1bb431e
Removed a stale file
bp-cos Oct 17, 2023
1a52ef3
Refactor the brandedProvider store call
bp-cos Oct 17, 2023
fa09619
Refactored a template file
bp-cos Oct 17, 2023
3e9572a
Pruned translation strings
bp-cos Oct 17, 2023
74c6888
Removed a comment
bp-cos Oct 17, 2023
b8447f7
Enum name change
bp-cos Oct 17, 2023
522faa9
Updated the inverse to be target on preprint files
bp-cos Oct 17, 2023
f4919fe
removed the preprint-tag/component
bp-cos Oct 17, 2023
259aa23
Removed the tombstone component
bp-cos Oct 17, 2023
2659880
Changed String to string
bp-cos Oct 17, 2023
e796149
Changed String to string - Part II
bp-cos Oct 17, 2023
7f5010b
Refactored a string to be an enum
bp-cos Oct 17, 2023
8d4dd85
endingWithdrawal to pendingWithdrawal
bp-cos Oct 17, 2023
d1cb2df
Removed the preprint-assertion-link component
bp-cos Oct 17, 2023
3c890c2
Removed the branded-footer component
bp-cos Oct 17, 2023
1f0989e
Refactored some comments and enums
bp-cos Oct 17, 2023
3bedf27
Added a better IRI based filter
bp-cos Oct 17, 2023
09d25da
Pruned unused code
bp-cos Oct 17, 2023
d0721e4
Fixed a translation string name
bp-cos Oct 17, 2023
52e1008
Removed unnecessary branded navbar params
bp-cos Oct 17, 2023
6fb1553
Fixed a return enum from the api
bp-cos Oct 17, 2023
be814f9
Moved old unused code
bp-cos Oct 17, 2023
0887846
Added the metric start date to the controller and environment
bp-cos Oct 17, 2023
9e863af
Fixed an overly aggressive find/replace and commented out code
bp-cos Oct 17, 2023
85bd3fd
Fixed the query on the taxonomy-top-list component
bp-cos Oct 18, 2023
93807ae
fixed the belongsTo relationship on a file
bp-cos Oct 18, 2023
8edf22a
made the branded header search placeholder dynamic
bp-cos Oct 18, 2023
84bd8fc
Removed the abstractDoi from the preprint doi url
bp-cos Oct 18, 2023
04c181c
Removed the abstractDoi from the article
bp-cos Oct 18, 2023
45eb1bb
Fixed the branded footer
bp-cos Oct 18, 2023
7319b04
Preprint review action prototype
bp-cos Oct 19, 2023
3d90738
Updated the reviewActions for the Preprint model
bp-cos Oct 20, 2023
b1dcd3a
change LinkTo element parameter
adlius Oct 24, 2023
45b2528
fix branded header tests
adlius Oct 24, 2023
cfb857b
fix taxonomy-top-list tests
adlius Oct 24, 2023
ff60cd5
fix branded header test
adlius Oct 24, 2023
b1e4e86
Updated the abstract template to use expandable-preview and removed t…
bp-cos Oct 20, 2023
4acbbc9
set inverse to null
adlius Oct 25, 2023
a1438ea
Fixed build issues
bp-cos Oct 27, 2023
53ef35f
fix preprint routing
adlius Oct 19, 2023
2bcf247
attempt
adlius Oct 30, 2023
7cd9043
try this
adlius Oct 30, 2023
4344e41
Removed the bibiliographic stuff and added feature switches for M1 chips
bp-cos Nov 1, 2023
da03639
Better fix for adapters
bp-cos Nov 1, 2023
c592410
Revert "Better fix for adapters"
bp-cos Nov 1, 2023
e4721e3
Revert "Removed the bibiliographic stuff and added feature switches f…
bp-cos Nov 1, 2023
c844a69
Remvoed bibliographicContributors
bp-cos Nov 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/config/environment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export interface KeenConfig {
}

declare const config: {
WATER_BUTLER_ENABLED: boolean;
PLAUDIT_WIDGET_URL: string,
environment: any;
lintOnBuild: boolean;
testsEnabled: boolean;
Expand Down Expand Up @@ -77,6 +79,7 @@ declare const config: {
devMode: boolean;
cookieDomain: string;
authenticator: string;
metricsStartDate: string;
cookies: {
status: string;
keenUserId: string;
Expand Down
2 changes: 1 addition & 1 deletion app/institutions/discover/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Filter, OnSearchParams, ResourceTypeFilterValue } from 'osf-components/
export default class InstitutionDiscoverController extends Controller {
@service currentUser!: CurrentUser;

@tracked q?: string = '';
@tracked cardSearchText?: string = '';
@tracked sort?: string = '-relevance';
@tracked resourceType: ResourceTypeFilterValue = ResourceTypeFilterValue.Projects;
@tracked activeFilters?: Filter[] = [];
Expand Down
4 changes: 4 additions & 0 deletions app/models/contributor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { not } from '@ember/object/computed';
import { buildValidations, validator } from 'ember-cp-validations';

import DraftRegistrationModel from './draft-registration';
import PreprintModel from './preprint';
import NodeModel from './node';
import OsfModel, { Permission } from './osf-model';
import UserModel from './user';
Expand Down Expand Up @@ -53,6 +54,9 @@ export default class ContributorModel extends OsfModel.extend(Validations) {
@belongsTo('node', { inverse: 'contributors', polymorphic: true })
node!: AsyncBelongsTo<NodeModel> & NodeModel;

@belongsTo('preprint', { inverse: 'contributors'})
preprint!: AsyncBelongsTo<PreprintModel> & PreprintModel;

@belongsTo('draft-registration', { inverse: 'contributors' })
draftRegistration!: AsyncBelongsTo<DraftRegistrationModel> & DraftRegistrationModel;

Expand Down
2 changes: 1 addition & 1 deletion app/models/file-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class FileProviderModel extends BaseFileItem {
@belongsTo('base-file-item', { polymorphic: true })
rootFolder!: AsyncBelongsTo<FileModel> & FileModel;

@hasMany('file', { polymorphic: true })
@hasMany('file', { inverse:'parentFolder', polymorphic: true })
files!: AsyncHasMany<FileModel>;

@belongsTo('abstract-node', { inverse: 'files', polymorphic: true })
Expand Down
6 changes: 4 additions & 2 deletions app/models/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Link } from 'jsonapi-typescript';
import { FileReference } from 'ember-osf-web/packages/registration-schema';
import getHref from 'ember-osf-web/utils/get-href';

import PreprintModel from 'ember-osf-web/models/preprint';
import AbstractNodeModel from './abstract-node';
import BaseFileItem, { BaseFileLinks } from './base-file-item';
import CommentModel from './comment';
Expand Down Expand Up @@ -56,8 +57,9 @@ export default class FileModel extends BaseFileItem {
@hasMany('comment', { inverse: null })
comments!: AsyncHasMany<CommentModel>;

@belongsTo('abstract-node', { polymorphic: true })
target!: (AsyncBelongsTo<AbstractNodeModel> & AbstractNodeModel) | (AsyncBelongsTo<DraftNode> & DraftNode);
@belongsTo('osf-model', { polymorphic: true })
// eslint-disable-next-line max-len
target!: (AsyncBelongsTo<AbstractNodeModel> & AbstractNodeModel) | (AsyncBelongsTo<PreprintModel> & PreprintModel) | (AsyncBelongsTo<DraftNode> & DraftNode);
bp-cos marked this conversation as resolved.
Show resolved Hide resolved

// BaseFileItem override
isFileModel = true;
Expand Down
23 changes: 15 additions & 8 deletions app/models/preprint-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const { defaultProvider } = config;
export default class PreprintProviderModel extends ProviderModel {
@service intl!: Intl;

@attr('fixstring') email_support!: string | null;
@attr('array') subjectsAcceptable!: string[];
@attr('array') additionalProviders!: string[];
@attr('string') shareSource!: string;
Expand Down Expand Up @@ -52,23 +53,29 @@ export default class PreprintProviderModel extends ProviderModel {
};
}

get searchPlaceholder(): string {
bp-cos marked this conversation as resolved.
Show resolved Hide resolved
return this.intl.t('preprints.header.search_placeholder',
{ placeholder: this.documentType.plural});
}

@computed('id')
get preprintWordInTitle() {
return this.id !== 'thesiscommons';
get preprintWordNotInTitle() {
return this.id === 'thesiscommons';
bp-cos marked this conversation as resolved.
Show resolved Hide resolved
}

// Is either OSF Preprints if provider is the default provider,
// name+preprintWord.pluralCapitalized(e.g.AfricArXiv Preprints or MarXiv Papers), or "Thesis Commons"
@computed('documentType.pluralCapitalized', 'id', 'name', 'preprintWordInTitle')
@computed('documentType.pluralCapitalized', 'id', 'name', 'preprintWordNotInTitle')
get providerTitle() {
if (this.id !== defaultProvider) {
if (this.preprintWordInTitle) {
return this.intl.t('preprints.provider-title',
{ name: this.name, pluralizedPreprintWord: this.documentType.pluralCapitalized });
if (this.preprintWordNotInTitle) {
return this.name;
}
return this.name;
return this.intl.t('preprints.provider-title',
{ name: this.name, pluralizedPreprintWord: this.documentType.pluralCapitalized });
} else {
return this.intl.t('preprints.header.osf_preprints');
}
return this.intl.t('preprints.osf-title');
}
}

Expand Down
32 changes: 32 additions & 0 deletions app/models/preprint-request-action.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { AsyncBelongsTo, attr, belongsTo } from '@ember-data/model';
import PreprintRequestModel from 'ember-osf-web/models/preprint-request';
import UserModel from 'ember-osf-web/models/user';

import OsfModel from './osf-model';


export enum PreprintRequestActionTriggerEnum {
SUBMIT= 'submit',
ACCEPT = 'accept',
REJECT = 'reject',
}

export default class PreprintRequestActionModel extends OsfModel {
@attr('string') comment!: string;
@attr('string') actionTrigger!: string;
@attr('date') dateModified!: Date;
@attr('boolean') auto!: boolean;

// Relationships
@belongsTo('preprint-request', { inverse: 'actions' })
target!: (AsyncBelongsTo<PreprintRequestModel> & PreprintRequestModel);

@belongsTo('user', { inverse: null, async: true })
creator!: AsyncBelongsTo<UserModel> & UserModel;
}

declare module 'ember-data/types/registries/model' {
export default interface ModelRegistry {
'preprint-request-action': PreprintRequestActionModel;
} // eslint-disable-line semi
}
40 changes: 40 additions & 0 deletions app/models/preprint-request.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { AsyncBelongsTo, SyncHasMany, attr, belongsTo, hasMany } from '@ember-data/model';
import PreprintModel from 'ember-osf-web/models/preprint';
import UserModel from 'ember-osf-web/models/user';
import PreprintRequestActionModel from 'ember-osf-web/models/preprint-request-action';

import OsfModel from './osf-model';

export enum PreprintRequestType{
WITHDRAWAL = 'withdrawal',
}

export enum PreprintRequestMachineState {
PENDING = 'pending',
ACCEPTED = 'accepted',
REJECTED = 'rejected',
}

export default class PreprintRequestModel extends OsfModel {
@attr('string') comment!: string;
@attr('date') dateLastTransitioned!: Date;
@attr('date') created!: Date;
@attr('date') modified!: Date;
@attr('string') machineState!: string;
@attr('string') requestType!: string;

@belongsTo('preprint', { inverse: 'requests'})
target!: (AsyncBelongsTo<PreprintModel> & PreprintModel);

@belongsTo('user', { inverse: null, async: true })
creator!: AsyncBelongsTo<UserModel> & UserModel;

@hasMany('preprint-request-action', { inverse: 'target'})
actions!: SyncHasMany<PreprintRequestActionModel> & PreprintRequestActionModel;
}

declare module 'ember-data/types/registries/model' {
export default interface ModelRegistry {
'preprint-request': PreprintRequestModel;
} // eslint-disable-line semi
}
65 changes: 56 additions & 9 deletions app/models/preprint.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,60 @@
import { attr, belongsTo, hasMany, SyncHasMany, AsyncBelongsTo, AsyncHasMany } from '@ember-data/model';
import { attr, belongsTo, hasMany, AsyncBelongsTo, AsyncHasMany } from '@ember-data/model';
import { computed } from '@ember/object';
import { alias } from '@ember/object/computed';
import CitationModel from 'ember-osf-web/models/citation';
import PreprintRequestModel from 'ember-osf-web/models/preprint-request';
import { ReviewsState } from 'ember-osf-web/models/provider';
import ReviewActionModel from 'ember-osf-web/models/review-action';

import ContributorModel from './contributor';
import FileModel from './file';
import LicenseModel from './license';
import NodeModel from './node';
import OsfModel from './osf-model';
import OsfModel, { Permission } from './osf-model';
import PreprintProviderModel from './preprint-provider';
import ReviewActionModel from './review-action';
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',
}

export default class PreprintModel extends OsfModel {
@attr('fixstring') title!: string;
@attr('date') dateCreated!: Date;
@attr('date') datePublished!: Date;
@attr('date') dateWithdrawn!: Date;
@attr('date') originalPublicationDate!: Date | null;
@attr('date') dateModified!: Date;
@attr('fixstring') doi!: string | null;
@attr('boolean') public!: boolean;
@attr('boolean') isPublished!: boolean;
@attr('boolean') isPreprintOrphan!: boolean;
@attr('object') licenseRecord!: any;
@attr('string') reviewsState!: string;
@attr('string') reviewsState!: ReviewsState;
@attr('string') description!: string;
@attr('date') dateLastTransitioned!: Date;
@attr('date') preprintDoiCreated!: Date;
@attr('array') currentUserPermissions!: Permission[];
@attr('fixstringarray') tags!: string[];
@attr('fixstring') withdrawalJustification! : string;
@attr('boolean') hasCoi!: boolean;
@attr('string') hasDataLinks!: PreprintDataLinksEnum;
@attr('string') hasPreregLinks!: PreprintPreregLinksEnum;
@attr('string') conflictOfInterestStatement!: string;
@attr('array') dataLinks!: string[];
@attr('array') preregLinks!: string[];
@attr('string') whyNoData!: string;
@attr('string') whyNoPrereg!: string;

@belongsTo('node', { inverse: 'preprints' })
node!: AsyncBelongsTo<NodeModel> & NodeModel;
Expand All @@ -37,18 +68,34 @@ export default class PreprintModel extends OsfModel {
@belongsTo('preprint-provider', { inverse: 'preprints' })
provider!: AsyncBelongsTo<PreprintProviderModel> & PreprintProviderModel;

@hasMany('review-action', { inverse: 'target' })
@hasMany('review-action')
reviewActions!: AsyncHasMany<ReviewActionModel>;

@hasMany('contributor')
contributors!: AsyncHasMany<ContributorModel>;
@hasMany('files', { inverse: 'target'})
files!: AsyncHasMany<FileModel> & FileModel;

@hasMany('contributors', { inverse: 'preprint'})
contributors!: AsyncHasMany<ContributorModel> & ContributorModel;

@hasMany('subject', { inverse: null, async: false })
subjects!: SyncHasMany<SubjectModel>;
@hasMany('contributor', { inverse: null })
bibliographicContributors!: AsyncHasMany<ContributorModel>;

@belongsTo('citation', { inverse: null })
citation!: AsyncBelongsTo<CitationModel>;

@hasMany('subject', { inverse: null})
subjects!: AsyncHasMany<SubjectModel>;

@hasMany('preprint-request', { inverse: 'target'})
requests!: AsyncHasMany<PreprintRequestModel>;

@alias('links.doi') articleDoiUrl!: string | null;
@alias('links.preprint_doi') preprintDoiUrl!: string;

get isWithdrawn(): boolean{
return this.dateWithdrawn !== null;
}

@computed('license', 'licenseRecord')
get licenseText(): string {
const text = this.license.get('text') || '';
Expand Down
18 changes: 16 additions & 2 deletions app/models/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ export interface Assets {
wide_white: string;
}

export enum PreprintProviderReviewsWorkFlow{
PRE_MODERATION = 'pre-moderation',
POST_MODERATION = 'post-moderation'
}

export enum ReviewsState {
INITIAL = 'initial',
PENDING = 'pending',
ACCEPTED = 'accepted',
REJECTED = 'rejected',
PENDING_WITHDRAWAL = 'pendingWithdrawal',
WITHDRAWAL_REJECTED = 'withdrawalRejected',
WITHDRAWN = 'withdrawn',
}
bp-cos marked this conversation as resolved.
Show resolved Hide resolved

export enum ReviewPermissions {
SetUpModeration = 'set_up_moderation',
ViewSubmissions = 'view_submissions',
Expand All @@ -39,7 +54,6 @@ export enum ReviewPermissions {
}

/* eslint-enable camelcase */

export default abstract class ProviderModel extends OsfModel {
@attr('fixstring') name!: string;
@attr('fixstring') description!: string;
Expand All @@ -54,7 +68,7 @@ export default abstract class ProviderModel extends OsfModel {
@attr('boolean') allowCommenting!: boolean;
@attr('boolean') allowUpdates!: boolean;
@attr('array') permissions!: ReviewPermissions[];
@attr('fixstring') reviewsWorkflow!: string | null;
@attr('fixstring') reviewsWorkflow!: PreprintProviderReviewsWorkFlow | null;
@attr('boolean') reviewsCommentsAnonymous!: boolean | null;
@attr() assets?: Partial<Assets>; // TODO: camelize in transform

Expand Down
4 changes: 3 additions & 1 deletion app/models/review-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { attr, belongsTo, AsyncBelongsTo } from '@ember-data/model';
import { computed } from '@ember/object';
import { inject as service } from '@ember/service';
import Intl from 'ember-intl/services/intl';
import PreprintModel from 'ember-osf-web/models/preprint';

import Action from './action';
import RegistrationModel, { RegistrationReviewStates } from './registration';
Expand Down Expand Up @@ -63,7 +64,8 @@ export default class ReviewActionModel extends Action {
@attr('string') toState!: RegistrationReviewStates;

@belongsTo('registration', { inverse: 'reviewActions', polymorphic: true })
target!: AsyncBelongsTo<RegistrationModel> & RegistrationModel;
target!: (AsyncBelongsTo<RegistrationModel> & RegistrationModel
) | (AsyncBelongsTo<PreprintModel> & PreprintModel);

@computed('actionTrigger')
get triggerPastTense(): string {
Expand Down
1 change: 1 addition & 0 deletions app/models/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const Validations = buildValidations({
});

export interface UserLinks extends OsfLinks {
html: Link;
profile_image: Link; // eslint-disable-line camelcase
}

Expand Down
18 changes: 18 additions & 0 deletions app/preprints/-components/branded-footer/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// stylelint-disable max-nesting-depth, selector-max-compound-selectors

.branded-footer-links {
width: 100%;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin: 10px 0;

.social > a {
margin: 0 4px;
}

.social > a:hover {
text-decoration: none;
}
}
5 changes: 5 additions & 0 deletions app/preprints/-components/branded-footer/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{#if @footerLinks}}
<div local-class='branded-footer-links' data-test-footer-links>
{{html-safe @footerLinks}}
</div>
{{/if}}
6 changes: 6 additions & 0 deletions app/preprints/-components/plaudit-widget/component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Component from '@glimmer/component';
import config from 'ember-osf-web/config/environment';

export default class PlauditWidget extends Component {
plauditWidgetUrl = config.PLAUDIT_WIDGET_URL;
}
Loading
Loading