Add contributors plugin (#126)

This commit is contained in:
Simon Lecoq
2021-02-17 13:28:59 +01:00
committed by GitHub
parent 050fb2e330
commit fdf8b8f97b
10 changed files with 215 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
/**Mocked data */
export default function({faker, query, login = faker.internet.userName()}) {
console.debug("metrics/compute/mocks > mocking graphql api result > contributors/commit")
return ({
repository:{
object:{
oid:"MOCKED_SHA",
abbreviatedOid:"MOCKED_SHA",
messageHeadline:faker.lorem.sentence(),
committedDate:faker.date.recent(),
},
},
})
}

View File

@@ -11,13 +11,20 @@
},
data:page < 2 ? new Array(per_page).fill(null).map(() => ({
sha:"MOCKED_SHA",
get author() {
return this.commit.author
},
commit:{
author:{
name:owner,
login:faker.internet.userName(),
avatar_url:null,
date:`${faker.date.recent(14)}`,
},
committer:{
name:owner,
login:faker.internet.userName(),
avatar_url:null,
date:`${faker.date.recent(14)}`,
},
},