datastake-daf 0.6.840 → 0.6.841
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/pages/index.js
CHANGED
|
@@ -46553,7 +46553,7 @@ const getFilterConfig = ({
|
|
|
46553
46553
|
const productSet = new Set();
|
|
46554
46554
|
const allTradeMineralOptions = [...(operatorData?.suppliers || []), ...(operatorData?.clients || []), ...(operatorData?.locationSuppliers || [])].flatMap(trade => (trade?.products || []).filter(product => !!product?.typeOfProduct && !productSet.has(product.typeOfProduct)).map(product => {
|
|
46555
46555
|
productSet.add(product.typeOfProduct);
|
|
46556
|
-
const label = options?.[APP
|
|
46556
|
+
const label = options?.[APP === 'nashiriki' || APP === 'wazi' ? 'mineralOptions' : 'minerals']?.find(mineral => mineral.value === product.typeOfProduct)?.label;
|
|
46557
46557
|
return {
|
|
46558
46558
|
value: product.typeOfProduct,
|
|
46559
46559
|
label: label ?? product.typeOfProduct
|
|
@@ -47064,7 +47064,7 @@ const TradeRelationships = ({
|
|
|
47064
47064
|
t,
|
|
47065
47065
|
APP
|
|
47066
47066
|
});
|
|
47067
|
-
}, [filters.products, t, options?.mineralOptions, operatorData, options?.
|
|
47067
|
+
}, [filters.products, t, options?.mineralOptions, operatorData, options?.minerals, APP]);
|
|
47068
47068
|
const {
|
|
47069
47069
|
graphData,
|
|
47070
47070
|
loading,
|
|
@@ -47118,10 +47118,10 @@ const TradeRelationships = ({
|
|
|
47118
47118
|
},
|
|
47119
47119
|
renderTooltipItems: data => [{
|
|
47120
47120
|
label: "Product",
|
|
47121
|
-
value: data?.product || "
|
|
47121
|
+
value: findOptions(data?.product, options?.mineralOptions) || "-"
|
|
47122
47122
|
}, {
|
|
47123
47123
|
label: "Volume",
|
|
47124
|
-
value: data?.volume || "
|
|
47124
|
+
value: data?.volume || "-"
|
|
47125
47125
|
}],
|
|
47126
47126
|
maxZoom: 1.2,
|
|
47127
47127
|
minZoom: 0.4,
|
package/package.json
CHANGED
|
@@ -15,8 +15,11 @@ export const getFilterConfig = ({operatorData = {}, options = {}, filters = {},
|
|
|
15
15
|
.map((product) => {
|
|
16
16
|
productSet.add(product.typeOfProduct);
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const label = options?.[
|
|
19
|
+
APP === 'nashiriki' || APP === 'wazi'
|
|
20
|
+
? 'mineralOptions'
|
|
21
|
+
: 'minerals'
|
|
22
|
+
]?.find((mineral) => mineral.value === product.typeOfProduct,
|
|
20
23
|
)?.label;
|
|
21
24
|
|
|
22
25
|
return {
|
|
@@ -3,6 +3,9 @@ import { getFilterConfig } from './helper.js';
|
|
|
3
3
|
import { useTradeRelationship } from './hook.js';
|
|
4
4
|
import Widget from '../../../../../core/components/Dashboard/Widget/index.jsx';
|
|
5
5
|
import TradeRelationship from '../../../../../core/components/Graphs/TradeRelationship/index.jsx';
|
|
6
|
+
import { findOptions } from '../../../../../../helpers/StringHelper.js';
|
|
7
|
+
|
|
8
|
+
|
|
6
9
|
|
|
7
10
|
const TradeRelationships = ({
|
|
8
11
|
t = () => {},
|
|
@@ -23,7 +26,7 @@ const TradeRelationships = ({
|
|
|
23
26
|
|
|
24
27
|
const filterConfig = useMemo(() => {
|
|
25
28
|
return getFilterConfig({operatorData, options, filters, t, APP});
|
|
26
|
-
}, [filters.products, t, options?.mineralOptions, operatorData, options?.
|
|
29
|
+
}, [filters.products, t, options?.mineralOptions, operatorData, options?.minerals, APP]);
|
|
27
30
|
|
|
28
31
|
const { graphData, loading, fetchedProducts, setFetchedProducts } = useTradeRelationship({
|
|
29
32
|
id,
|
|
@@ -71,11 +74,11 @@ const TradeRelationships = ({
|
|
|
71
74
|
renderTooltipItems={(data) => [
|
|
72
75
|
{
|
|
73
76
|
label: "Product",
|
|
74
|
-
value: data?.product || "
|
|
77
|
+
value: findOptions(data?.product, options?.mineralOptions )|| "-",
|
|
75
78
|
},
|
|
76
79
|
{
|
|
77
80
|
label: "Volume",
|
|
78
|
-
value: data?.volume || "
|
|
81
|
+
value: data?.volume || "-",
|
|
79
82
|
},
|
|
80
83
|
]}
|
|
81
84
|
maxZoom={1.2}
|