Skip to content

Commit c87a4f1

Browse files
committed
incomplete week calculations for graph
1 parent cc85334 commit c87a4f1

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ yarn-error.log*
2727
/graphql_payload
2828

2929
yarn.lock
30-
package.lock.json
30+
package.lock.json
31+
32+
/graphql

src/Components/Views/Home.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ class Home extends React.Component {
4242
repoGraphDataCommitWiseLoaded: false,
4343
repoGraphDataPopularityWise: [], //language data populatiry wise for bar graph chart
4444
repoGraphDataPopularityWiseLoaded: false,
45+
commitHistoryData: [], //commit data for all years day wise
46+
commitHistoryDataLoaded: false,
47+
commitHistoryGraphData: [], //commit data accumulated for each day of week [monday,tuesday,...sunday] from all times
48+
commitHistoryGraphDataLoaded: false,
4549
initialPageLoad: Loader.section_loading, //For loading application at first time
4650
};
4751
}
@@ -121,6 +125,17 @@ class Home extends React.Component {
121125
DataProvider.getPinnedRepo(this.state.username).then((pinnedData) => {
122126
this.setState({ pinnedInfo: pinnedData, pinnedLoaded: true });
123127
});
128+
// API CALL TO GET COMMIT HISTORY OF ALL TIMES
129+
DataProvider.getCommitHistory(this.state.username).then((commitData) => {
130+
console.log(commitData);
131+
this.setState({ commitHistoryData: commitData, commitHistoryDataLoaded: true });
132+
DataProvider.commitGraphDataDayWise(commitData).then((data)=>{
133+
this.setState({
134+
commitHistoryGraphData:data,
135+
commitHistoryGraphDataLoaded:true,
136+
})
137+
})
138+
});
124139
}
125140

126141
render() {

src/Data-provider/index.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ async function getPinnedRepo(username) {
4040
return pinned_data
4141
};
4242

43+
//Network CALL For History of commits
44+
async function getCommitHistory(username) {
45+
let response = await axios.get(`${API_BASE_URL}history/${username}`);
46+
const pinned_data = response.data;
47+
return pinned_data
48+
};
49+
50+
4351

4452
//Total Basic Calculations totalCommit, totalStar, totalFork, totalRepo
4553
async function totalBasicCalculation(repoInfo) {
@@ -272,6 +280,13 @@ async function repoBarGraphCalculation(repoInfo) {
272280
}
273281

274282

283+
async function commitGraphDataDayWise(commitHistoryData){
284+
// console.log("---: commitGraphDataDayWise -> commitHistoryData", commitHistoryData);
285+
286+
287+
}
288+
289+
275290
export default {
276291
getUserInfo,
277292
getRepositoryInfo,
@@ -282,5 +297,7 @@ export default {
282297
toReadableBytes,
283298
advancedRepoAnalysis,
284299
repoBarGraphCalculation,
285-
getSearchUsers
300+
getSearchUsers,
301+
getCommitHistory,
302+
commitGraphDataDayWise
286303
}

0 commit comments

Comments
 (0)