Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ce-deploy-ui
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ccce
dev
ce-deploy-ui
Commits
0bdbf143
Commit
0bdbf143
authored
1 year ago
by
Imre Toth
Browse files
Options
Downloads
Patches
Plain Diff
CE-2098
: Convert useCurrentlyActiveIocs hook
parent
0d266eaf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!407
CE-2141: 3.0.0
,
!373
CE-2098: Convert useCurrentlyActiveIocs hook
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/api/SwaggerApi.js
+16
-7
16 additions, 7 deletions
src/api/SwaggerApi.js
src/components/statistics/ActiveIOCChart/ActiveIOCChart.js
+9
-3
9 additions, 3 deletions
src/components/statistics/ActiveIOCChart/ActiveIOCChart.js
with
25 additions
and
10 deletions
src/api/SwaggerApi.js
+
16
−
7
View file @
0bdbf143
...
@@ -351,18 +351,27 @@ export function useNamingNames() {
...
@@ -351,18 +351,27 @@ export function useNamingNames() {
return
useAsync
({
fcn
:
method
,
call
:
false
,
init
:
[]
});
return
useAsync
({
fcn
:
method
,
call
:
false
,
init
:
[]
});
}
}
export
function
unpackCurrentlyActiveIOCS
(
statistics
)
{
export
function
unpackGitReference
(
reference
)
{
return
{
...
statistics
};
return
{
...
reference
};
}
export
function
unpackTagAndCommitIdList
(
tagList
)
{
return
tagList
.
map
((
t
)
=>
unpackGitReference
(
t
));
}
}
export
function
use
CurrentlyActiveIOCs
(
)
{
export
function
use
TagsAndCommitIds
(
onError
)
{
const
api
=
useContext
(
apiContext
);
const
api
=
useContext
(
apiContext
);
const
method
=
useCallAndUnpack
(
const
method
=
useCallAndUnpack
(
api
.
apis
.
Statistics
.
currentlyActiveIocs
,
(
gitProjectId
,
reference
,
includeAllReference
,
searchMethod
)
=>
unpackCurrentlyActiveIOCS
api
.
apis
.
Git
.
listTagsAndCommitIds
({
project_id
:
gitProjectId
,
reference
:
reference
,
include_all_reference
:
includeAllReference
,
search_method
:
searchMethod
}),
unpackTagAndCommitIdList
);
);
return
useAsync
({
fcn
:
method
,
call
:
false
,
onError
:
onError
,
init
:
[]
});
return
useAsync
({
fcn
:
method
,
call
:
false
});
}
}
export
function
unpackActiveIOCHistory
(
statistics
)
{
export
function
unpackActiveIOCHistory
(
statistics
)
{
...
...
This diff is collapsed.
Click to expand it.
src/components/statistics/ActiveIOCChart/ActiveIOCChart.js
+
9
−
3
View file @
0bdbf143
import
React
from
"
react
"
;
import
React
,
{
useContext
}
from
"
react
"
;
import
{
useCurrentlyActiveIOCs
}
from
"
../../../api/SwaggerApi
"
;
import
{
useEffect
}
from
"
react
"
;
import
{
useEffect
}
from
"
react
"
;
import
{
LinearProgress
,
useTheme
,
Typography
}
from
"
@mui/material
"
;
import
{
LinearProgress
,
useTheme
,
Typography
}
from
"
@mui/material
"
;
import
{
circularPalette
}
from
"
../../common/Helper
"
;
import
{
circularPalette
}
from
"
../../common/Helper
"
;
...
@@ -14,11 +13,18 @@ import {
...
@@ -14,11 +13,18 @@ import {
Cell
,
Cell
,
LabelList
LabelList
}
from
"
recharts
"
;
}
from
"
recharts
"
;
import
{
apiContext
}
from
"
../../../api/DeployApi
"
;
import
{
useAPIMethod
}
from
"
@ess-ics/ce-ui-common
"
;
export
default
function
ActiveIOCChart
({
title
})
{
export
default
function
ActiveIOCChart
({
title
})
{
const
[
activeIocs
,
getActiveIocs
]
=
useCurrentlyActiveIOCs
();
const
theme
=
useTheme
();
const
theme
=
useTheme
();
const
GRAPH_THRESHOLD
=
0.2
;
const
GRAPH_THRESHOLD
=
0.2
;
const
client
=
useContext
(
apiContext
);
const
{
value
:
activeIocs
,
wrapper
:
getActiveIocs
}
=
useAPIMethod
({
fcn
:
client
.
apis
.
Statistics
.
currentlyActiveIocs
,
call
:
false
});
useEffect
(()
=>
{
useEffect
(()
=>
{
getActiveIocs
();
getActiveIocs
();
...
...
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