Skip to content

Commit

Permalink
Merge pull request #41 from elifesciences/add-evaluation-doi
Browse files Browse the repository at this point in the history
Add evaluation doi
  • Loading branch information
discodavey authored Oct 16, 2023
2 parents cb82a60 + bbe7a23 commit 14f4931
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/docmap-parser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ describe('docmap-parser', () => {
reviewType: ReviewType.Review,
contentUrls: ['https://content.com/12345.sa1'],
date: new Date('2022-04-06'),
doi: 'elife/eLife.12345.sa1',
participants: [{
name: 'anonymous',
role: 'peer-reviewer',
Expand All @@ -201,6 +202,7 @@ describe('docmap-parser', () => {
reviewType: ReviewType.Review,
contentUrls: ['https://content.com/12345.sa2'],
date: new Date('2022-04-07'),
doi: 'elife/eLife.12345.sa2',
participants: [{
name: 'anonymous',
role: 'peer-reviewer',
Expand All @@ -212,6 +214,7 @@ describe('docmap-parser', () => {
reviewType: ReviewType.EvaluationSummary,
contentUrls: ['https://content.com/12345.sa3'],
date: new Date('2022-04-10'),
doi: 'elife/eLife.12345.sa3',
participants: [{
name: 'Daffy Duck',
role: 'editor',
Expand Down Expand Up @@ -241,6 +244,7 @@ describe('docmap-parser', () => {
reviewType: ReviewType.Review,
contentUrls: ['https://content.com/12345.sa1'],
date: new Date('2022-04-06'),
doi: 'elife/eLife.12345.sa1',
participants: [{
name: 'anonymous',
role: 'peer-reviewer',
Expand All @@ -251,6 +255,7 @@ describe('docmap-parser', () => {
reviewType: ReviewType.Review,
contentUrls: ['https://content.com/12345.sa2'],
date: new Date('2022-04-07'),
doi: 'elife/eLife.12345.sa2',
participants: [{
name: 'anonymous',
role: 'peer-reviewer',
Expand All @@ -262,6 +267,7 @@ describe('docmap-parser', () => {
reviewType: ReviewType.EvaluationSummary,
contentUrls: ['https://content.com/12345.sa3'],
date: new Date('2022-04-10'),
doi: 'elife/eLife.12345.sa3',
participants: [{
name: 'Daffy Duck',
role: 'editor',
Expand All @@ -272,6 +278,7 @@ describe('docmap-parser', () => {
reviewType: ReviewType.AuthorResponse,
contentUrls: ['https://content.com/12345.sa4'],
date: new Date('2022-05-09'),
doi: 'elife/eLife.12345.sa4',
participants: [{
name: 'Bugs Bunny',
role: 'author',
Expand Down Expand Up @@ -301,6 +308,7 @@ describe('docmap-parser', () => {
reviewType: ReviewType.Review,
contentUrls: ['https://content.com/12345.sa1'],
date: new Date('2022-04-06'),
doi: 'elife/eLife.12345.sa1',
participants: [{
name: 'anonymous',
role: 'peer-reviewer',
Expand All @@ -311,6 +319,7 @@ describe('docmap-parser', () => {
reviewType: ReviewType.Review,
contentUrls: ['https://content.com/12345.sa2'],
date: new Date('2022-04-07'),
doi: 'elife/eLife.12345.sa2',
participants: [{
name: 'anonymous',
role: 'peer-reviewer',
Expand All @@ -322,6 +331,7 @@ describe('docmap-parser', () => {
reviewType: ReviewType.EvaluationSummary,
contentUrls: ['https://content.com/12345.sa3'],
date: new Date('2022-04-10'),
doi: 'elife/eLife.12345.sa3',
participants: [{
name: 'Daffy Duck',
role: 'editor',
Expand All @@ -332,6 +342,7 @@ describe('docmap-parser', () => {
reviewType: ReviewType.AuthorResponse,
contentUrls: ['https://content.com/12345.sa4'],
date: new Date('2022-05-09'),
doi: 'elife/eLife.12345.sa4',
participants: [{
name: 'Bugs Bunny',
role: 'author',
Expand Down Expand Up @@ -361,6 +372,7 @@ describe('docmap-parser', () => {
reviewType: ReviewType.Review,
contentUrls: ['https://content.com/12345.sa1'],
date: new Date('2022-04-06'),
doi: 'elife/eLife.12345.sa1',
participants: [{
name: 'anonymous',
role: 'peer-reviewer',
Expand All @@ -371,6 +383,7 @@ describe('docmap-parser', () => {
reviewType: ReviewType.Review,
contentUrls: ['https://content.com/12345.sa2'],
date: new Date('2022-04-07'),
doi: 'elife/eLife.12345.sa2',
participants: [{
name: 'anonymous',
role: 'peer-reviewer',
Expand All @@ -382,6 +395,7 @@ describe('docmap-parser', () => {
reviewType: ReviewType.EvaluationSummary,
contentUrls: ['https://content.com/12345.sa3'],
date: new Date('2022-04-10'),
doi: 'elife/eLife.12345.sa3',
participants: [{
name: 'Daffy Duck',
role: 'editor',
Expand Down
2 changes: 2 additions & 0 deletions src/docmap-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type Participant = {

export type Evaluation = {
date: Date,
doi: string,
reviewType: ReviewType,
contentUrls: string[],
participants: Participant[],
Expand Down Expand Up @@ -269,6 +270,7 @@ const findAndFlatMapAllEvaluations = (actions: Action[]): Evaluation[] => action
return {
reviewType: stringToReviewType(output.type),
date: output.published,
doi: output.doi,
participants: action.participants.map((participant) => ({
name: participant.actor.name,
institution: 'unknown', // TODO
Expand Down

0 comments on commit 14f4931

Please sign in to comment.