Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eclipse Foundation
IT
Websites
membership.eclipse.org
Commits
45b3bbcb
Commit
45b3bbcb
authored
Jan 14, 2022
by
Zhou Fang
Browse files
Fixed months issue for committers chart
parent
b515f433
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/www/src/App.js
View file @
45b3bbcb
...
...
@@ -72,6 +72,7 @@ const App = () => {
const
[
yourWGData
,
setYourWGData
]
=
useState
(
null
);
const
[
allYourWGData
,
setAllYourWGData
]
=
useState
(
null
);
const
[
interestedWGData
,
setInterestedWGData
]
=
useState
(
null
);
const
[
chartMonths
,
setChartMonths
]
=
useState
([]);
const
failedToExecute
=
(
msg
)
=>
{
setShouldShowMsg
(
true
);
...
...
@@ -145,6 +146,8 @@ const App = () => {
setAllYourWGData
,
interestedWGData
,
setInterestedWGData
,
chartMonths
,
setChartMonths
,
};
useEffect
(()
=>
{
...
...
src/main/www/src/Context/PortalContext.tsx
View file @
45b3bbcb
...
...
@@ -50,6 +50,8 @@ interface PortalContextType {
setAllYourWGData
:
(
allYourWGData
:
Array
<
ProjectsAndWGItem
>
)
=>
void
;
interestedWGData
:
Array
<
ProjectsAndWGItem
>
|
null
;
setInterestedWGData
:
(
interestedWGData
:
Array
<
ProjectsAndWGItem
>
)
=>
void
;
chartMonths
:
Array
<
string
>
;
setChartMonths
:
(
monthData
:
Array
<
string
>
)
=>
void
;
}
const
PortalContext
=
React
.
createContext
<
PortalContextType
>
({
...
...
@@ -91,6 +93,8 @@ const PortalContext = React.createContext<PortalContextType>({
setAllYourWGData
:
(
allYourWGData
:
Array
<
ProjectsAndWGItem
>
)
=>
{},
interestedWGData
:
null
,
setInterestedWGData
:
(
interestedWGData
:
Array
<
ProjectsAndWGItem
>
)
=>
{},
chartMonths
:
[],
setChartMonths
:
(
monthData
:
Array
<
string
>
)
=>
{},
});
export
default
PortalContext
;
src/main/www/src/components/Portal/Dashboard/DashboardCommittersAndContributors/DashboardCommittersAndContributorsChart.tsx
View file @
45b3bbcb
...
...
@@ -9,7 +9,7 @@ import {
MODE_REACT_ONLY
,
}
from
'
../../../../Constants/Constants
'
;
import
{
Bar
}
from
'
react-chartjs-2
'
;
import
{
memo
,
useState
,
useEffect
,
useContext
}
from
'
react
'
;
import
{
memo
,
useEffect
,
useContext
}
from
'
react
'
;
import
PortalContext
from
'
../../../../Context/PortalContext
'
;
import
{
fetchWrapper
}
from
'
../../../../Utils/formFunctionHelpers
'
;
...
...
@@ -33,8 +33,8 @@ const useStyles = makeStyles(() =>
function
DashboardCommittersAndContributorsChart
()
{
const
classes
=
useStyles
();
const
[
chartMonths
,
setChartMonths
]
=
useState
<
Array
<
string
>>
([]);
const
{
orgId
,
chartCommits
,
setChartCommits
,
chartCommitters
,
setChartCommitters
}
=
useContext
(
PortalContext
);
const
{
orgId
,
chartCommits
,
setChartCommits
,
chartCommitters
,
setChartCommitters
,
chartMonths
,
setChartMonths
}
=
useContext
(
PortalContext
);
const
DATA_FOR_BAR_LINE_CHART
=
{
labels
:
chartMonths
,
...
...
@@ -89,7 +89,7 @@ function DashboardCommittersAndContributorsChart() {
setChartMonths
(
monthArray
);
};
fetchWrapper
(
urlForChartCommits
,
FETCH_METHOD
.
GET
,
saveChartCommitsData
);
},
[
orgId
,
chartCommits
,
setChartCommits
]);
},
[
orgId
,
chartCommits
,
setChartCommits
,
setChartMonths
]);
useEffect
(()
=>
{
if
(
!
orgId
||
chartCommitters
!==
null
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment