Skip to content

Commit 464ae61

Browse files
authored
Sudo (#129)
Add Workspace and workspace functionality done
2 parents 1e5b62c + e549c4f commit 464ae61

File tree

23 files changed

+630
-92
lines changed

23 files changed

+630
-92
lines changed

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@
7272
"husky": "^8.0.3",
7373
"prettier": "^3.0.3",
7474
"sass": "^1.68.0",
75-
"typescript": "^5.2.2"
75+
"typescript": "^4.9.5"
7676
}
7777
}

src/app/api/githubData.ts

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,45 @@
1-
import axios from 'axios';
1+
import axios, { AxiosResponse } from 'axios';
22
import { BACKEND_URL } from 'envConstants';
33

4+
5+
6+
export interface Contributors {
7+
[contributorName: string]: {
8+
issues: number,
9+
pulls: number,
10+
commits:number
11+
};
12+
}
13+
14+
export interface ProjectsGithubData {
15+
[contributorName: string]: {
16+
issues: number,
17+
pulls: number,
18+
commits:number
19+
};
20+
}
21+
22+
23+
export interface OrgRank{
24+
contributors: Contributors
25+
}
26+
27+
28+
// Contributors==project issues commits pull
29+
export interface OrgProjectGithubData{
30+
projects: ProjectsGithubData
31+
}
32+
33+
34+
435
export const getOrgGithubData = async (
536
authorizationToken: string,
637
orgName: string,
738
monthly: boolean
8-
) => {
39+
):Promise<AxiosResponse<OrgProjectGithubData>> => {
940
const url =
1041
BACKEND_URL + '/api/protected/github/' + orgName + '?monthly=' + monthly;
11-
const respnse = await axios.get(url, {
42+
const respnse = await axios.get<OrgProjectGithubData>(url, {
1243
headers: {
1344
Accept: 'application/json',
1445
Authorization: `Bearer ${authorizationToken}`,
@@ -21,14 +52,14 @@ export const getOrgRank = async (
2152
authorizationToken: string,
2253
orgName: string,
2354
monthly: boolean
24-
) => {
55+
): Promise<AxiosResponse<OrgRank>> => {
2556
const url =
2657
BACKEND_URL +
2758
'/api/protected/github/' +
2859
orgName +
29-
'/getRank?monthly=' +
60+
'/getRanks?monthly=' +
3061
monthly;
31-
const respnse = await axios.get(url, {
62+
const respnse = await axios.get<OrgRank>(url, {
3263
headers: {
3364
Accept: 'application/json',
3465
Authorization: `Bearer ${authorizationToken}`,

src/app/api/organization.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ export interface AllOrgs{
1515
}[]
1616
}
1717

18+
export interface Projects{
19+
[ProjectName: string]:{
20+
archeive:boolean,
21+
bookmark: boolean
22+
}
23+
}
24+
export interface OrgProjects{
25+
projects: Projects
26+
}
27+
28+
29+
1830
export const deleteOrg = async (
1931
authorizationToken: string,
2032
orgName: string
@@ -182,9 +194,9 @@ export const getOrgMembers = async (
182194
export const getOrgProjects = async (
183195
authorizationToken: string,
184196
orgName: string
185-
) => {
197+
):Promise<AxiosResponse<OrgProjects>> => {
186198
const url = BACKEND_URL + '/api/protected/org/getProjects/' + orgName;
187-
const respnse = await axios.get(url, {
199+
const respnse = await axios.get<OrgProjects>(url, {
188200
headers: {
189201
Accept: 'application/json',
190202
Authorization: `Bearer ${authorizationToken}`,

src/app/assets/gifs/loader.gif

1.36 MB
Loading

src/app/assets/images/github.png

778 Bytes
Loading

src/app/assets/images/login2.png

865 KB
Loading
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { Dispatch } from "redux"
2+
import { Organization } from "../reducers/orgReducers"
3+
4+
5+
6+
7+
8+
export const AddOrganization= (org:Organization)=>{
9+
return(dispatch:Dispatch)=>{
10+
dispatch({ type:'add',
11+
payload:org})
12+
}
13+
}
14+
15+
export const DeleteOrg=(org:Organization)=>{
16+
return(dispatch:Dispatch)=>{
17+
dispatch({
18+
type:'delete',
19+
payload:org
20+
})
21+
}
22+
}
23+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { Dispatch } from "redux"
2+
3+
4+
export const addProject = (project:[string,{archieve:boolean, bookmark:boolean}])=>{
5+
6+
return(dispatch:Dispatch)=>{
7+
dispatch({
8+
type: 'add',
9+
payload: project
10+
})
11+
}
12+
}
13+
14+
export const deleteProject= (project:[string,{archeive:boolean, bookmark:boolean}])=>{
15+
16+
return(dispatch:Dispatch)=>{
17+
dispatch({
18+
type:'delete',
19+
payload: project
20+
})
21+
}
22+
}

src/app/state/action-creators/usersActions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ export const setAllUsernames = (usernames: string[]) => {
1818
};
1919
};
2020

21+
22+
23+

0 commit comments

Comments
 (0)