-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrganizationDashboard
More file actions
78 lines (69 loc) · 2.61 KB
/
Copy pathOrganizationDashboard
File metadata and controls
78 lines (69 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import React, { useState } from "react";
import HeaderPart from "../GenricComponents/HeaderPart/HeaderPart";
import { dora16, code, delivery, cost, dora, code16, delivery16, cost16, org } from '../iconsContainer';
import { styled } from '@mui/system';
import HeadInfo from "../GenricComponents/HeadInfo/HeadInfo";
import OverviewDashboard from "./OverviewDashboard";
import properties from "../../properties/properties";
import { useLocation } from "react-router-dom";
import DoraMetrics from "../doraMetricsDashboard/DoraMetrics";
const OrganizationDashboard = ({ configuredMatricGrpups, metalRatings, handleChangeViewFilter, selectedView, setParentState, view,startDate, endDate,onDateRangeChange, }) => {
console.log(handleChangeViewFilter, selectedView, view, 'name_00p_lm')
const decodedView = decodeURIComponent(view);
const [state, setState] = useState({
teams: null,
services: null,
journeys: null,
refresh: 0
})
const setTeamsServices = (teams, services,journeys) => {
setState(PrevState => ({
...PrevState,
teams: teams,
services: services,
journeys: journeys,
}))
setParentState(prevState => ({
...prevState,
serviceCount: services,
applicationCount: teams,
journeyCount: journeys,
}))
}
const handleRefresh = () => {
setState(prevState => ({
...prevState,
refresh: prevState.refresh + 1
}))
}
return (
<div className="font-family-v1">
{decodedView !== "all" ? (
<DoraMetrics
startDate={startDate}
endDate={endDate}
onDateRangeChange={onDateRangeChange}
metricGroup={decodedView}
/>
) : (
<div>
<HeaderPart
handleChangeViewFilter={handleChangeViewFilter}
list={configuredMatricGrpups}
onRefresh={handleRefresh}
childComponent={null}
selectedView={selectedView}
/>
<OverviewDashboard
handleChangeViewFilter={handleChangeViewFilter}
viewType={view}
setTeamsServices={setTeamsServices}
refresh={state.refresh}
metalRatings={metalRatings}
/>
</div>
)}
</div>
)
}
export default OrganizationDashboard;