Add notable contributions plugin (#222)
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > notable/contributions")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query) ? ({
|
||||
user:{
|
||||
repositoriesContributedTo:{
|
||||
edges:[],
|
||||
},
|
||||
},
|
||||
}) : ({
|
||||
user:{
|
||||
repositoriesContributedTo:{
|
||||
edges:[
|
||||
{
|
||||
cursor:"MOCKED_CURSOR",
|
||||
node:{
|
||||
isInOrganization:true,
|
||||
owner:{
|
||||
login:faker.internet.userName(),
|
||||
avatarUrl:null,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > notable/organizations")
|
||||
return ({
|
||||
user:{
|
||||
organizations:{
|
||||
nodes:[{
|
||||
login:faker.internet.userName(),
|
||||
avatarUrl:null,
|
||||
}],
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -165,6 +165,12 @@
|
||||
pr:{get count() { return this.open + this.merged }, open:faker.datatype.number(1000), merged:faker.datatype.number(1000)},
|
||||
}
|
||||
}) : null),
|
||||
//Notable
|
||||
...(set.plugins.enabled.notable ? ({
|
||||
notable:{
|
||||
contributions:new Array(2+faker.datatype.number(2)).fill(null).map(_ => ({name:faker.lorem.slug(), avatar:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOcOnfpfwAGfgLYttYINwAAAABJRU5ErkJggg=="})),
|
||||
}
|
||||
}) : null),
|
||||
//Gists
|
||||
...(set.plugins.enabled.gists ? ({
|
||||
gists:{
|
||||
|
||||
Reference in New Issue
Block a user