datastake-daf 0.6.744 → 0.6.746
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/dist/components/index.js +620 -900
- package/dist/context/index.js +0 -3
- package/dist/hooks/index.js +19 -4658
- package/dist/layouts/index.js +573 -916
- package/dist/pages/index.css +1 -0
- package/dist/pages/index.js +4391 -997
- package/dist/services/index.js +1 -7
- package/dist/style/datastake/mapbox-gl.css +330 -0
- package/dist/utils/index.js +466 -808
- package/package.json +3 -1
- package/rollup.config.js +7 -2
- package/src/@daf/core/components/Dashboard/Widget/ImageCarousel/index.jsx +75 -54
- package/src/@daf/core/components/Dashboard/Widget/ImageCarousel/style.js +44 -0
- package/src/@daf/core/components/DynamicForm/components/ajaxModal.js +1 -1
- package/src/@daf/core/components/EditForm/components/Comment/index.js +1 -1
- package/src/@daf/core/components/EditForm/components/DataLink/ajaxSelectDataLink.js +1 -1
- package/src/@daf/core/components/EditForm/components/DataLink/flat.js +1 -1
- package/src/@daf/core/components/EditForm/components/DataLink/index.js +1 -1
- package/src/@daf/core/components/EditForm/components/DataLinkGroup/index.js +1 -1
- package/src/@daf/core/components/EditForm/components/Repeatable/index.js +1 -1
- package/src/@daf/core/components/EditForm/components/ajaxSelect.js +1 -1
- package/src/@daf/core/components/EditForm/components/geolocation.js +1 -0
- package/src/@daf/core/components/EditForm/helper.js +0 -4
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineAccount/index.jsx +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/index.jsx +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/index.jsx +1 -1
- package/src/@daf/core/components/Screens/TableScreen/TablePageWithTabs/index.jsx +128 -0
- package/src/@daf/{pages/pages → core/components/TableScreen}/TablePageWithTabs/index.jsx +5 -5
- package/src/@daf/layouts/AppLayout/index.jsx +5 -4
- package/src/@daf/layouts/AuthLayout/components/Select/style.js +1 -1
- package/src/@daf/layouts/AuthLayout/style.js +1 -1
- package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/Identification/index.js +0 -2
- package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/KeyIndicators/config.js +2 -2
- package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/MineSites/index.jsx +1 -5
- package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/config.js +2 -2
- package/src/@daf/pages/Documents/columns.js +102 -0
- package/src/@daf/pages/{dashboards/AllInformation/Documents → Documents}/create.jsx +2 -2
- package/src/@daf/pages/{dashboards/AllInformation/Documents → Documents}/index.jsx +9 -6
- package/src/@daf/pages/{dashboards/DueDilligence/Incidents → Events/Activities}/columns.js +8 -7
- package/src/@daf/pages/{dashboards/DueDilligence → Events}/Activities/create.jsx +2 -2
- package/src/@daf/pages/{dashboards/DueDilligence → Events}/Activities/index.jsx +6 -6
- package/src/@daf/pages/{dashboards/DueDilligence/Activities → Events/Incidents}/columns.js +5 -5
- package/src/@daf/pages/{dashboards/DueDilligence → Events}/Incidents/create.jsx +2 -2
- package/src/@daf/pages/{dashboards/DueDilligence → Events}/Incidents/index.jsx +5 -5
- package/src/@daf/pages/Events/columns.js +226 -0
- package/src/@daf/pages/{dashboards/AllInformation/Events → Events}/create.jsx +2 -2
- package/src/@daf/pages/{dashboards/AllInformation/Events → Events}/index.jsx +5 -9
- package/src/@daf/pages/{dashboards/Operations/ProductionSites → Locations/MineSite}/columns.js +4 -4
- package/src/@daf/pages/{dashboards/Operations/ProductionSites → Locations/MineSite}/create.jsx +2 -2
- package/src/@daf/pages/{dashboards/Operations/ProductionSites → Locations/MineSite}/index.jsx +5 -5
- package/src/@daf/pages/{dashboards/AllInformation/Locations → Locations}/columns.js +5 -5
- package/src/@daf/pages/{dashboards/AllInformation/Locations → Locations}/create.jsx +2 -2
- package/src/@daf/pages/{dashboards/AllInformation/Locations → Locations}/index.jsx +5 -5
- package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Operators/columns.js +5 -5
- package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Operators/create.jsx +2 -2
- package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Operators/index.jsx +5 -5
- package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Workers/columns.js +6 -6
- package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Workers/create.jsx +2 -2
- package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Workers/index.jsx +5 -5
- package/src/@daf/pages/{dashboards/AllInformation/Documents → Stakeholders}/columns.js +5 -5
- package/src/@daf/pages/{dashboards/AllInformation/Stakeholders → Stakeholders}/create.jsx +2 -2
- package/src/@daf/pages/{dashboards/AllInformation/Stakeholders → Stakeholders}/index.jsx +5 -5
- package/src/@daf/pages/Summary/Activities/Restoration/config.js +36 -0
- package/src/@daf/pages/Summary/Activities/Restoration/helper.js +98 -0
- package/src/@daf/pages/Summary/Activities/Restoration/index.jsx +178 -0
- package/src/@daf/pages/Summary/minesite/index.js +0 -0
- package/src/@daf/pages/Summary/operator/index.jsx +76 -0
- package/src/@daf/services/AuthenticationService.js +0 -1
- package/src/@daf/services/LinkedSubjects.js +1 -2
- package/src/pages.js +15 -13
- package/src/@daf/pages/dashboards/AllInformation/Events/columns.js +0 -151
- package/src/@daf/pages/dashboards/AllInformation/Stakeholders/columns.js +0 -132
- package/src/@daf/pages/dashboards/DueDilligence/Incidents2/columns.js +0 -176
- package/src/@daf/pages/dashboards/DueDilligence/Incidents2/config.js +0 -171
- package/src/@daf/pages/dashboards/DueDilligence/Incidents2/create.jsx +0 -104
- package/src/@daf/pages/dashboards/DueDilligence/Incidents2/index.jsx +0 -156
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/GenderDistribution/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/GenderDistribution/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/Identification/hook.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/Locations/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/Locations/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/KeyIndicators/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/KeyIndicators/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/SupplyChainMap/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/TradeRelationships/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/AccumulationGraph/hook.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/AccumulationGraph/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/ContributionsGraph/helper.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/ContributionsGraph/hook.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/ContributionsGraph/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/CustomSegment/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/DataChainOfCustody/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/DataCompilation/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/DataConsilidation/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/KeyIndicators/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/MineSites/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/MineSites/helper.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/Triangulation/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/Triangulation/hook.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/Triangulation/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/helper.js +0 -0
- /package/src/@daf/pages/{dashboards/AllInformation/Documents → Documents}/config.js +0 -0
- /package/src/@daf/pages/{dashboards/DueDilligence → Events}/Activities/config.js +0 -0
- /package/src/@daf/pages/{dashboards/DueDilligence → Events}/Incidents/config.js +0 -0
- /package/src/@daf/pages/{dashboards/AllInformation/Events → Events}/config.js +0 -0
- /package/src/@daf/pages/{dashboards/Operations/ProductionSites → Locations/MineSite}/config.js +0 -0
- /package/src/@daf/pages/{dashboards/AllInformation/Locations → Locations}/config.js +0 -0
- /package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Operators/config.js +0 -0
- /package/src/@daf/pages/{dashboards/Operations → Stakeholders}/Workers/config.js +0 -0
- /package/src/@daf/pages/{dashboards/AllInformation/Stakeholders → Stakeholders}/config.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "datastake-daf",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.746",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@ant-design/icons": "^5.2.5",
|
|
6
6
|
"@antv/g2": "^5.1.1",
|
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
"docx-preview": "^0.3.7",
|
|
23
23
|
"dot-object": "^2.1.5",
|
|
24
24
|
"file-saver": "^2.0.5",
|
|
25
|
+
"firebase": "^12.5.0",
|
|
25
26
|
"html-to-image": "^1.11.13",
|
|
27
|
+
"i18next": "^25.6.0",
|
|
26
28
|
"leaflet": "^1.0.3",
|
|
27
29
|
"leaflet-editable": "^1.3.0",
|
|
28
30
|
"leaflet-geosearch": "^3.1.0",
|
package/rollup.config.js
CHANGED
|
@@ -27,7 +27,7 @@ const external = [
|
|
|
27
27
|
"react-collapsed",
|
|
28
28
|
"leaflet-geosearch",
|
|
29
29
|
"react-html-parser",
|
|
30
|
-
"styled-
|
|
30
|
+
"styled-components",
|
|
31
31
|
"@ant-design/icons",
|
|
32
32
|
"deepmerge",
|
|
33
33
|
"leaflet.heat",
|
|
@@ -46,7 +46,12 @@ const external = [
|
|
|
46
46
|
"file-saver",
|
|
47
47
|
"axios",
|
|
48
48
|
"form-data",
|
|
49
|
-
"firebase"
|
|
49
|
+
"firebase",
|
|
50
|
+
"firebase/app",
|
|
51
|
+
"firebase/messaging",
|
|
52
|
+
"i18next",
|
|
53
|
+
"i18next-browser-languagedetector",
|
|
54
|
+
"react-i18next"
|
|
50
55
|
];
|
|
51
56
|
|
|
52
57
|
// Four builds, components, utils, hooks, context
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useState, useRef } from "react";
|
|
2
2
|
import CarouselWidget from "../CarouselWidget/index.jsx";
|
|
3
|
-
import { Image, Carousel } from "antd";
|
|
3
|
+
import { Image, Carousel, Empty } from "antd";
|
|
4
4
|
import { LeftOutlined, RightOutlined } from "@ant-design/icons";
|
|
5
5
|
import CustomArrowButton from "./components/CustomArrowButton/index.js";
|
|
6
|
-
import { StyledCarouselWrapper } from "./style.js";
|
|
6
|
+
import { StyledCarouselWrapper, EmptyStateContainer } from "./style.js";
|
|
7
7
|
import PropTypes from "prop-types";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -45,6 +45,8 @@ import PropTypes from "prop-types";
|
|
|
45
45
|
* @param {string} [props.arrowIconColor="#666"] - Default color of arrow icons
|
|
46
46
|
* @param {string} [props.arrowHoverIconColor="#1890ff"] - Color of arrow icons on hover
|
|
47
47
|
* @param {boolean} [props.customArrows=false] - Whether to show custom navigation arrows
|
|
48
|
+
* @param {ReactNode} [props.emptyLogo] - Custom logo/icon for empty state (defaults to Ant Design simple empty icon)
|
|
49
|
+
* @param {string|ReactNode} [props.emptyText="No Image"] - Custom text for empty state
|
|
48
50
|
* @param {Object} [props.rest] - Additional props passed to the underlying CarouselWidget component
|
|
49
51
|
*
|
|
50
52
|
* @features
|
|
@@ -74,6 +76,8 @@ function ImageCarousel({
|
|
|
74
76
|
arrowIconColor = "#666",
|
|
75
77
|
arrowHoverIconColor = "#1890ff",
|
|
76
78
|
customArrows = false,
|
|
79
|
+
emptyLogo = Empty.PRESENTED_IMAGE_SIMPLE,
|
|
80
|
+
emptyText = "No Image",
|
|
77
81
|
...rest
|
|
78
82
|
}) {
|
|
79
83
|
const [previewVisible, setPreviewVisible] = useState(false);
|
|
@@ -92,7 +96,11 @@ function ImageCarousel({
|
|
|
92
96
|
carouselRef.current?.next();
|
|
93
97
|
};
|
|
94
98
|
|
|
95
|
-
|
|
99
|
+
// Check if images array is empty or has no valid images
|
|
100
|
+
const hasImages = images && images.length > 0 && images.some(image => {
|
|
101
|
+
const imageSrc = typeof image === "string" ? image : image?.src;
|
|
102
|
+
return imageSrc && imageSrc.trim().length > 0;
|
|
103
|
+
});
|
|
96
104
|
return (
|
|
97
105
|
<>
|
|
98
106
|
<StyledCarouselWrapper
|
|
@@ -108,38 +116,47 @@ function ImageCarousel({
|
|
|
108
116
|
infinite
|
|
109
117
|
dots={false}
|
|
110
118
|
>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
{hasImages ? (
|
|
120
|
+
<Carousel ref={carouselRef} afterChange={handleCarouselChange} arrows={false} {...rest} infinite>
|
|
121
|
+
{images.map((image, index) => {
|
|
122
|
+
const imageSrc = typeof image === "string" ? image : image.src;
|
|
123
|
+
const imageAlt =
|
|
124
|
+
typeof image === "string"
|
|
125
|
+
? `${title} - Image ${index + 1}`
|
|
126
|
+
: image.alt;
|
|
118
127
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
128
|
+
return (
|
|
129
|
+
<div key={imageSrc}>
|
|
130
|
+
<div className="image-container">
|
|
131
|
+
<Image
|
|
132
|
+
src={imageSrc}
|
|
133
|
+
alt={imageAlt}
|
|
134
|
+
fallback={fallback}
|
|
135
|
+
loading="lazy"
|
|
136
|
+
preview={{
|
|
137
|
+
visible: false,
|
|
138
|
+
}}
|
|
139
|
+
onClick={() => {
|
|
140
|
+
setCurrent(index);
|
|
141
|
+
setPreviewVisible(true);
|
|
142
|
+
}}
|
|
143
|
+
/>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
);
|
|
147
|
+
})}
|
|
148
|
+
</Carousel>
|
|
149
|
+
) : (
|
|
150
|
+
<EmptyStateContainer height={height}>
|
|
151
|
+
<Empty
|
|
152
|
+
image={emptyLogo || Empty.PRESENTED_IMAGE_SIMPLE}
|
|
153
|
+
description={<span style={{ color: '#8C8C8C' }}>{emptyText}</span>}
|
|
154
|
+
/>
|
|
155
|
+
</EmptyStateContainer>
|
|
156
|
+
)}
|
|
140
157
|
</CarouselWidget>
|
|
141
158
|
|
|
142
|
-
{customArrows &&
|
|
159
|
+
{customArrows && hasImages && images.length > 1 && (
|
|
143
160
|
<>
|
|
144
161
|
<CustomArrowButton
|
|
145
162
|
icon={<LeftOutlined />}
|
|
@@ -158,29 +175,31 @@ function ImageCarousel({
|
|
|
158
175
|
)}
|
|
159
176
|
</StyledCarouselWrapper>
|
|
160
177
|
|
|
161
|
-
|
|
162
|
-
<
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
178
|
+
{hasImages && (
|
|
179
|
+
<div style={{ display: "none" }}>
|
|
180
|
+
<Image.PreviewGroup
|
|
181
|
+
preview={{
|
|
182
|
+
visible: previewVisible,
|
|
183
|
+
current,
|
|
184
|
+
onVisibleChange: (vis) => setPreviewVisible(vis),
|
|
185
|
+
onChange: (idx) => {
|
|
186
|
+
setCurrent(idx);
|
|
187
|
+
carouselRef.current?.goTo(idx);
|
|
188
|
+
},
|
|
189
|
+
}}
|
|
190
|
+
>
|
|
191
|
+
{images.map((image, index) => {
|
|
192
|
+
const imageSrc = typeof image === "string" ? image : image.src;
|
|
193
|
+
const imageAlt =
|
|
194
|
+
typeof image === "string"
|
|
195
|
+
? `${title} - Image ${index + 1}`
|
|
196
|
+
: image.alt;
|
|
179
197
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
198
|
+
return <Image key={imageSrc} src={imageSrc} alt={imageAlt} />;
|
|
199
|
+
})}
|
|
200
|
+
</Image.PreviewGroup>
|
|
201
|
+
</div>
|
|
202
|
+
)}
|
|
184
203
|
</>
|
|
185
204
|
);
|
|
186
205
|
}
|
|
@@ -195,6 +214,8 @@ ImageCarousel.propTypes = {
|
|
|
195
214
|
arrowIconColor: PropTypes.string,
|
|
196
215
|
arrowHoverIconColor: PropTypes.string,
|
|
197
216
|
customArrows: PropTypes.bool,
|
|
217
|
+
emptyLogo: PropTypes.node,
|
|
218
|
+
emptyText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
198
219
|
};
|
|
199
220
|
|
|
200
221
|
export default ImageCarousel;
|
|
@@ -42,4 +42,48 @@ export const StyledCarouselWrapper = styled.div`
|
|
|
42
42
|
margin-bottom: -3px !important;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
export const EmptyStateContainer = styled.div`
|
|
48
|
+
width: 100%;
|
|
49
|
+
height: ${props => props.height || 400}px;
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
background-color: #ffffff;
|
|
54
|
+
border-radius: 6px;
|
|
55
|
+
position: relative;
|
|
56
|
+
|
|
57
|
+
.ant-empty {
|
|
58
|
+
margin: 0;
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
height: 100%;
|
|
64
|
+
width: 100%;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ant-empty-image {
|
|
68
|
+
margin-bottom: 16px;
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.ant-empty-description {
|
|
75
|
+
text-align: center;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&::after {
|
|
79
|
+
content: '';
|
|
80
|
+
position: absolute;
|
|
81
|
+
bottom: 8px;
|
|
82
|
+
left: 50%;
|
|
83
|
+
transform: translateX(-50%);
|
|
84
|
+
width: 40px;
|
|
85
|
+
height: 2px;
|
|
86
|
+
background-color: #722ed1;
|
|
87
|
+
border-radius: 1px;
|
|
88
|
+
}
|
|
45
89
|
`;
|
|
@@ -521,7 +521,7 @@ export function AjaxSelectMain({
|
|
|
521
521
|
function updateOther(item, label, value) {
|
|
522
522
|
try {
|
|
523
523
|
// remove the last comma and closing bracket
|
|
524
|
-
const cleanedString = updateOtherValues
|
|
524
|
+
const cleanedString = updateOtherValues?.replace(/,\s*]$/, "]");
|
|
525
525
|
const updateOtherVal = updateOtherValues ? JSON.parse(cleanedString) : {};
|
|
526
526
|
const valueToSet = isDataLink ? item : value;
|
|
527
527
|
|
|
@@ -554,7 +554,7 @@ export default function DataLinkFlat({
|
|
|
554
554
|
footer={null}
|
|
555
555
|
width={650}
|
|
556
556
|
className="max-h-50"
|
|
557
|
-
|
|
557
|
+
destroyOnHidden
|
|
558
558
|
onCancel={onCloseModal}
|
|
559
559
|
title={(
|
|
560
560
|
<ModalHeader title={getLabelFromScopeForDataLink(form?.modalLabel || form?.label, formScope)} />
|
|
@@ -547,7 +547,7 @@ export default function DataLink({
|
|
|
547
547
|
footer={null}
|
|
548
548
|
width={650}
|
|
549
549
|
className="max-h-50"
|
|
550
|
-
|
|
550
|
+
destroyOnHidden
|
|
551
551
|
onCancel={onCloseModal}
|
|
552
552
|
title={(
|
|
553
553
|
<ModalHeader title={getLabelFromScopeForDataLink(form?.modalLabel || form?.label, formScope)} />
|
|
@@ -539,7 +539,7 @@ export default function DataLinkGroup({
|
|
|
539
539
|
footer={null}
|
|
540
540
|
width={650}
|
|
541
541
|
className="max-h-50"
|
|
542
|
-
|
|
542
|
+
destroyOnHidden
|
|
543
543
|
onCancel={onCloseModal}
|
|
544
544
|
title={(
|
|
545
545
|
<ModalHeader title={getLabelFromScopeForDataLink(form?.modalLabel || form?.label, formScope)} />
|
|
@@ -462,7 +462,7 @@ export function AjaxSelectMain({
|
|
|
462
462
|
function updateOther(item, label, value) {
|
|
463
463
|
try {
|
|
464
464
|
// remove the last comma and closing bracket
|
|
465
|
-
const cleanedString = updateOtherValues
|
|
465
|
+
const cleanedString = updateOtherValues?.replace(/,\s*]$/, "]");
|
|
466
466
|
const updateOtherVal = updateOtherValues ? JSON.parse(cleanedString) : {};
|
|
467
467
|
|
|
468
468
|
const _new = { ...formsValue };
|
|
@@ -2862,10 +2862,6 @@ export const GetFormItem = ({
|
|
|
2862
2862
|
if (input && typeof input === "object") {
|
|
2863
2863
|
// check if input is valid
|
|
2864
2864
|
const hideComment = namespace === "project-readiness";
|
|
2865
|
-
console.log("hideComment", {
|
|
2866
|
-
hideComment,
|
|
2867
|
-
namespace,
|
|
2868
|
-
});
|
|
2869
2865
|
return (
|
|
2870
2866
|
<>
|
|
2871
2867
|
<div className="flex-row input-cont">
|
|
@@ -52,7 +52,7 @@ export default function CombineLocationModal({
|
|
|
52
52
|
withModalFormWrapper={false}
|
|
53
53
|
width={1100}
|
|
54
54
|
disabled={isDisabled}
|
|
55
|
-
|
|
55
|
+
destroyOnHidden={true}
|
|
56
56
|
onValuesChange={() => {
|
|
57
57
|
setIsDisabled(() => {
|
|
58
58
|
const values = MainForm.getFieldsValue();
|
|
@@ -53,7 +53,7 @@ export default function CombineSubjectsModal({
|
|
|
53
53
|
withModalFormWrapper={false}
|
|
54
54
|
width={1100}
|
|
55
55
|
disabled={isDisabled}
|
|
56
|
-
|
|
56
|
+
destroyOnHidden={true}
|
|
57
57
|
onValuesChange={() => {
|
|
58
58
|
setIsDisabled(() => {
|
|
59
59
|
const values = MainForm.getFieldsValue();
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react'
|
|
2
|
+
import { Tabs, Drawer } from 'antd'
|
|
3
|
+
import Header from '../../../Header/index.jsx'
|
|
4
|
+
import BaseScreen from '../../BaseScreen/index.jsx'
|
|
5
|
+
import { CREATE_DRAWER_WIDTH } from '../../../../../../helpers/Forms.js'
|
|
6
|
+
import DrawerHeader from '../../../Header/DrawerHeader/index.jsx'
|
|
7
|
+
|
|
8
|
+
const TablePageWithTabs = ({
|
|
9
|
+
t= () => {},
|
|
10
|
+
title,
|
|
11
|
+
breadCrumbs,
|
|
12
|
+
location,
|
|
13
|
+
loading = false,
|
|
14
|
+
goTo = () => {},
|
|
15
|
+
defaultActiveTab = "own",
|
|
16
|
+
checkboxConfig = {},
|
|
17
|
+
columns = [],
|
|
18
|
+
data = {},
|
|
19
|
+
APP,
|
|
20
|
+
getApiBaseUrl = () => {},
|
|
21
|
+
selectOptions = {},
|
|
22
|
+
selectFiltersConfig = {},
|
|
23
|
+
getRedirectLink = () => {},
|
|
24
|
+
filtersConfig = {},
|
|
25
|
+
isMobile,
|
|
26
|
+
view,
|
|
27
|
+
getActiveTab = () => {},
|
|
28
|
+
onDownload = () => {},
|
|
29
|
+
downloadDisabled = false,
|
|
30
|
+
drawerTitle = "",
|
|
31
|
+
onCreateModalClose = () => {},
|
|
32
|
+
children
|
|
33
|
+
}) => {
|
|
34
|
+
const params = new URLSearchParams(location?.search);
|
|
35
|
+
const [activeTab, setActiveTab] = useState(params.get("tab") || defaultActiveTab);
|
|
36
|
+
const [openCreateModal, setOpenCreateModal] = useState(params.has("create"));
|
|
37
|
+
|
|
38
|
+
const getActiveTabRef = useRef(getActiveTab);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
getActiveTabRef.current = getActiveTab;
|
|
41
|
+
}, [getActiveTab]);
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
getActiveTabRef.current(activeTab);
|
|
45
|
+
}, [activeTab]);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<div className="semibold form-input-output daf-create-view">
|
|
49
|
+
<Header
|
|
50
|
+
title={t(title)}
|
|
51
|
+
breadcrumbs={breadCrumbs}
|
|
52
|
+
actionButtons={[
|
|
53
|
+
{
|
|
54
|
+
type: "primary",
|
|
55
|
+
onClick: () => setOpenCreateModal(true),
|
|
56
|
+
tooltip: t("New"),
|
|
57
|
+
icon: "Add",
|
|
58
|
+
},
|
|
59
|
+
]}
|
|
60
|
+
onDownload={onDownload}
|
|
61
|
+
downloadDisabled={downloadDisabled}
|
|
62
|
+
/>
|
|
63
|
+
<Tabs
|
|
64
|
+
items={[
|
|
65
|
+
{ label: t("All Data"), key: "all" },
|
|
66
|
+
{ label: t("Own Data"), key: "own" },
|
|
67
|
+
{ label: t("Partners"), key: "shared" },
|
|
68
|
+
]}
|
|
69
|
+
defaultActiveKey={activeTab}
|
|
70
|
+
activeKey={activeTab}
|
|
71
|
+
onChange={(val) => {
|
|
72
|
+
if (loading) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
setActiveTab(val);
|
|
77
|
+
|
|
78
|
+
const newParams = new URLSearchParams(location?.search);
|
|
79
|
+
newParams.set("tab", val);
|
|
80
|
+
goTo(`${location.pathname}?${newParams.toString()}`);
|
|
81
|
+
}}
|
|
82
|
+
className="view-page-tabs mt-3"
|
|
83
|
+
/>
|
|
84
|
+
<BaseScreen
|
|
85
|
+
t={t}
|
|
86
|
+
checkboxConfig={checkboxConfig}
|
|
87
|
+
defaultTableFilters={{}}
|
|
88
|
+
columns={columns}
|
|
89
|
+
data={data}
|
|
90
|
+
loading={loading}
|
|
91
|
+
location={location}
|
|
92
|
+
goTo={goTo}
|
|
93
|
+
APP={APP}
|
|
94
|
+
getApiBaseUrl={getApiBaseUrl}
|
|
95
|
+
selectOptions={selectOptions}
|
|
96
|
+
selectFilters={selectFiltersConfig}
|
|
97
|
+
view={view}
|
|
98
|
+
getRedirectLink={getRedirectLink}
|
|
99
|
+
defaultUrlParams={{}}
|
|
100
|
+
module={APP}
|
|
101
|
+
filtersConfig={filtersConfig}
|
|
102
|
+
isMobile={isMobile}
|
|
103
|
+
/>
|
|
104
|
+
{openCreateModal && (
|
|
105
|
+
<Drawer
|
|
106
|
+
destroyOnHidden
|
|
107
|
+
title={
|
|
108
|
+
<DrawerHeader
|
|
109
|
+
title={t(drawerTitle)}
|
|
110
|
+
/>
|
|
111
|
+
}
|
|
112
|
+
open={openCreateModal}
|
|
113
|
+
onClose={() => setOpenCreateModal(false)}
|
|
114
|
+
width={CREATE_DRAWER_WIDTH}
|
|
115
|
+
bodyStyle={{ padding: 0 }}
|
|
116
|
+
>
|
|
117
|
+
{typeof children === 'function'
|
|
118
|
+
? children({ onDrawerClose: () => setOpenCreateModal(false) })
|
|
119
|
+
: children
|
|
120
|
+
}
|
|
121
|
+
</Drawer>
|
|
122
|
+
)}
|
|
123
|
+
|
|
124
|
+
</div>
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export default TablePageWithTabs
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react'
|
|
2
2
|
import { Tabs, Drawer } from 'antd'
|
|
3
|
-
import Header from '../../../
|
|
4
|
-
import BaseScreen from '
|
|
3
|
+
import Header from '../../../Header/index.jsx'
|
|
4
|
+
import BaseScreen from '../../BaseScreen/index.jsx'
|
|
5
5
|
import { CREATE_DRAWER_WIDTH } from '../../../../helpers/Forms.js'
|
|
6
|
-
import DrawerHeader from '../../../
|
|
6
|
+
import DrawerHeader from '../../../Header/DrawerHeader/index.jsx'
|
|
7
7
|
|
|
8
8
|
const TablePageWithTabs = ({
|
|
9
9
|
t= () => {},
|
|
@@ -33,7 +33,7 @@ const TablePageWithTabs = ({
|
|
|
33
33
|
}) => {
|
|
34
34
|
const params = new URLSearchParams(location?.search);
|
|
35
35
|
const [activeTab, setActiveTab] = useState(params.get("tab") || defaultActiveTab);
|
|
36
|
-
const [openCreateModal, setOpenCreateModal] = useState(
|
|
36
|
+
const [openCreateModal, setOpenCreateModal] = useState(params.has("create"));
|
|
37
37
|
|
|
38
38
|
const getActiveTabRef = useRef(getActiveTab);
|
|
39
39
|
useEffect(() => {
|
|
@@ -103,7 +103,7 @@ const TablePageWithTabs = ({
|
|
|
103
103
|
/>
|
|
104
104
|
{openCreateModal && (
|
|
105
105
|
<Drawer
|
|
106
|
-
|
|
106
|
+
destroyOnHidden
|
|
107
107
|
title={
|
|
108
108
|
<DrawerHeader
|
|
109
109
|
title={t(drawerTitle)}
|
|
@@ -156,8 +156,9 @@ function AppLayout({
|
|
|
156
156
|
console.log(err);
|
|
157
157
|
}
|
|
158
158
|
};
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
if (!userPreferences) {
|
|
160
|
+
_fetchPreferences();
|
|
161
|
+
}
|
|
161
162
|
}, [getUserPreference]);
|
|
162
163
|
|
|
163
164
|
const setIsCollapse = (val = false) => {
|
|
@@ -370,9 +371,9 @@ function AppLayout({
|
|
|
370
371
|
className="ln-22 dark-select language-select"
|
|
371
372
|
style={{ color: 'white', height: '30px' }}
|
|
372
373
|
defaultValue={StorageManager.get('datastakeLng') || 'en'}
|
|
373
|
-
|
|
374
|
+
variant="borderless"
|
|
374
375
|
onChange={lng => updateLanguage?.(lng)}
|
|
375
|
-
|
|
376
|
+
classNames={{ popup: formatClassname(['dark-select-popup language-select', appName, theme.customHeaderColor && 'custom']) }}
|
|
376
377
|
>
|
|
377
378
|
{languageConfig.map(lang => (
|
|
378
379
|
<Select.Option key={lang.value} value={lang.value}>
|
package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/KeyIndicators/config.js
RENAMED
|
@@ -48,7 +48,7 @@ export const getRowConfig = ({ t, data = {}, goTo, getRedirectLink, theme = {} }
|
|
|
48
48
|
<div className="flex-1">{t("Corrective Actions")}</div>
|
|
49
49
|
<div
|
|
50
50
|
className="cursor-pointer"
|
|
51
|
-
onClick={() => goTo(getRedirectLink("/app/
|
|
51
|
+
onClick={() => goTo(getRedirectLink("/app/activities"))}
|
|
52
52
|
>
|
|
53
53
|
<CustomIcon
|
|
54
54
|
name="LinkNewTab"
|
|
@@ -77,7 +77,7 @@ export const getRowConfig = ({ t, data = {}, goTo, getRedirectLink, theme = {} }
|
|
|
77
77
|
<div className="flex-1">{t("Reported Incidents")}</div>
|
|
78
78
|
<div
|
|
79
79
|
className="cursor-pointer"
|
|
80
|
-
onClick={() => goTo(getRedirectLink("/app/
|
|
80
|
+
onClick={() => goTo(getRedirectLink("/app/incidents"))}
|
|
81
81
|
>
|
|
82
82
|
<CustomIcon
|
|
83
83
|
name="LinkNewTab"
|
package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/MineSites/index.jsx
RENAMED
|
@@ -63,11 +63,7 @@ function MineSites({
|
|
|
63
63
|
}),
|
|
64
64
|
[activeTab, selectedPartners],
|
|
65
65
|
);
|
|
66
|
-
|
|
67
|
-
console.log({activeTab})
|
|
68
|
-
console.log({dataFetchConfig})
|
|
69
|
-
|
|
70
|
-
const { data, loading, setData } = useWidgetFetch({config: dataFetchConfig});
|
|
66
|
+
const { data, loading, setData } = useWidgetFetch({config: dataFetchConfig});
|
|
71
67
|
|
|
72
68
|
const tabs = useMemo(() => getTabs(t), [t]);
|
|
73
69
|
|