datastake-daf 0.6.147 → 0.6.149
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +13 -0
- package/dist/components/index.css +1 -1
- package/dist/components/index.js +482 -205
- package/dist/utils/index.js +22 -5
- package/package.json +1 -1
- package/public/assets/images/SVG/403.svg +20 -0
- package/public/assets/images/SVG/404.svg +11 -0
- package/public/assets/images/SVG/CADD.svg +27 -0
- package/public/assets/images/SVG/InDevelopment.svg +24 -0
- package/public/assets/images/SVG/PME.svg +21 -0
- package/public/assets/images/SVG/comment-alt.svg +3 -0
- package/public/assets/images/SVG/comment.svg +3 -0
- package/public/assets/images/SVG/coordinator.svg +3 -0
- package/public/assets/images/SVG/implementer.svg +3 -0
- package/public/assets/images/SVG/logo-horizontal.svg +1 -0
- package/public/assets/images/SVG/partner-building.svg +3 -0
- package/public/assets/images/SVG/partner.svg +5 -0
- package/public/assets/images/SVG/unavailable-info.svg +16 -0
- package/public/assets/images/SVG/vault.svg +6 -0
- package/public/assets/images/app-navigation/mmt-logo.svg +32 -0
- package/public/assets/images/app-navigation/tazama-logo.svg +31 -0
- package/public/assets/images/app-navigation/tif-logo.svg +33 -0
- package/public/assets/images/applications/arm-prev.png +0 -0
- package/public/assets/images/applications/asm-icon.svg +29 -0
- package/public/assets/images/applications/kota-logo.svg +4 -0
- package/public/assets/images/applications/mmt-logo-2.svg +5 -0
- package/public/assets/images/applications/mmt-logo.svg +6 -0
- package/public/assets/images/applications/mmt-prev.png +0 -0
- package/public/assets/images/applications/sbgi_logo.png +0 -0
- package/public/assets/images/applications/tazama-home-img.jpeg +0 -0
- package/public/assets/images/applications/tazama-logo.svg +9 -0
- package/public/assets/images/applications/tif-app.png +0 -0
- package/public/assets/images/applications/tif-logo.svg +9 -0
- package/public/assets/images/auth-bg-2.svg +296 -0
- package/public/assets/images/auth-bg.svg +303 -0
- package/public/assets/images/countries/fr.png +0 -0
- package/public/assets/images/countries/gb.png +0 -0
- package/public/assets/images/countries/sp.png +0 -0
- package/public/assets/images/dashboard/amp-dashboard/empty.png +0 -0
- package/public/assets/images/dashboard/map-icons/amp.svg +28 -0
- package/public/assets/images/dashboard/map-icons/amp_focused.svg +28 -0
- package/public/assets/images/dashboard/map-icons/amp_location_pin.svg +4 -0
- package/public/assets/images/dashboard/map-icons/datachain-icon.svg +21 -0
- package/public/assets/images/dashboard/map-icons/ellipse.svg +3 -0
- package/public/assets/images/dashboard/map-icons/lir-icon.svg +3 -0
- package/public/assets/images/dashboard/map-icons/major-incident-events-icon.svg +3 -0
- package/public/assets/images/dashboard/map-icons/minesites-location-icon.svg +21 -0
- package/public/assets/images/dashboard/map-icons/minor-incident-events-icon.svg +3 -0
- package/public/assets/images/dashboard/map-icons/moderate-incident-events-icon.svg +3 -0
- package/public/assets/images/dashboard/map-icons/other-events-icon.svg +3 -0
- package/public/assets/images/dashboard/map-icons/other-location-icon.svg +21 -0
- package/public/assets/images/dashboard/map-icons/risk-mitigation-events-icon.svg +3 -0
- package/public/assets/images/dashboard/map-icons/sca_location_pin.svg +4 -0
- package/public/assets/images/dashboard/map-icons/villages-location-icon.svg +21 -0
- package/public/assets/images/dashboard/mine-site.svg +7 -0
- package/public/assets/images/dashboard/programs/key-data.svg +12 -0
- package/public/assets/images/dashboard/programs/key-projects.svg +12 -0
- package/public/assets/images/dashboard/scl-icons/close-icon.svg +4 -0
- package/public/assets/images/dashboard/scl-icons/dot.svg +3 -0
- package/public/assets/images/dashboard/scl-icons/empty-gallery.svg +5 -0
- package/public/assets/images/dashboard/scl-icons/location-icon.svg +14 -0
- package/public/assets/images/dashboard/scl-icons/town-dot.svg +3 -0
- package/public/assets/images/dashboard/scl-icons/town-icon.svg +4 -0
- package/public/assets/images/dashboard/scl-icons/village-icon.svg +6 -0
- package/public/assets/images/dashboard/tif-products/cobalt-bg.png +0 -0
- package/public/assets/images/dashboard/tif-products/cobalt-logo.png +0 -0
- package/public/assets/images/dashboard/tif-products/gold-bg.png +0 -0
- package/public/assets/images/dashboard/tif-products/gold-logo.png +0 -0
- package/public/assets/images/datastake-logo.svg +20 -0
- package/public/assets/images/datastake-white.svg +20 -0
- package/public/assets/images/empty-box.svg +5 -0
- package/public/assets/images/find-information/business-entity.svg +4 -0
- package/public/assets/images/find-information/civil-society.svg +4 -0
- package/public/assets/images/find-information/government.svg +4 -0
- package/public/assets/images/find-information/graphs.png +0 -0
- package/public/assets/images/find-information/individual.svg +11 -0
- package/public/assets/images/find-information/non-stated-arm-group.svg +4 -0
- package/public/assets/images/find-information/other-organisation.svg +4 -0
- package/public/assets/images/find-information/state-security.svg +4 -0
- package/public/assets/images/info-channels/investor.svg +4 -0
- package/public/assets/images/info-channels/mine.svg +4 -0
- package/public/assets/images/info-channels/source.png +0 -0
- package/public/assets/images/kota-bg.jpg +0 -0
- package/public/assets/images/kota-logo-small.svg +2 -0
- package/public/assets/images/kota-logo.svg +2 -0
- package/public/assets/images/logo-new-white-icon.svg +5 -0
- package/public/assets/images/logo-new-white.svg +8 -0
- package/public/assets/images/logo-white.svg +67 -0
- package/public/assets/images/map/assessed.png +0 -0
- package/public/assets/images/map/connected.png +0 -0
- package/public/assets/images/map/disabled.png +0 -0
- package/public/assets/images/map/identified.png +0 -0
- package/public/assets/images/map/position.png +0 -0
- package/public/assets/images/map/treasure-map.png +0 -0
- package/public/assets/images/project-share-info/due-dilligence.svg +3 -0
- package/public/assets/images/project-share-info/event.svg +3 -0
- package/public/assets/images/project-share-info/location.svg +3 -0
- package/public/assets/images/project-share-info/network.svg +3 -0
- package/public/assets/images/project-share-info/stakeholder.svg +10 -0
- package/public/assets/images/tif/antelope-mine-people.png +0 -0
- package/public/assets/images/tif/gesagu-people.png +0 -0
- package/public/assets/images/tif/ironstep-people.png +0 -0
- package/public/assets/images/tif-bg.png +0 -0
- package/public/assets/images/tif-logo-small.svg +3 -0
- package/public/assets/images/tif-logo.svg +9 -0
- package/public/assets/images/verified-user-tif.png +0 -0
- package/public/assets/images/verified-user.svg +100 -0
- package/public/favicons/android-chrome-192x192.png +0 -0
- package/public/favicons/android-chrome-512x512.png +0 -0
- package/public/favicons/apple-touch-icon.png +0 -0
- package/public/favicons/favicon-16x16.png +0 -0
- package/public/favicons/favicon-32x32.png +0 -0
- package/public/favicons/favicon.ico +0 -0
- package/public/favicons/tazama/android-chrome-192x192.png +0 -0
- package/public/favicons/tazama/android-chrome-512x512.png +0 -0
- package/public/favicons/tazama/apple-touch-icon.png +0 -0
- package/public/favicons/tazama/favicon-16x16.png +0 -0
- package/public/favicons/tazama/favicon-32x32.png +0 -0
- package/public/favicons/tazama/favicon.ico +0 -0
- package/src/@daf/core/components/Dashboard/Globe/hook.js +1 -106
- package/src/@daf/core/components/Dashboard/Globe/index.jsx +1 -13
- package/src/@daf/core/components/Dashboard/Globe/style.js +0 -11
- package/src/@daf/core/components/Dashboard/Widget/KeyIndicators/index.jsx +4 -3
- package/src/@daf/core/components/Dashboard/Widget/ProjectWidget/ProjectWidget.stories.jsx +72 -0
- package/src/@daf/core/components/Dashboard/Widget/ProjectWidget/index.jsx +90 -0
- package/src/@daf/core/components/Dashboard/Widget/ProjectWidget/style.js +74 -0
- package/src/@daf/core/components/Dashboard/Widget/SDGWidget/SDGWidget.stories.jsx +33 -17
- package/src/@daf/core/components/Dashboard/Widget/SDGWidget/config.js +4 -22
- package/src/@daf/core/components/Dashboard/Widget/SDGWidget/index.jsx +3 -3
- package/src/@daf/core/components/Dashboard/Widget/index.jsx +95 -82
- package/src/@daf/core/components/ProgressTabs/_index.scss +1 -11
- package/src/constants/SDGs.js +92 -0
- package/src/constants/locales/en/translation.js +1357 -1269
- package/src/index.js +11 -6
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Card, Tooltip, theme } from "antd";
|
|
3
|
+
import { ImageContainer, ProjectWidgetItems, SDGList, Label } from "./style.js";
|
|
4
|
+
import CustomIcon from "../../../Icon/CustomIcon.jsx";
|
|
5
|
+
import { SDG_IMAGES } from "../../../../../../constants/SDGs.js";
|
|
6
|
+
|
|
7
|
+
const { Meta } = Card;
|
|
8
|
+
const { useToken } = theme;
|
|
9
|
+
|
|
10
|
+
export default function ProjectWidget({
|
|
11
|
+
title,
|
|
12
|
+
description,
|
|
13
|
+
onLinkClick,
|
|
14
|
+
image,
|
|
15
|
+
linkIcon = "Link",
|
|
16
|
+
sdgList,
|
|
17
|
+
items,
|
|
18
|
+
hideSDGList = false,
|
|
19
|
+
t = (x) => x,
|
|
20
|
+
}) {
|
|
21
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
22
|
+
const { token } = useToken();
|
|
23
|
+
return (
|
|
24
|
+
<Card
|
|
25
|
+
style={{
|
|
26
|
+
flex: 1,
|
|
27
|
+
}}
|
|
28
|
+
hoverable
|
|
29
|
+
onMouseEnter={() => setIsHovered(true)}
|
|
30
|
+
onMouseLeave={() => setIsHovered(false)}
|
|
31
|
+
cover={
|
|
32
|
+
<ImageContainer>
|
|
33
|
+
<div
|
|
34
|
+
className="image"
|
|
35
|
+
style={{
|
|
36
|
+
backgroundImage: `url(${image})`,
|
|
37
|
+
}}
|
|
38
|
+
/>
|
|
39
|
+
{onLinkClick && (
|
|
40
|
+
<div className="icon-container" onClick={onLinkClick}>
|
|
41
|
+
<CustomIcon
|
|
42
|
+
name={linkIcon}
|
|
43
|
+
width={16}
|
|
44
|
+
height={16}
|
|
45
|
+
color={isHovered ? token.colorPrimary7 : "black"}
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
)}
|
|
49
|
+
</ImageContainer>
|
|
50
|
+
}
|
|
51
|
+
>
|
|
52
|
+
<Meta title={title || undefined} description={description || undefined} />
|
|
53
|
+
<ProjectWidgetItems>
|
|
54
|
+
{items.map((item, index) => (
|
|
55
|
+
<li key={index} className="project-widget-item">
|
|
56
|
+
<Label>{item.label}</Label>
|
|
57
|
+
{item.render()}
|
|
58
|
+
</li>
|
|
59
|
+
))}
|
|
60
|
+
</ProjectWidgetItems>
|
|
61
|
+
|
|
62
|
+
{!hideSDGList && (
|
|
63
|
+
<div
|
|
64
|
+
style={{
|
|
65
|
+
borderTop: "1px solid var(--base-gray-30)",
|
|
66
|
+
paddingTop: "10px",
|
|
67
|
+
}}
|
|
68
|
+
>
|
|
69
|
+
<Label>SDGs:</Label>
|
|
70
|
+
<SDGList>
|
|
71
|
+
{sdgList.map((sdg, index) => {
|
|
72
|
+
return (
|
|
73
|
+
<li key={index} className="project-widget-item">
|
|
74
|
+
<Tooltip title={t(`SDGS::${sdg}`)}>
|
|
75
|
+
<div
|
|
76
|
+
style={{
|
|
77
|
+
backgroundImage: `url(${SDG_IMAGES[sdg].img})`,
|
|
78
|
+
}}
|
|
79
|
+
className="sdg-item-image"
|
|
80
|
+
/>
|
|
81
|
+
</Tooltip>
|
|
82
|
+
</li>
|
|
83
|
+
);
|
|
84
|
+
})}
|
|
85
|
+
</SDGList>
|
|
86
|
+
</div>
|
|
87
|
+
)}
|
|
88
|
+
</Card>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
export const ImageContainer = styled.div`
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
position: relative;
|
|
6
|
+
|
|
7
|
+
.image {
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 151px;
|
|
10
|
+
background-size: cover;
|
|
11
|
+
background-position: center;
|
|
12
|
+
background-repeat: no-repeat;
|
|
13
|
+
|
|
14
|
+
border-bottom-left-radius: 3px;
|
|
15
|
+
border-bottom-right-radius: 3px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.icon-container {
|
|
19
|
+
position: absolute;
|
|
20
|
+
top: 10px;
|
|
21
|
+
right: 10px;
|
|
22
|
+
background: white;
|
|
23
|
+
padding: 10px;
|
|
24
|
+
border-radius: 6px;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
export const ProjectWidgetItems = styled.ul`
|
|
30
|
+
list-style: none;
|
|
31
|
+
padding: 0;
|
|
32
|
+
padding-top: 10px;
|
|
33
|
+
margin: 0;
|
|
34
|
+
|
|
35
|
+
.project-widget-item {
|
|
36
|
+
display: flex;
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
align-items: center;
|
|
39
|
+
border-bottom: 1px solid var(--base-gray-30);
|
|
40
|
+
padding: 10px 0;
|
|
41
|
+
|
|
42
|
+
&:last-of-type {
|
|
43
|
+
border-bottom: 0;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
|
|
48
|
+
export const SDGList = styled.ul`
|
|
49
|
+
list-style: none;
|
|
50
|
+
padding: 0;
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-wrap: wrap;
|
|
53
|
+
gap: 4px;
|
|
54
|
+
margin: 0;
|
|
55
|
+
|
|
56
|
+
.sdg-item-image {
|
|
57
|
+
width: 24px;
|
|
58
|
+
height: 24px;
|
|
59
|
+
background-size: cover;
|
|
60
|
+
background-position: center;
|
|
61
|
+
background-repeat: no-repeat;
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
export const Label = styled.span`
|
|
66
|
+
font-family: SF UI Display;
|
|
67
|
+
font-weight: 500;
|
|
68
|
+
font-style: Medium;
|
|
69
|
+
font-size: 14px;
|
|
70
|
+
leading-trim: NONE;
|
|
71
|
+
line-height: 26px;
|
|
72
|
+
letter-spacing: 0%;
|
|
73
|
+
color: #6c737f;
|
|
74
|
+
`;
|
|
@@ -5,6 +5,32 @@ export default {
|
|
|
5
5
|
title: "Dashboard/Widgets/SDGWidget",
|
|
6
6
|
component: SDGWidget,
|
|
7
7
|
tags: ["autodocs"],
|
|
8
|
+
argsTypes: {
|
|
9
|
+
activeSdgGoals: {
|
|
10
|
+
control: {
|
|
11
|
+
type: "checkbox",
|
|
12
|
+
},
|
|
13
|
+
options: [
|
|
14
|
+
"noPoverty",
|
|
15
|
+
"zeroHunger",
|
|
16
|
+
"goodHealthWellbeing",
|
|
17
|
+
"qualityEducation",
|
|
18
|
+
"genderEquality",
|
|
19
|
+
"cleanWaterSanitation",
|
|
20
|
+
"affordableCleanEnergy",
|
|
21
|
+
"decentWorkEconomicGrowth",
|
|
22
|
+
"industryInnovationInfrastructure",
|
|
23
|
+
"reducedInequalities",
|
|
24
|
+
"sustainableCitiesCommunities",
|
|
25
|
+
"responsibleConsumptionProduction",
|
|
26
|
+
"climateAction",
|
|
27
|
+
"lifeBelowWater",
|
|
28
|
+
"lifeOnLand",
|
|
29
|
+
"peaceJusticeStrongInstitutions",
|
|
30
|
+
"partnershipsForGoals",
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
8
34
|
decorators: [
|
|
9
35
|
(Story) => (
|
|
10
36
|
<div style={{ margin: "3em" }}>
|
|
@@ -42,20 +68,10 @@ export const Primary = {
|
|
|
42
68
|
},
|
|
43
69
|
};
|
|
44
70
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
// DECENT_WORK_ECONOMIC_GROWTH: "decentWorkEconomicGrowth",
|
|
53
|
-
// INDUSTRY_INNOVATION_INFRASTRUCTURE: "industryInnovationInfrastructure",
|
|
54
|
-
// REDUCED_INEQUALITIES: "reducedInequalities",
|
|
55
|
-
// SUSTAINABLE_CITIES_COMMUNITIES: "sustainableCitiesCommunities",
|
|
56
|
-
// RESPONSIBLE_CONSUMPTION_PRODUCTION: "responsibleConsumptionProduction",
|
|
57
|
-
// CLIMATE_ACTION: "climateAction",
|
|
58
|
-
// LIFE_BELOW_WATER: "lifeBelowWater",
|
|
59
|
-
// LIFE_ON_LAND: "lifeOnLand",
|
|
60
|
-
// PEACE_JUSTICE_STRONG_INSTITUTIONS: "peaceJusticeStrongInstitutions",
|
|
61
|
-
// PARTNERSHIPS_FOR_GOALS: "partnershipsForGoals",
|
|
71
|
+
export const Empty = {
|
|
72
|
+
name: "Empty",
|
|
73
|
+
args: {
|
|
74
|
+
title: "Sustainable Development Goals",
|
|
75
|
+
activeSdgGoals: [],
|
|
76
|
+
},
|
|
77
|
+
};
|
|
@@ -1,29 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
NO_POVERTY: "noPoverty",
|
|
3
|
-
ZERO_HUNGER: "zeroHunger",
|
|
4
|
-
GOOD_HEALTH_WELL_BEING: "goodHealthWellbeing",
|
|
5
|
-
QUALITY_EDUCATION: "qualityEducation",
|
|
6
|
-
GENDER_EQUALITY: "genderEquality",
|
|
7
|
-
CLEAN_WATER_SANITATION: "cleanWaterSanitation",
|
|
8
|
-
AFFORDABLE_CLEAN_ENERGY: "affordableCleanEnergy",
|
|
9
|
-
DECENT_WORK_ECONOMIC_GROWTH: "decentWorkEconomicGrowth",
|
|
10
|
-
INDUSTRY_INNOVATION_INFRASTRUCTURE: "industryInnovationInfrastructure",
|
|
11
|
-
REDUCED_INEQUALITIES: "reducedInequalities",
|
|
12
|
-
SUSTAINABLE_CITIES_COMMUNITIES: "sustainableCitiesCommunities",
|
|
13
|
-
RESPONSIBLE_CONSUMPTION_PRODUCTION: "responsibleConsumptionProduction",
|
|
14
|
-
CLIMATE_ACTION: "climateAction",
|
|
15
|
-
LIFE_BELOW_WATER: "lifeBelowWater",
|
|
16
|
-
LIFE_ON_LAND: "lifeOnLand",
|
|
17
|
-
PEACE_JUSTICE_STRONG_INSTITUTIONS: "peaceJusticeStrongInstitutions",
|
|
18
|
-
PARTNERSHIPS_FOR_GOALS: "partnershipsForGoals",
|
|
19
|
-
};
|
|
1
|
+
import { SDG_KEYS as KEYS } from "../../../../../../constants/SDGs";
|
|
20
2
|
|
|
21
3
|
export const getGoalConfig = () => {
|
|
22
4
|
return [
|
|
23
|
-
{ img: "/SDGs/SDGs.svg", key: KEYS.NO_POVERTY, disabled: "
|
|
24
|
-
{ img: "/SDGs/SDGs-1.svg", key: KEYS.ZERO_HUNGER, disabled: "
|
|
5
|
+
{ img: "/SDGs/SDGs.svg", key: KEYS.NO_POVERTY, disabled: "./SDGs/SDGs-17.svg" },
|
|
6
|
+
{ img: "/SDGs/SDGs-1.svg", key: KEYS.ZERO_HUNGER, disabled: "./SDGs/SDGs-18.svg" },
|
|
25
7
|
{
|
|
26
|
-
img:"/SDGs/SDGs-2.svg",
|
|
8
|
+
img: "/SDGs/SDGs-2.svg",
|
|
27
9
|
key: KEYS.GOOD_HEALTH_WELL_BEING,
|
|
28
10
|
disabled: "/SDGs/SDGs-19.svg",
|
|
29
11
|
},
|
|
@@ -32,12 +32,12 @@ export default function SDGWidget({
|
|
|
32
32
|
|
|
33
33
|
const SDGContainer = styled.div`
|
|
34
34
|
display: grid;
|
|
35
|
-
grid-template-columns: repeat(auto-fit, minmax(
|
|
35
|
+
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
|
|
36
36
|
gap: 8px;
|
|
37
37
|
|
|
38
38
|
.sdg-item {
|
|
39
|
-
height:
|
|
40
|
-
width:
|
|
39
|
+
height: 100px;
|
|
40
|
+
width: 100px;
|
|
41
41
|
border-radius: 8px;
|
|
42
42
|
background-size: cover;
|
|
43
43
|
background-position: center;
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
PlusOutlined,
|
|
8
8
|
DownOutlined,
|
|
9
9
|
UpOutlined,
|
|
10
|
-
RightOutlined
|
|
10
|
+
RightOutlined,
|
|
11
11
|
} from "@ant-design/icons";
|
|
12
12
|
import CustomIcon from "../../Icon/CustomIcon.jsx";
|
|
13
13
|
import WidgetLoader from "./WidgetLoader/index.jsx";
|
|
@@ -18,6 +18,7 @@ import { useCollapse } from "react-collapsed";
|
|
|
18
18
|
|
|
19
19
|
export default function Widget({
|
|
20
20
|
title = "",
|
|
21
|
+
noTitle = false,
|
|
21
22
|
children,
|
|
22
23
|
addedHeader = null,
|
|
23
24
|
tooltip,
|
|
@@ -73,102 +74,114 @@ export default function Widget({
|
|
|
73
74
|
])}
|
|
74
75
|
>
|
|
75
76
|
{loading && fullWidgetLoading && <WidgetLoader background="white" />}
|
|
76
|
-
|
|
77
|
-
<div className="
|
|
78
|
-
<div className="
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
{tooltip && (
|
|
83
|
-
<div className="cont icon-cont">
|
|
84
|
-
<Tooltip
|
|
85
|
-
rootClassName="dashboard-tooltip"
|
|
86
|
-
title={<div className="max-w-250">{tooltip}</div>}
|
|
87
|
-
>
|
|
88
|
-
<InfoCircleOutlined />
|
|
89
|
-
</Tooltip>
|
|
77
|
+
{!noTitle && (
|
|
78
|
+
<div className="widget-header flex-column">
|
|
79
|
+
<div className="flex flex-row widget-header-items">
|
|
80
|
+
<div className="title cont">
|
|
81
|
+
<h1>{title}</h1>
|
|
90
82
|
</div>
|
|
91
|
-
)}
|
|
92
83
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
84
|
+
{tooltip && (
|
|
85
|
+
<div className="cont icon-cont">
|
|
86
|
+
<Tooltip
|
|
87
|
+
rootClassName="dashboard-tooltip"
|
|
88
|
+
title={<div className="max-w-250">{tooltip}</div>}
|
|
89
|
+
>
|
|
90
|
+
<InfoCircleOutlined />
|
|
91
|
+
</Tooltip>
|
|
92
|
+
</div>
|
|
93
|
+
)}
|
|
94
|
+
|
|
95
|
+
{!!filtersConfig && (
|
|
96
|
+
<div className="flex-1 flex justify-content-end">
|
|
97
|
+
<Button onClick={() => setShowFilters((p) => !p)}>
|
|
98
|
+
<CustomIcon
|
|
99
|
+
name="Filter"
|
|
100
|
+
width={14}
|
|
101
|
+
height={13}
|
|
102
|
+
className="mt-1"
|
|
103
|
+
/>
|
|
104
|
+
</Button>
|
|
105
|
+
</div>
|
|
106
|
+
)}
|
|
100
107
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
{isCollapsable && (
|
|
104
|
-
<div className="flex justify-content-end">
|
|
105
|
-
<Button
|
|
106
|
-
size="small"
|
|
107
|
-
className="flex-1 no-min-width"
|
|
108
|
-
onClick={handleCollapseToggle}
|
|
109
|
-
icon={
|
|
110
|
-
isCollapsed ? (
|
|
111
|
-
<RightOutlined style={{ width: 12 }} />
|
|
112
|
-
) : (
|
|
113
|
-
<DownOutlined style={{ width: 12 }} />
|
|
114
|
-
)
|
|
115
|
-
}
|
|
116
|
-
/>
|
|
117
|
-
</div>
|
|
118
|
-
)}
|
|
108
|
+
{addedHeaderFirst && addedHeader}
|
|
119
109
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
className={formatClassname([
|
|
123
|
-
!(filtersConfig || addedHeaderFirst || isCollapsable) && "flex-1",
|
|
124
|
-
"flex justify-content-end",
|
|
125
|
-
])}
|
|
126
|
-
>
|
|
127
|
-
<div className="flex flex-column" {...getToggleProps()}>
|
|
110
|
+
{isCollapsable && (
|
|
111
|
+
<div className="flex justify-content-end">
|
|
128
112
|
<Button
|
|
129
113
|
size="small"
|
|
130
114
|
className="flex-1 no-min-width"
|
|
115
|
+
onClick={handleCollapseToggle}
|
|
131
116
|
icon={
|
|
132
|
-
|
|
133
|
-
<RightOutlined style={{ width:
|
|
134
|
-
//<PlusOutlined style={{width: 10}} />
|
|
117
|
+
isCollapsed ? (
|
|
118
|
+
<RightOutlined style={{ width: 12 }} />
|
|
135
119
|
) : (
|
|
136
|
-
|
|
137
|
-
<DownOutlined style={{ width: 10, paddingTop: '4px' }} />
|
|
120
|
+
<DownOutlined style={{ width: 12 }} />
|
|
138
121
|
)
|
|
139
122
|
}
|
|
140
123
|
/>
|
|
141
124
|
</div>
|
|
142
|
-
|
|
143
|
-
|
|
125
|
+
)}
|
|
126
|
+
|
|
127
|
+
{expandable ? (
|
|
128
|
+
<div
|
|
129
|
+
className={formatClassname([
|
|
130
|
+
!(filtersConfig || addedHeaderFirst || isCollapsable) &&
|
|
131
|
+
"flex-1",
|
|
132
|
+
"flex justify-content-end",
|
|
133
|
+
])}
|
|
134
|
+
>
|
|
135
|
+
<div className="flex flex-column" {...getToggleProps()}>
|
|
136
|
+
<Button
|
|
137
|
+
size="small"
|
|
138
|
+
className="flex-1 no-min-width"
|
|
139
|
+
icon={
|
|
140
|
+
!isExpanded ? (
|
|
141
|
+
<RightOutlined
|
|
142
|
+
style={{ width: 10, paddingTop: "4px" }}
|
|
143
|
+
/>
|
|
144
|
+
) : (
|
|
145
|
+
//<PlusOutlined style={{width: 10}} />
|
|
146
|
+
//<MinusOutlined style={{ width: 10 }} />
|
|
147
|
+
<DownOutlined
|
|
148
|
+
style={{ width: 10, paddingTop: "4px" }}
|
|
149
|
+
/>
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
/>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
) : null}
|
|
144
156
|
|
|
145
|
-
|
|
146
|
-
|
|
157
|
+
{!addedHeaderFirst && addedHeader}
|
|
158
|
+
</div>
|
|
147
159
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
160
|
+
{!!filtersConfig && (
|
|
161
|
+
<SelectFilters
|
|
162
|
+
t={filtersConfig.t}
|
|
163
|
+
apiUrl={apiUrl}
|
|
164
|
+
showFilters={showFilters}
|
|
165
|
+
onApply={filtersConfig.onApply}
|
|
166
|
+
options={filtersConfig.options}
|
|
167
|
+
setShowFilters={setShowFilters}
|
|
168
|
+
language={filtersConfig.language}
|
|
169
|
+
type={filtersConfig.type}
|
|
170
|
+
filtersConfig={filtersConfig.filtersConfig}
|
|
171
|
+
selectedFilters={filtersConfig.selectedFilters}
|
|
172
|
+
className={filtersConfig.className}
|
|
173
|
+
/>
|
|
174
|
+
)}
|
|
175
|
+
|
|
176
|
+
{!!tabsConfig && (
|
|
177
|
+
<TabsHeader
|
|
178
|
+
tabs={tabsConfig.tabs}
|
|
179
|
+
value={tabsConfig.value}
|
|
180
|
+
onChange={tabsConfig.onChange}
|
|
181
|
+
/>
|
|
182
|
+
)}
|
|
183
|
+
</div>
|
|
184
|
+
)}
|
|
172
185
|
|
|
173
186
|
{!isCollapsed && (
|
|
174
187
|
<div className="widget-body" {...(expandable ? getCollapseProps() : {})}>
|
|
@@ -52,16 +52,6 @@
|
|
|
52
52
|
background: transparent;
|
|
53
53
|
color: #d1d5db;
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
// Override disabled styles when the item is selected
|
|
57
|
-
&.ant-segmented-item-selected {
|
|
58
|
-
background: #ffffff !important;
|
|
59
|
-
color: #374151 !important;
|
|
60
|
-
font-weight: 600 !important;
|
|
61
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
|
|
62
|
-
opacity: 1 !important;
|
|
63
|
-
cursor: pointer !important;
|
|
64
|
-
}
|
|
65
55
|
}
|
|
66
56
|
}
|
|
67
57
|
|
|
@@ -90,7 +80,7 @@
|
|
|
90
80
|
}
|
|
91
81
|
|
|
92
82
|
// Responsive design
|
|
93
|
-
@media (max-width:
|
|
83
|
+
@media (max-width: 768px) {
|
|
94
84
|
&__segmented {
|
|
95
85
|
.ant-segmented-item {
|
|
96
86
|
font-size: 12px;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
const SDG_KEYS = {
|
|
2
|
+
NO_POVERTY: "noPoverty",
|
|
3
|
+
ZERO_HUNGER: "zeroHunger",
|
|
4
|
+
GOOD_HEALTH_WELL_BEING: "goodHealthWellbeing",
|
|
5
|
+
QUALITY_EDUCATION: "qualityEducation",
|
|
6
|
+
GENDER_EQUALITY: "genderEquality",
|
|
7
|
+
CLEAN_WATER_SANITATION: "cleanWaterSanitation",
|
|
8
|
+
AFFORDABLE_CLEAN_ENERGY: "affordableCleanEnergy",
|
|
9
|
+
DECENT_WORK_ECONOMIC_GROWTH: "decentWorkEconomicGrowth",
|
|
10
|
+
INDUSTRY_INNOVATION_INFRASTRUCTURE: "industryInnovationInfrastructure",
|
|
11
|
+
REDUCED_INEQUALITIES: "reducedInequalities",
|
|
12
|
+
SUSTAINABLE_CITIES_COMMUNITIES: "sustainableCitiesCommunities",
|
|
13
|
+
RESPONSIBLE_CONSUMPTION_PRODUCTION: "responsibleConsumptionProduction",
|
|
14
|
+
CLIMATE_ACTION: "climateAction",
|
|
15
|
+
LIFE_BELOW_WATER: "lifeBelowWater",
|
|
16
|
+
LIFE_ON_LAND: "lifeOnLand",
|
|
17
|
+
PEACE_JUSTICE_STRONG_INSTITUTIONS: "peaceJusticeStrongInstitutions",
|
|
18
|
+
PARTNERSHIPS_FOR_GOALS: "partnershipsForGoals",
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const SDG_IMAGES = {
|
|
22
|
+
[SDG_KEYS.NO_POVERTY]: {
|
|
23
|
+
img: "/SDGs/SDGs.svg",
|
|
24
|
+
disabled: "/SDGs/SDGs-17.svg",
|
|
25
|
+
},
|
|
26
|
+
[SDG_KEYS.ZERO_HUNGER]: {
|
|
27
|
+
img: "/SDGs/SDGs-1.svg",
|
|
28
|
+
disabled: "/SDGs/SDGs-18.svg",
|
|
29
|
+
},
|
|
30
|
+
[SDG_KEYS.GOOD_HEALTH_WELL_BEING]: {
|
|
31
|
+
img: "/SDGs/SDGs-2.svg",
|
|
32
|
+
disabled: "/SDGs/SDGs-19.svg",
|
|
33
|
+
},
|
|
34
|
+
[SDG_KEYS.QUALITY_EDUCATION]: {
|
|
35
|
+
img: "/SDGs/SDGs-3.svg",
|
|
36
|
+
disabled: "/SDGs/SDGs-20.svg",
|
|
37
|
+
},
|
|
38
|
+
[SDG_KEYS.GENDER_EQUALITY]: {
|
|
39
|
+
img: "/SDGs/SDGs-4.svg",
|
|
40
|
+
disabled: "/SDGs/SDGs-21.svg",
|
|
41
|
+
},
|
|
42
|
+
[SDG_KEYS.CLEAN_WATER_SANITATION]: {
|
|
43
|
+
img: "/SDGs/SDGs-5.svg",
|
|
44
|
+
disabled: "/SDGs/SDGs-22.svg",
|
|
45
|
+
},
|
|
46
|
+
[SDG_KEYS.AFFORDABLE_CLEAN_ENERGY]: {
|
|
47
|
+
img: "/SDGs/SDGs-6.svg",
|
|
48
|
+
disabled: "/SDGs/SDGs-23.svg",
|
|
49
|
+
},
|
|
50
|
+
[SDG_KEYS.DECENT_WORK_ECONOMIC_GROWTH]: {
|
|
51
|
+
img: "/SDGs/SDGs-7.svg",
|
|
52
|
+
disabled: "/SDGs/SDGs-24.svg",
|
|
53
|
+
},
|
|
54
|
+
[SDG_KEYS.INDUSTRY_INNOVATION_INFRASTRUCTURE]: {
|
|
55
|
+
img: "/SDGs/SDGs-8.svg",
|
|
56
|
+
disabled: "/SDGs/SDGs-25.svg",
|
|
57
|
+
},
|
|
58
|
+
[SDG_KEYS.REDUCED_INEQUALITIES]: {
|
|
59
|
+
img: "/SDGs/SDGs-9.svg",
|
|
60
|
+
disabled: "/SDGs/SDGs-26.svg",
|
|
61
|
+
},
|
|
62
|
+
[SDG_KEYS.SUSTAINABLE_CITIES_COMMUNITIES]: {
|
|
63
|
+
img: "/SDGs/SDGs-10.svg",
|
|
64
|
+
disabled: "/SDGs/SDGs-27.svg",
|
|
65
|
+
},
|
|
66
|
+
[SDG_KEYS.RESPONSIBLE_CONSUMPTION_PRODUCTION]: {
|
|
67
|
+
img: "/SDGs/SDGs-11.svg",
|
|
68
|
+
disabled: "/SDGs/SDGs-29.svg",
|
|
69
|
+
},
|
|
70
|
+
[SDG_KEYS.CLIMATE_ACTION]: {
|
|
71
|
+
img: "/SDGs/SDGs-12.svg",
|
|
72
|
+
disabled: "/SDGs/SDGs-30.svg",
|
|
73
|
+
},
|
|
74
|
+
[SDG_KEYS.LIFE_BELOW_WATER]: {
|
|
75
|
+
img: "/SDGs/SDGs-13.svg",
|
|
76
|
+
disabled: "/SDGs/SDGs-31.svg",
|
|
77
|
+
},
|
|
78
|
+
[SDG_KEYS.LIFE_ON_LAND]: {
|
|
79
|
+
img: "/SDGs/SDGs-14.svg",
|
|
80
|
+
disabled: "/SDGs/SDGs-32.svg",
|
|
81
|
+
},
|
|
82
|
+
[SDG_KEYS.PEACE_JUSTICE_STRONG_INSTITUTIONS]: {
|
|
83
|
+
img: "/SDGs/SDGs-15.svg",
|
|
84
|
+
disabled: "/SDGs/SDGs-33.svg",
|
|
85
|
+
},
|
|
86
|
+
[SDG_KEYS.PARTNERSHIPS_FOR_GOALS]: {
|
|
87
|
+
img: "/SDGs/SDGs-16.svg",
|
|
88
|
+
disabled: "/SDGs/SDGs-34.svg",
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export { SDG_KEYS, SDG_IMAGES };
|