-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#35: show files in the Box \n\n Show which files are changed in the c…
…ommit
- Loading branch information
1 parent
432758b
commit ea8e5b4
Showing
6 changed files
with
117 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
'use strict'; | ||
|
||
import { traversePages, graphQl } from '../../../utils'; | ||
|
||
/** | ||
* Get files with commits from the database. | ||
* @returns {*} | ||
*/ | ||
export default function getFiles() { | ||
const fileList = []; | ||
|
||
return traversePages(getFilesWithCommmits(), files => { | ||
fileList.push(files); | ||
}).then(function() { | ||
return fileList; | ||
}); | ||
} | ||
|
||
const getFilesWithCommmits = until => (page, perPage) => { | ||
return graphQl | ||
.query( | ||
`query ($page: Int, $perPage: Int) { | ||
files(page: $page, perPage: $perPage) { | ||
data{ | ||
path | ||
webUrl | ||
commits{ | ||
count | ||
data{ | ||
sha | ||
date | ||
} | ||
} | ||
} | ||
} | ||
} | ||
`, | ||
{ page, perPage } | ||
) | ||
.then(resp => resp.files); | ||
}; |
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