-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
124 changed files
with
4,774 additions
and
465 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.