datastake-daf 0.6.839 → 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.
@@ -16580,7 +16580,8 @@ function ProductionSites({
16580
16580
  goTo = () => {},
16581
16581
  getRedirectLink = () => {},
16582
16582
  data = [],
16583
- loading = false
16583
+ loading = false,
16584
+ APP
16584
16585
  }) {
16585
16586
  const productionSites = React.useMemo(() => {
16586
16587
  if (Array.isArray(data?.productionSites)) {
@@ -16601,7 +16602,7 @@ function ProductionSites({
16601
16602
  });
16602
16603
  }, [t, options, user, goTo, getRedirectLink]);
16603
16604
  return /*#__PURE__*/jsxRuntime.jsx(Widget, {
16604
- title: t("Production Sites"),
16605
+ title: t(APP === 'wazi' ? "Operating Sites" : "Production Site"),
16605
16606
  className: "with-border-header no-px-body",
16606
16607
  loading: loading,
16607
16608
  children: /*#__PURE__*/jsxRuntime.jsx(Wrapper, {
@@ -17183,7 +17184,8 @@ function SelfAssesment({
17183
17184
  theme = {},
17184
17185
  options = {},
17185
17186
  data,
17186
- loading
17187
+ loading,
17188
+ APP
17187
17189
  }) {
17188
17190
  return /*#__PURE__*/jsxRuntime.jsxs(DashboardLayout, {
17189
17191
  header: /*#__PURE__*/jsxRuntime.jsx(DAFHeader, {
@@ -17208,7 +17210,8 @@ function SelfAssesment({
17208
17210
  goTo: goTo,
17209
17211
  getRedirectLink: getRedirectLink,
17210
17212
  data: data,
17211
- loading: loading
17213
+ loading: loading,
17214
+ APP: APP
17212
17215
  })
17213
17216
  }), /*#__PURE__*/jsxRuntime.jsx("section", {
17214
17217
  children: /*#__PURE__*/jsxRuntime.jsx(AssociatedInformation$1, {
@@ -46550,7 +46553,7 @@ const getFilterConfig = ({
46550
46553
  const productSet = new Set();
46551
46554
  const allTradeMineralOptions = [...(operatorData?.suppliers || []), ...(operatorData?.clients || []), ...(operatorData?.locationSuppliers || [])].flatMap(trade => (trade?.products || []).filter(product => !!product?.typeOfProduct && !productSet.has(product.typeOfProduct)).map(product => {
46552
46555
  productSet.add(product.typeOfProduct);
46553
- const label = options?.[APP !== 'nashiriki' ? 'mineralOptions' : 'minerals']?.find(mineral => mineral.value === product.typeOfProduct)?.label;
46556
+ const label = options?.[APP === 'nashiriki' || APP === 'wazi' ? 'mineralOptions' : 'minerals']?.find(mineral => mineral.value === product.typeOfProduct)?.label;
46554
46557
  return {
46555
46558
  value: product.typeOfProduct,
46556
46559
  label: label ?? product.typeOfProduct
@@ -46600,6 +46603,7 @@ const mapItem = (data, options, goTo, getRedirectLink, operatorData = {}, APP) =
46600
46603
  value: data.country || operatorData?.country
46601
46604
  },
46602
46605
  totalSources: data.sources ?? 0,
46606
+ product: data?.product || "",
46603
46607
  volume: data?.volume || "",
46604
46608
  onClick: function () {
46605
46609
  if (data.type === "mineSite") {
@@ -47060,7 +47064,7 @@ const TradeRelationships = ({
47060
47064
  t,
47061
47065
  APP
47062
47066
  });
47063
- }, [filters.products, t, options?.mineralOptions, operatorData, options?.mineral, APP]);
47067
+ }, [filters.products, t, options?.mineralOptions, operatorData, options?.minerals, APP]);
47064
47068
  const {
47065
47069
  graphData,
47066
47070
  loading,
@@ -47113,8 +47117,11 @@ const TradeRelationships = ({
47113
47117
  return c.totalSources || 0;
47114
47118
  },
47115
47119
  renderTooltipItems: data => [{
47120
+ label: "Product",
47121
+ value: findOptions(data?.product, options?.mineralOptions) || "-"
47122
+ }, {
47116
47123
  label: "Volume",
47117
- value: data?.volume || "--"
47124
+ value: data?.volume || "-"
47118
47125
  }],
47119
47126
  maxZoom: 1.2,
47120
47127
  minZoom: 0.4,
@@ -47151,7 +47158,7 @@ const IconNodesConfig$1 = {
47151
47158
  emptyName: "no-management"
47152
47159
  },
47153
47160
  shareholders: {
47154
- name: "Stakeholders",
47161
+ name: "Shareholders",
47155
47162
  icon: "PercentCircle",
47156
47163
  order: 4,
47157
47164
  emptyName: "no-stakeholders"
@@ -64496,7 +64503,7 @@ function ProblemSolvers({
64496
64503
  }, [data]);
64497
64504
  const isEmpty = !pieData.length;
64498
64505
  const getTooltipChildren = React.useCallback(items => {
64499
- const item = items[0];
64506
+ const item = Array.isArray(items) ? items[0] : items;
64500
64507
  return renderTooltipJsx({
64501
64508
  title: item?.label || t("Undetermined"),
64502
64509
  link: true,
@@ -7850,6 +7850,7 @@ function mapUser(user) {
7850
7850
  }
7851
7851
 
7852
7852
  const en = {
7853
+ "Operating Sites": "Operating Sites",
7853
7854
  "Identified Mine Sites": "Identified Mine Sites",
7854
7855
  "Associated Documents": "Associated Documents",
7855
7856
  "Male": "Male",
@@ -7878,6 +7879,7 @@ const en = {
7878
7879
  "events": "Events",
7879
7880
  "merge-locations": "Merge Locations",
7880
7881
  "edit-account": "Edit Account",
7882
+ "testimonials": "Testimonials",
7881
7883
  "Are-you-sure-you-want-to-remove-the-user-from-this-account?": "Are you sure you want to remove the user from this account?",
7882
7884
  "The-user-will-lose-access-to-the-application-and-to-all-data-created-for-this-account.": "The user will lose access to the application and to all data created for this account.",
7883
7885
  "merge": "Merge",
@@ -9221,6 +9223,7 @@ const en = {
9221
9223
  };
9222
9224
 
9223
9225
  const fr = {
9226
+ "Operating Sites": "Sites d’Exploitation",
9224
9227
  "Identified Mine Sites": "Sites miniers identifiés",
9225
9228
  "Associated Documents": "Documents associés",
9226
9229
  "Male": "Masculin",
@@ -11158,6 +11161,7 @@ const fr = {
11158
11161
  };
11159
11162
 
11160
11163
  const sp = {
11164
+ "Operating Sites": "Sitios de Operación",
11161
11165
  "Identified Mine Sites": "Sitios mineros identificados",
11162
11166
  "Associated Documents": "Documentos asociados",
11163
11167
  "Male": "Masculino",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.839",
3
+ "version": "0.6.841",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -58,7 +58,7 @@ function ProblemSolvers({ selectedPartners = {}, loading: parentLoading = false,
58
58
  const isEmpty = !pieData.length;
59
59
 
60
60
  const getTooltipChildren = useCallback((items) => {
61
- const item = items[0];
61
+ const item = Array.isArray(items) ? items[0] : items;
62
62
 
63
63
  return renderTooltipJsx({
64
64
  title: item?.label || t("Undetermined"),
@@ -13,6 +13,7 @@ function ProductionSites({
13
13
  getRedirectLink = () => {},
14
14
  data = [],
15
15
  loading = false,
16
+ APP,
16
17
  }) {
17
18
 
18
19
  const productionSites = useMemo(() => {
@@ -32,7 +33,7 @@ function ProductionSites({
32
33
 
33
34
  return (
34
35
  <Widget
35
- title={t("Production Sites")}
36
+ title={t(APP === 'wazi' ? "Operating Sites" : "Production Site")}
36
37
  className="with-border-header no-px-body"
37
38
  loading={loading}
38
39
  >
@@ -14,7 +14,8 @@ function SelfAssesment({
14
14
  theme = {},
15
15
  options = {},
16
16
  data,
17
- loading
17
+ loading,
18
+ APP,
18
19
  }) {
19
20
  return (
20
21
  <DashboardLayout
@@ -29,7 +30,7 @@ function SelfAssesment({
29
30
  <OrganisationInformation t={t} user={user} goTo={goTo} getRedirectLink={getRedirectLink} theme={theme} data={data} loading={loading}/>
30
31
  </section>
31
32
  <section>
32
- <ProductionSites t={t} options={options} user={user} goTo={goTo} getRedirectLink={getRedirectLink} data={data} loading={loading} />
33
+ <ProductionSites t={t} options={options} user={user} goTo={goTo} getRedirectLink={getRedirectLink} data={data} loading={loading} APP={APP} />
33
34
  </section>
34
35
  <section>
35
36
  <AssociatedInformation t={t} user={user} goTo={goTo} getRedirectLink={getRedirectLink} data={data} loading={loading} theme={theme} options={options} />
@@ -0,0 +1,228 @@
1
+ // import React from "react";
2
+ // import DafButton from "../../../Button/index.jsx";
3
+ // import Loading from "../../../Loading/index.jsx";
4
+ // import AuthForm from "../../../AuthForm/index.jsx";
5
+
6
+ // const step = 1;
7
+
8
+ // export default function ResetPassword({
9
+ // resetRequestSuccedded,
10
+ // resetRequestError,
11
+ // submitting,
12
+ // requestResetPassword,
13
+ // resetPassword,
14
+ // params: propParams = {},
15
+ // Layout,
16
+ // goTo,
17
+ // t,
18
+ // theme,
19
+ // errors,
20
+
21
+ // loginPath: loginPathProp,
22
+ // }) {
23
+ // const { app, confirmationToken } = propParams;
24
+
25
+ // const getLogInLink = () => {
26
+ // if (loginPathProp) return loginPathProp;
27
+ // if (app) return `/${app}/login`;
28
+ // return "/login";
29
+ // };
30
+
31
+ // const handleGoToLogin = () => {
32
+ // const link = getLogInLink();
33
+ // if (goTo && typeof goTo === "function") {
34
+ // goTo(link);
35
+ // } else {
36
+ // window.location.href = link;
37
+ // }
38
+ // };
39
+
40
+ // const title = !confirmationToken
41
+ // ? resetRequestSuccedded
42
+ // ? "Thank you"
43
+ // : "Reset Password"
44
+ // : resetRequestSuccedded
45
+ // ? "Password updated"
46
+ // : "Create Password";
47
+
48
+ // const subTitle = !confirmationToken
49
+ // ? resetRequestSuccedded
50
+ // ? "A password reset link has been sent to your email address. If you can’t find the message in your inbox, please check your spam folder!"
51
+ // : "Please enter your email, to get a link and request a new password."
52
+ // : resetRequestSuccedded
53
+ // ? "Your password has been updated, click in the button below to log in."
54
+ // : "Please set up your new password.";
55
+
56
+ // const requestResetFields = [
57
+ // {
58
+ // name: "email",
59
+ // label: t("Email"),
60
+ // type: "input",
61
+ // required: true,
62
+ // rules: [
63
+ // {
64
+ // required: true,
65
+ // message: t("errors::email should not be empty"),
66
+ // },
67
+ // {
68
+ // pattern:
69
+ // /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/,
70
+ // message: t("errors::email is not valid"),
71
+ // },
72
+ // ],
73
+ // placeholder: t("Email"),
74
+ // },
75
+ // ];
76
+
77
+ // const resetPasswordFields = [
78
+ // {
79
+ // name: "password",
80
+ // label: t("Enter password"),
81
+ // type: "password",
82
+ // required: true,
83
+ // rules: [
84
+ // {
85
+ // required: true,
86
+ // message: t("errors::password should not be empty"),
87
+ // },
88
+ // ],
89
+ // placeholder: t("••••••••"),
90
+ // },
91
+ // {
92
+ // name: "confirmPassword",
93
+ // label: t("Confirm password"),
94
+ // type: "password",
95
+ // required: true,
96
+ // dependencies: ["password"],
97
+ // rules: [
98
+ // {
99
+ // required: true,
100
+ // message: t("errors::password should not be empty"),
101
+ // },
102
+ // ({ getFieldValue }) => ({
103
+ // validator(rule, value) {
104
+ // if (!value || getFieldValue("password") === value) {
105
+ // return Promise.resolve();
106
+ // }
107
+ // return Promise.reject(t("errors::passwordNotMatch"));
108
+ // },
109
+ // }),
110
+ // ],
111
+ // placeholder: t("••••••••"),
112
+ // },
113
+ // ];
114
+
115
+ // const handleRequestResetSubmit = (values) => {
116
+ // requestResetPassword(values);
117
+ // };
118
+
119
+ // const handleResetPasswordSubmit = (values) => {
120
+
121
+ // resetPassword({
122
+ // ...values,
123
+ // passConfirmationToken: confirmationToken,
124
+ // });
125
+ // };
126
+
127
+ // const currentTheme = theme || window.theme;
128
+
129
+ // const Content = (
130
+ // <>
131
+ // {!resetRequestSuccedded && !confirmationToken && (
132
+ // <>
133
+ // <AuthForm
134
+ // fields={requestResetFields}
135
+ // onSubmit={handleRequestResetSubmit}
136
+ // submitText={t("Get Link")}
137
+ // errors={errors}
138
+ // t={t}
139
+ // executeRecaptcha={() => Promise.resolve(true)}
140
+ // theme={currentTheme}
141
+ // submitButtonProps={{
142
+ // loading: submitting,
143
+ // }}
144
+ // />
145
+ // <div className="mt-4">
146
+ // <DafButton
147
+ // type="default"
148
+ // className="normal-br"
149
+ // style={
150
+ // currentTheme
151
+ // ? {
152
+ // borderColor: currentTheme.colorPrimary,
153
+ // color: currentTheme.colorPrimary,
154
+ // }
155
+ // : {}
156
+ // }
157
+ // onClick={handleGoToLogin}
158
+ // >
159
+ // {t("Back")}
160
+ // </DafButton>
161
+ // </div>
162
+
163
+ // {resetRequestError ? (
164
+ // <div
165
+ // className="ant-form-item-explain errors-cont no-pt mt-3"
166
+ // style={{ color: "#ff4d4f" }}
167
+ // >
168
+ // {t(resetRequestError)}
169
+ // </div>
170
+ // ) : null}
171
+ // </>
172
+ // )}
173
+
174
+ // {!resetRequestSuccedded && confirmationToken && (
175
+ // <AuthForm
176
+ // fields={resetPasswordFields}
177
+ // onSubmit={handleResetPasswordSubmit}
178
+ // submitText={t("Reset Password")}
179
+ // errors={errors}
180
+ // t={t}
181
+ // executeRecaptcha={() => Promise.resolve(true)}
182
+ // theme={currentTheme}
183
+ // submitButtonProps={{
184
+ // loading: submitting,
185
+ // }}
186
+ // />
187
+ // )}
188
+
189
+ // {resetRequestSuccedded && confirmationToken && (
190
+ // <div className="buttons">
191
+ // <DafButton
192
+ // type="primary"
193
+ // className="normal-br"
194
+ // style={
195
+ // currentTheme
196
+ // ? {
197
+ // backgroundColor: currentTheme.colorPrimary,
198
+ // borderColor: currentTheme.colorPrimary,
199
+ // }
200
+ // : {}
201
+ // }
202
+ // onClick={handleGoToLogin}
203
+ // >
204
+ // {t("Log In")}
205
+ // </DafButton>
206
+ // </div>
207
+ // )}
208
+
209
+ // {resetRequestSuccedded && !confirmationToken && null}
210
+ // </>
211
+ // );
212
+
213
+ // if (Layout) {
214
+ // return (
215
+ // <Layout app={app} step={step} title={title} subTitle={subTitle}>
216
+ // {Content}
217
+ // </Layout>
218
+ // );
219
+ // }
220
+
221
+ // return (
222
+ // <div style={{ padding: 20, maxWidth: 400, margin: "0 auto" }}>
223
+ // <h2>{title}</h2>
224
+ // <p>{subTitle}</p>
225
+ // {Content}
226
+ // </div>
227
+ // );
228
+ // }
@@ -18,7 +18,7 @@ export const IconNodesConfig = {
18
18
  emptyName: "no-management",
19
19
  },
20
20
  shareholders: {
21
- name: "Stakeholders",
21
+ name: "Shareholders",
22
22
  icon: "PercentCircle",
23
23
  order: 4,
24
24
  emptyName: "no-stakeholders",
@@ -15,8 +15,11 @@ export const getFilterConfig = ({operatorData = {}, options = {}, filters = {},
15
15
  .map((product) => {
16
16
  productSet.add(product.typeOfProduct);
17
17
 
18
- const label = options?.[APP !== 'nashiriki' ? 'mineralOptions' : 'minerals']?.find(
19
- (mineral) => mineral.value === product.typeOfProduct,
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 {
@@ -82,6 +85,7 @@ export const mapItem = (data, options, goTo, getRedirectLink, operatorData = {},
82
85
  value: data.country || operatorData?.country,
83
86
  },
84
87
  totalSources: data.sources ?? 0,
88
+ product: data?.product || "",
85
89
  volume: data?.volume || "",
86
90
  onClick: function () {
87
91
  if (data.type === "mineSite") {
@@ -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?.mineral, APP]);
29
+ }, [filters.products, t, options?.mineralOptions, operatorData, options?.minerals, APP]);
27
30
 
28
31
  const { graphData, loading, fetchedProducts, setFetchedProducts } = useTradeRelationship({
29
32
  id,
@@ -68,12 +71,16 @@ const TradeRelationships = ({
68
71
  getTotal={(c) => {
69
72
  return c.totalSources || 0;
70
73
  }}
71
- renderTooltipItems={(data) => [
72
- {
73
- label: "Volume",
74
- value: data?.volume || "--",
75
- },
76
- ]}
74
+ renderTooltipItems={(data) => [
75
+ {
76
+ label: "Product",
77
+ value: findOptions(data?.product, options?.mineralOptions )|| "-",
78
+ },
79
+ {
80
+ label: "Volume",
81
+ value: data?.volume || "-",
82
+ },
83
+ ]}
77
84
  maxZoom={1.2}
78
85
  minZoom={0.4}
79
86
  tooltipTitle="Trade"
@@ -1,4 +1,5 @@
1
1
  const en = {
2
+ "Operating Sites": "Operating Sites",
2
3
  "Identified Mine Sites": "Identified Mine Sites",
3
4
  "Associated Documents": "Associated Documents",
4
5
  "Male": "Male",
@@ -27,6 +28,7 @@ const en = {
27
28
  "events": "Events",
28
29
  "merge-locations": "Merge Locations",
29
30
  "edit-account": "Edit Account",
31
+ "testimonials": "Testimonials",
30
32
  "Are-you-sure-you-want-to-remove-the-user-from-this-account?": "Are you sure you want to remove the user from this account?",
31
33
  "The-user-will-lose-access-to-the-application-and-to-all-data-created-for-this-account.": "The user will lose access to the application and to all data created for this account.",
32
34
  "merge": "Merge",
@@ -1,4 +1,5 @@
1
1
  const fr = {
2
+ "Operating Sites": "Sites d’Exploitation",
2
3
  "Identified Mine Sites": "Sites miniers identifiés",
3
4
  "Associated Documents": "Documents associés",
4
5
  "Male": "Masculin",
@@ -1,4 +1,5 @@
1
1
  const sp = {
2
+ "Operating Sites": "Sitios de Operación",
2
3
  "Identified Mine Sites": "Sitios mineros identificados",
3
4
  "Associated Documents": "Documentos asociados",
4
5
  "Male": "Masculino",
package/src/index.js CHANGED
@@ -209,4 +209,9 @@ export { default as SettingsView } from "./@daf/core/components/Screens/Settings
209
209
  export { default as SettingsEdit } from "./@daf/core/components/Screens/Settings/Edit/index.js";
210
210
  export { default as SettingsHeader } from "./@daf/core/components/Screens/Settings/components/Header/index.js";
211
211
  export { default as SettingsMenu } from "./@daf/core/components/Screens/Settings/components/Menu/index.js";
212
- export { INPUT_TYPES, ACTIVE_FORM_KEY, PLACEHOLDER, getDefaultActiveForm } from "./@daf/core/components/Screens/Settings/config.js";
212
+ export { INPUT_TYPES, ACTIVE_FORM_KEY, PLACEHOLDER, getDefaultActiveForm } from "./@daf/core/components/Screens/Settings/config.js";
213
+
214
+
215
+
216
+ // Reset Password
217
+ // export { default as ResetPassword } from "./@daf/pages/ResetPassword/index.jsx";
package/build/favicon.ico DELETED
Binary file
package/build/logo192.png DELETED
Binary file
package/build/logo512.png DELETED
Binary file
@@ -1,25 +0,0 @@
1
- {
2
- "short_name": "React App",
3
- "name": "Create React App Sample",
4
- "icons": [
5
- {
6
- "src": "favicon.ico",
7
- "sizes": "64x64 32x32 24x24 16x16",
8
- "type": "image/x-icon"
9
- },
10
- {
11
- "src": "logo192.png",
12
- "type": "image/png",
13
- "sizes": "192x192"
14
- },
15
- {
16
- "src": "logo512.png",
17
- "type": "image/png",
18
- "sizes": "512x512"
19
- }
20
- ],
21
- "start_url": ".",
22
- "display": "standalone",
23
- "theme_color": "#000000",
24
- "background_color": "#ffffff"
25
- }
package/build/robots.txt DELETED
@@ -1,3 +0,0 @@
1
- # https://www.robotstxt.org/robotstxt.html
2
- User-agent: *
3
- Disallow: