Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WIE_202021_CSBillero11
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bernard Roland (Student Com20)
WIE_202021_CSBillero11
Commits
216b609c
Commit
216b609c
authored
3 years ago
by
Bernard Roland (Student Com20)
Browse files
Options
Downloads
Patches
Plain Diff
Added adapters for team statistics
parent
f85d5eb0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/src/adapters/team.ts
+26
-0
26 additions, 0 deletions
client/src/adapters/team.ts
with
26 additions
and
0 deletions
client/src/adapters/team.ts
+
26
−
0
View file @
216b609c
...
...
@@ -19,6 +19,18 @@ export interface TeamMember extends User {
role
:
TeamRole
;
}
export
interface
TeamActivity
{
day
:
string
;
time
:
number
;
}
export
interface
TeamCompletion
{
open
:
number
,
closed
:
number
,
suspended
:
number
,
overdue
:
number
,
}
export
function
getTeams
():
Promise
<
Team
[]
>
{
return
executeApiGet
(
`team`
,
({
teams
})
=>
teams
,
"
Failed to get teams
"
);
}
...
...
@@ -50,6 +62,20 @@ export function getTeamWork(uuid: string): Promise<Work[]> {
})),
"
Failed to get team work
"
);
}
export
function
getTeamActivity
(
uuid
:
string
,
from
:
Date
=
new
Date
(
0
),
to
:
Date
=
new
Date
()):
Promise
<
TeamActivity
[]
>
{
return
executeApiGet
(
`team/
${
uuid
}
/activity?since=
${
from
.
getTime
()}
&to=
${
to
.
getTime
()}
`
,
({
activity
})
=>
activity
,
"
Failed to get team activity
"
);
}
export
function
getTeamCompletion
(
uuid
:
string
,
from
:
Date
=
new
Date
(
0
),
to
:
Date
=
new
Date
()):
Promise
<
TeamCompletion
>
{
return
executeApiGet
(
`team/
${
uuid
}
/completion?since=
${
from
.
getTime
()}
&to=
${
to
.
getTime
()}
`
,
({
completion
})
=>
completion
,
"
Failed to get team completion
"
);
}
export
function
createTeam
(
name
:
string
):
Promise
<
string
>
{
return
executeApiPost
(
`team`
,
{
name
:
name
},
({
id
})
=>
id
,
"
Failed to create team
"
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment