datastake-daf 0.6.576 → 0.6.577
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 +29 -44
- package/dist/layouts/index.js +29 -44
- package/package.json +1 -1
- package/src/@daf/core/components/Sidenav/Menu.jsx +29 -45
package/dist/components/index.js
CHANGED
|
@@ -44813,16 +44813,8 @@ const modules = [{
|
|
|
44813
44813
|
|
|
44814
44814
|
/* eslint-disable no-unused-vars */
|
|
44815
44815
|
const featureIsNotAvailable = (t, isDemo) => {
|
|
44816
|
-
// Ensure translation always returns a string
|
|
44817
|
-
const safeTranslate = key => {
|
|
44818
|
-
const result = t(key);
|
|
44819
|
-
if (typeof result === 'object' && result !== null) {
|
|
44820
|
-
return key;
|
|
44821
|
-
}
|
|
44822
|
-
return String(result);
|
|
44823
|
-
};
|
|
44824
44816
|
antd.Modal.error({
|
|
44825
|
-
title:
|
|
44817
|
+
title: t("Feature not available"),
|
|
44826
44818
|
content: isDemo ? "This feature is not available in demo mode." : "This feature is not available to you.",
|
|
44827
44819
|
okText: "Ok",
|
|
44828
44820
|
onOk: () => {},
|
|
@@ -44853,13 +44845,6 @@ function SidenavMenu(_ref) {
|
|
|
44853
44845
|
// eslint-disable-next-line no-unused-vars
|
|
44854
44846
|
matchPath
|
|
44855
44847
|
} = _ref;
|
|
44856
|
-
const translate = key => {
|
|
44857
|
-
const result = t(key);
|
|
44858
|
-
if (typeof result === 'object' && result !== null) {
|
|
44859
|
-
return key;
|
|
44860
|
-
}
|
|
44861
|
-
return String(result);
|
|
44862
|
-
};
|
|
44863
44848
|
const {
|
|
44864
44849
|
allItems,
|
|
44865
44850
|
dashboardItems,
|
|
@@ -44935,7 +44920,7 @@ function SidenavMenu(_ref) {
|
|
|
44935
44920
|
document.addEventListener("mousemove", onMouseMove);
|
|
44936
44921
|
}
|
|
44937
44922
|
},
|
|
44938
|
-
label:
|
|
44923
|
+
label: t(item.name),
|
|
44939
44924
|
children: [isCollapsed ? {
|
|
44940
44925
|
disabled: true,
|
|
44941
44926
|
icon: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
@@ -44945,7 +44930,7 @@ function SidenavMenu(_ref) {
|
|
|
44945
44930
|
}),
|
|
44946
44931
|
className: "title",
|
|
44947
44932
|
key: "".concat(item.path),
|
|
44948
|
-
label:
|
|
44933
|
+
label: t(item.name)
|
|
44949
44934
|
} : null, ...item.items.filter(item => item.visible ? item.visible(user, project) : false).map(subitem => ({
|
|
44950
44935
|
style: subitem.style ? subitem.style : {},
|
|
44951
44936
|
key: "".concat(subitem.path),
|
|
@@ -44956,7 +44941,7 @@ function SidenavMenu(_ref) {
|
|
|
44956
44941
|
event: () => {
|
|
44957
44942
|
{
|
|
44958
44943
|
if (isDemo && !subitem.demo || subitem.isDisabled && subitem.isDisabled(user) && !isDev) {
|
|
44959
|
-
featureIsNotAvailable(
|
|
44944
|
+
featureIsNotAvailable(t, isDemo);
|
|
44960
44945
|
return;
|
|
44961
44946
|
}
|
|
44962
44947
|
if (subitem.path) {
|
|
@@ -44966,7 +44951,7 @@ function SidenavMenu(_ref) {
|
|
|
44966
44951
|
}
|
|
44967
44952
|
});
|
|
44968
44953
|
},
|
|
44969
|
-
label:
|
|
44954
|
+
label: t(subitem.name),
|
|
44970
44955
|
icon: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
44971
44956
|
width: 15,
|
|
44972
44957
|
height: 15,
|
|
@@ -45062,7 +45047,7 @@ function SidenavMenu(_ref) {
|
|
|
45062
45047
|
}
|
|
45063
45048
|
});
|
|
45064
45049
|
},
|
|
45065
|
-
label:
|
|
45050
|
+
label: t(item.name),
|
|
45066
45051
|
icon: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
45067
45052
|
width: 15,
|
|
45068
45053
|
height: 15,
|
|
@@ -45082,7 +45067,7 @@ function SidenavMenu(_ref) {
|
|
|
45082
45067
|
event: () => {
|
|
45083
45068
|
{
|
|
45084
45069
|
if (isDemo && !item.demo || item.isDisabled && item.isDisabled(user) && !isDev) {
|
|
45085
|
-
featureIsNotAvailable(
|
|
45070
|
+
featureIsNotAvailable(t, isDemo);
|
|
45086
45071
|
return;
|
|
45087
45072
|
}
|
|
45088
45073
|
if (item.path) {
|
|
@@ -45095,7 +45080,7 @@ function SidenavMenu(_ref) {
|
|
|
45095
45080
|
}
|
|
45096
45081
|
});
|
|
45097
45082
|
},
|
|
45098
|
-
label:
|
|
45083
|
+
label: t(item.name)
|
|
45099
45084
|
}]
|
|
45100
45085
|
} : {
|
|
45101
45086
|
key: item.path,
|
|
@@ -45111,7 +45096,7 @@ function SidenavMenu(_ref) {
|
|
|
45111
45096
|
event: () => {
|
|
45112
45097
|
{
|
|
45113
45098
|
if (isDemo && !item.demo || item.isDisabled && item.isDisabled(user) && !isDev) {
|
|
45114
|
-
featureIsNotAvailable(
|
|
45099
|
+
featureIsNotAvailable(t, isDemo);
|
|
45115
45100
|
return;
|
|
45116
45101
|
}
|
|
45117
45102
|
if (item.path) {
|
|
@@ -45124,7 +45109,7 @@ function SidenavMenu(_ref) {
|
|
|
45124
45109
|
}
|
|
45125
45110
|
});
|
|
45126
45111
|
},
|
|
45127
|
-
label:
|
|
45112
|
+
label: t(item.name)
|
|
45128
45113
|
} : {
|
|
45129
45114
|
key: "item-".concat(i),
|
|
45130
45115
|
icon: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
@@ -45158,7 +45143,7 @@ function SidenavMenu(_ref) {
|
|
|
45158
45143
|
document.addEventListener("mousemove", onMouseMove);
|
|
45159
45144
|
}
|
|
45160
45145
|
},
|
|
45161
|
-
label:
|
|
45146
|
+
label: t(item.name),
|
|
45162
45147
|
children: [isCollapsed ? {
|
|
45163
45148
|
disabled: true,
|
|
45164
45149
|
icon: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
@@ -45167,12 +45152,12 @@ function SidenavMenu(_ref) {
|
|
|
45167
45152
|
name: item.icon
|
|
45168
45153
|
}),
|
|
45169
45154
|
className: "title",
|
|
45170
|
-
label:
|
|
45155
|
+
label: t(item.name),
|
|
45171
45156
|
key: "".concat(item.name, "-link")
|
|
45172
45157
|
} : null, ...item.items.filter(item => item.visible ? item.visible(user, project) : false).map((subitem, j) => subitem.items ? renderSubMenu(subitem, "".concat(subitem.name)) : {
|
|
45173
45158
|
label: /*#__PURE__*/jsxRuntime.jsx(antd.Typography.Text, {
|
|
45174
45159
|
ellipsis: {
|
|
45175
|
-
tooltip:
|
|
45160
|
+
tooltip: t(subitem.name)
|
|
45176
45161
|
}
|
|
45177
45162
|
// style={{ color: module === 'tazama' ? 'var(--base-gray-90)' : module === 'cukura' ? 'var(--base-gray-70)' : 'white' }}
|
|
45178
45163
|
,
|
|
@@ -45180,7 +45165,7 @@ function SidenavMenu(_ref) {
|
|
|
45180
45165
|
color: subitem.color || (module === "tazama" ? "var(--base-gray-90)" : module === "cukura" ? "var(--base-gray-70)" : "white")
|
|
45181
45166
|
},
|
|
45182
45167
|
className: formatClassname([typeof selectedKeys[0] === "string" ? !!(selectedKeys[0].includes(subitem.path) || (subitem.subPath || []).find(p => matchPath(p, selectedKeys[0]))) && "selected-label" : ""]),
|
|
45183
|
-
children:
|
|
45168
|
+
children: t(subitem.name)
|
|
45184
45169
|
}),
|
|
45185
45170
|
style: subitem.style ? subitem.style : {},
|
|
45186
45171
|
icon: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
@@ -45217,91 +45202,91 @@ function SidenavMenu(_ref) {
|
|
|
45217
45202
|
className: "sidemenu-cont",
|
|
45218
45203
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
45219
45204
|
className: "title-span",
|
|
45220
|
-
children:
|
|
45205
|
+
children: t("analysis")
|
|
45221
45206
|
}), renderMenu(analysisItems)]
|
|
45222
45207
|
}) : null, coreItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
45223
45208
|
className: "sidemenu-cont",
|
|
45224
45209
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
45225
45210
|
className: "title-span",
|
|
45226
|
-
children:
|
|
45211
|
+
children: t("core")
|
|
45227
45212
|
}), renderMenu(coreItems)]
|
|
45228
45213
|
}) : null, activityItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
45229
45214
|
className: "sidemenu-cont",
|
|
45230
45215
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
45231
45216
|
className: "title-span",
|
|
45232
|
-
children:
|
|
45217
|
+
children: t("activities")
|
|
45233
45218
|
}), renderMenu(activityItems)]
|
|
45234
45219
|
}) : null, implementationItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
45235
45220
|
className: "sidemenu-cont",
|
|
45236
45221
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
45237
45222
|
className: "title-span",
|
|
45238
|
-
children:
|
|
45223
|
+
children: t("implementation")
|
|
45239
45224
|
}), renderMenu(implementationItems)]
|
|
45240
45225
|
}) : null, monitoringItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
45241
45226
|
className: "sidemenu-cont",
|
|
45242
45227
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
45243
45228
|
className: "title-span",
|
|
45244
|
-
children:
|
|
45229
|
+
children: t("monitoring")
|
|
45245
45230
|
}), renderMenu(monitoringItems)]
|
|
45246
45231
|
}) : null, impactAndBenefitItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
45247
45232
|
className: "sidemenu-cont",
|
|
45248
45233
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
45249
45234
|
className: "title-span",
|
|
45250
|
-
children:
|
|
45235
|
+
children: t("impact & benefit")
|
|
45251
45236
|
}), renderMenu(impactAndBenefitItems)]
|
|
45252
45237
|
}) : null, integrationItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
45253
45238
|
className: "sidemenu-cont",
|
|
45254
45239
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
45255
45240
|
className: "title-span",
|
|
45256
|
-
children:
|
|
45241
|
+
children: t("integrations")
|
|
45257
45242
|
}), renderMenu(integrationItems)]
|
|
45258
45243
|
}) : null, moduleItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
45259
45244
|
className: "sidemenu-cont",
|
|
45260
45245
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
45261
45246
|
className: "title-span",
|
|
45262
|
-
children:
|
|
45247
|
+
children: t("modules")
|
|
45263
45248
|
}), renderMenu(moduleItems)]
|
|
45264
45249
|
}) : null, allItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
45265
45250
|
className: "sidemenu-cont",
|
|
45266
45251
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
45267
45252
|
className: "title-span",
|
|
45268
|
-
children:
|
|
45253
|
+
children: t("Data")
|
|
45269
45254
|
}), renderMenu(allItems)]
|
|
45270
45255
|
}) : null, walletItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
45271
45256
|
className: "sidemenu-cont",
|
|
45272
45257
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
45273
45258
|
className: "title-span",
|
|
45274
|
-
children:
|
|
45259
|
+
children: t("Value")
|
|
45275
45260
|
}), renderMenu(walletItems)]
|
|
45276
45261
|
}) : null, specificationsItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
45277
45262
|
className: "sidemenu-cont",
|
|
45278
45263
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
45279
45264
|
className: "title-span",
|
|
45280
|
-
children:
|
|
45265
|
+
children: t("specifications")
|
|
45281
45266
|
}), renderMenu(specificationsItems)]
|
|
45282
45267
|
}) : null, operationsItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
45283
45268
|
className: "sidemenu-cont",
|
|
45284
45269
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
45285
45270
|
className: "title-span",
|
|
45286
|
-
children:
|
|
45271
|
+
children: t("operations")
|
|
45287
45272
|
}), renderMenu(operationsItems)]
|
|
45288
45273
|
}) : null, projectDataItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
45289
45274
|
className: "sidemenu-cont",
|
|
45290
45275
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
45291
45276
|
className: "title-span",
|
|
45292
|
-
children:
|
|
45277
|
+
children: t("Project Data")
|
|
45293
45278
|
}), renderMenu(projectDataItems)]
|
|
45294
45279
|
}) : null, showSettings && settingsItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
45295
45280
|
className: "sidemenu-cont",
|
|
45296
45281
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
45297
45282
|
className: "title-span",
|
|
45298
|
-
children:
|
|
45283
|
+
children: t("Configuration")
|
|
45299
45284
|
}), renderMenu(settingsItems)]
|
|
45300
45285
|
}) : null, settingsItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
45301
45286
|
className: "sidemenu-cont",
|
|
45302
45287
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
45303
45288
|
className: "title-span",
|
|
45304
|
-
children:
|
|
45289
|
+
children: t("Settings")
|
|
45305
45290
|
}), renderMenu(settingsItems)]
|
|
45306
45291
|
}) : null]
|
|
45307
45292
|
});
|
package/dist/layouts/index.js
CHANGED
|
@@ -4339,16 +4339,8 @@ CustomIcon.propTypes = {
|
|
|
4339
4339
|
|
|
4340
4340
|
/* eslint-disable no-unused-vars */
|
|
4341
4341
|
const featureIsNotAvailable = (t, isDemo) => {
|
|
4342
|
-
// Ensure translation always returns a string
|
|
4343
|
-
const safeTranslate = key => {
|
|
4344
|
-
const result = t(key);
|
|
4345
|
-
if (typeof result === 'object' && result !== null) {
|
|
4346
|
-
return key;
|
|
4347
|
-
}
|
|
4348
|
-
return String(result);
|
|
4349
|
-
};
|
|
4350
4342
|
antd.Modal.error({
|
|
4351
|
-
title:
|
|
4343
|
+
title: t("Feature not available"),
|
|
4352
4344
|
content: isDemo ? "This feature is not available in demo mode." : "This feature is not available to you.",
|
|
4353
4345
|
okText: "Ok",
|
|
4354
4346
|
onOk: () => {},
|
|
@@ -4378,13 +4370,6 @@ function SidenavMenu({
|
|
|
4378
4370
|
// eslint-disable-next-line no-unused-vars
|
|
4379
4371
|
matchPath
|
|
4380
4372
|
}) {
|
|
4381
|
-
const translate = key => {
|
|
4382
|
-
const result = t(key);
|
|
4383
|
-
if (typeof result === 'object' && result !== null) {
|
|
4384
|
-
return key;
|
|
4385
|
-
}
|
|
4386
|
-
return String(result);
|
|
4387
|
-
};
|
|
4388
4373
|
const {
|
|
4389
4374
|
allItems,
|
|
4390
4375
|
dashboardItems,
|
|
@@ -4460,7 +4445,7 @@ function SidenavMenu({
|
|
|
4460
4445
|
document.addEventListener("mousemove", onMouseMove);
|
|
4461
4446
|
}
|
|
4462
4447
|
},
|
|
4463
|
-
label:
|
|
4448
|
+
label: t(item.name),
|
|
4464
4449
|
children: [isCollapsed ? {
|
|
4465
4450
|
disabled: true,
|
|
4466
4451
|
icon: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
@@ -4470,7 +4455,7 @@ function SidenavMenu({
|
|
|
4470
4455
|
}),
|
|
4471
4456
|
className: "title",
|
|
4472
4457
|
key: `${item.path}`,
|
|
4473
|
-
label:
|
|
4458
|
+
label: t(item.name)
|
|
4474
4459
|
} : null, ...item.items.filter(item => item.visible ? item.visible(user, project) : false).map(subitem => ({
|
|
4475
4460
|
style: subitem.style ? subitem.style : {},
|
|
4476
4461
|
key: `${subitem.path}`,
|
|
@@ -4481,7 +4466,7 @@ function SidenavMenu({
|
|
|
4481
4466
|
event: () => {
|
|
4482
4467
|
{
|
|
4483
4468
|
if (isDemo && !subitem.demo || subitem.isDisabled && subitem.isDisabled(user) && !isDev) {
|
|
4484
|
-
featureIsNotAvailable(
|
|
4469
|
+
featureIsNotAvailable(t, isDemo);
|
|
4485
4470
|
return;
|
|
4486
4471
|
}
|
|
4487
4472
|
if (subitem.path) {
|
|
@@ -4491,7 +4476,7 @@ function SidenavMenu({
|
|
|
4491
4476
|
}
|
|
4492
4477
|
});
|
|
4493
4478
|
},
|
|
4494
|
-
label:
|
|
4479
|
+
label: t(subitem.name),
|
|
4495
4480
|
icon: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
4496
4481
|
width: 15,
|
|
4497
4482
|
height: 15,
|
|
@@ -4586,7 +4571,7 @@ function SidenavMenu({
|
|
|
4586
4571
|
}
|
|
4587
4572
|
});
|
|
4588
4573
|
},
|
|
4589
|
-
label:
|
|
4574
|
+
label: t(item.name),
|
|
4590
4575
|
icon: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
4591
4576
|
width: 15,
|
|
4592
4577
|
height: 15,
|
|
@@ -4606,7 +4591,7 @@ function SidenavMenu({
|
|
|
4606
4591
|
event: () => {
|
|
4607
4592
|
{
|
|
4608
4593
|
if (isDemo && !item.demo || item.isDisabled && item.isDisabled(user) && !isDev) {
|
|
4609
|
-
featureIsNotAvailable(
|
|
4594
|
+
featureIsNotAvailable(t, isDemo);
|
|
4610
4595
|
return;
|
|
4611
4596
|
}
|
|
4612
4597
|
if (item.path) {
|
|
@@ -4619,7 +4604,7 @@ function SidenavMenu({
|
|
|
4619
4604
|
}
|
|
4620
4605
|
});
|
|
4621
4606
|
},
|
|
4622
|
-
label:
|
|
4607
|
+
label: t(item.name)
|
|
4623
4608
|
}]
|
|
4624
4609
|
} : {
|
|
4625
4610
|
key: item.path,
|
|
@@ -4635,7 +4620,7 @@ function SidenavMenu({
|
|
|
4635
4620
|
event: () => {
|
|
4636
4621
|
{
|
|
4637
4622
|
if (isDemo && !item.demo || item.isDisabled && item.isDisabled(user) && !isDev) {
|
|
4638
|
-
featureIsNotAvailable(
|
|
4623
|
+
featureIsNotAvailable(t, isDemo);
|
|
4639
4624
|
return;
|
|
4640
4625
|
}
|
|
4641
4626
|
if (item.path) {
|
|
@@ -4648,7 +4633,7 @@ function SidenavMenu({
|
|
|
4648
4633
|
}
|
|
4649
4634
|
});
|
|
4650
4635
|
},
|
|
4651
|
-
label:
|
|
4636
|
+
label: t(item.name)
|
|
4652
4637
|
} : {
|
|
4653
4638
|
key: `item-${i}`,
|
|
4654
4639
|
icon: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
@@ -4682,7 +4667,7 @@ function SidenavMenu({
|
|
|
4682
4667
|
document.addEventListener("mousemove", onMouseMove);
|
|
4683
4668
|
}
|
|
4684
4669
|
},
|
|
4685
|
-
label:
|
|
4670
|
+
label: t(item.name),
|
|
4686
4671
|
children: [isCollapsed ? {
|
|
4687
4672
|
disabled: true,
|
|
4688
4673
|
icon: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
@@ -4691,12 +4676,12 @@ function SidenavMenu({
|
|
|
4691
4676
|
name: item.icon
|
|
4692
4677
|
}),
|
|
4693
4678
|
className: "title",
|
|
4694
|
-
label:
|
|
4679
|
+
label: t(item.name),
|
|
4695
4680
|
key: `${item.name}-link`
|
|
4696
4681
|
} : null, ...item.items.filter(item => item.visible ? item.visible(user, project) : false).map((subitem, j) => subitem.items ? renderSubMenu(subitem, `${subitem.name}`) : {
|
|
4697
4682
|
label: /*#__PURE__*/jsxRuntime.jsx(antd.Typography.Text, {
|
|
4698
4683
|
ellipsis: {
|
|
4699
|
-
tooltip:
|
|
4684
|
+
tooltip: t(subitem.name)
|
|
4700
4685
|
}
|
|
4701
4686
|
// style={{ color: module === 'tazama' ? 'var(--base-gray-90)' : module === 'cukura' ? 'var(--base-gray-70)' : 'white' }}
|
|
4702
4687
|
,
|
|
@@ -4704,7 +4689,7 @@ function SidenavMenu({
|
|
|
4704
4689
|
color: subitem.color || (module === "tazama" ? "var(--base-gray-90)" : module === "cukura" ? "var(--base-gray-70)" : "white")
|
|
4705
4690
|
},
|
|
4706
4691
|
className: formatClassname([typeof selectedKeys[0] === "string" ? !!(selectedKeys[0].includes(subitem.path) || (subitem.subPath || []).find(p => matchPath(p, selectedKeys[0]))) && "selected-label" : ""]),
|
|
4707
|
-
children:
|
|
4692
|
+
children: t(subitem.name)
|
|
4708
4693
|
}),
|
|
4709
4694
|
style: subitem.style ? subitem.style : {},
|
|
4710
4695
|
icon: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
@@ -4741,91 +4726,91 @@ function SidenavMenu({
|
|
|
4741
4726
|
className: "sidemenu-cont",
|
|
4742
4727
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4743
4728
|
className: "title-span",
|
|
4744
|
-
children:
|
|
4729
|
+
children: t("analysis")
|
|
4745
4730
|
}), renderMenu(analysisItems)]
|
|
4746
4731
|
}) : null, coreItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4747
4732
|
className: "sidemenu-cont",
|
|
4748
4733
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4749
4734
|
className: "title-span",
|
|
4750
|
-
children:
|
|
4735
|
+
children: t("core")
|
|
4751
4736
|
}), renderMenu(coreItems)]
|
|
4752
4737
|
}) : null, activityItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4753
4738
|
className: "sidemenu-cont",
|
|
4754
4739
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4755
4740
|
className: "title-span",
|
|
4756
|
-
children:
|
|
4741
|
+
children: t("activities")
|
|
4757
4742
|
}), renderMenu(activityItems)]
|
|
4758
4743
|
}) : null, implementationItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4759
4744
|
className: "sidemenu-cont",
|
|
4760
4745
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4761
4746
|
className: "title-span",
|
|
4762
|
-
children:
|
|
4747
|
+
children: t("implementation")
|
|
4763
4748
|
}), renderMenu(implementationItems)]
|
|
4764
4749
|
}) : null, monitoringItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4765
4750
|
className: "sidemenu-cont",
|
|
4766
4751
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4767
4752
|
className: "title-span",
|
|
4768
|
-
children:
|
|
4753
|
+
children: t("monitoring")
|
|
4769
4754
|
}), renderMenu(monitoringItems)]
|
|
4770
4755
|
}) : null, impactAndBenefitItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4771
4756
|
className: "sidemenu-cont",
|
|
4772
4757
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4773
4758
|
className: "title-span",
|
|
4774
|
-
children:
|
|
4759
|
+
children: t("impact & benefit")
|
|
4775
4760
|
}), renderMenu(impactAndBenefitItems)]
|
|
4776
4761
|
}) : null, integrationItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4777
4762
|
className: "sidemenu-cont",
|
|
4778
4763
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4779
4764
|
className: "title-span",
|
|
4780
|
-
children:
|
|
4765
|
+
children: t("integrations")
|
|
4781
4766
|
}), renderMenu(integrationItems)]
|
|
4782
4767
|
}) : null, moduleItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4783
4768
|
className: "sidemenu-cont",
|
|
4784
4769
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4785
4770
|
className: "title-span",
|
|
4786
|
-
children:
|
|
4771
|
+
children: t("modules")
|
|
4787
4772
|
}), renderMenu(moduleItems)]
|
|
4788
4773
|
}) : null, allItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4789
4774
|
className: "sidemenu-cont",
|
|
4790
4775
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4791
4776
|
className: "title-span",
|
|
4792
|
-
children:
|
|
4777
|
+
children: t("Data")
|
|
4793
4778
|
}), renderMenu(allItems)]
|
|
4794
4779
|
}) : null, walletItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4795
4780
|
className: "sidemenu-cont",
|
|
4796
4781
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4797
4782
|
className: "title-span",
|
|
4798
|
-
children:
|
|
4783
|
+
children: t("Value")
|
|
4799
4784
|
}), renderMenu(walletItems)]
|
|
4800
4785
|
}) : null, specificationsItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4801
4786
|
className: "sidemenu-cont",
|
|
4802
4787
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4803
4788
|
className: "title-span",
|
|
4804
|
-
children:
|
|
4789
|
+
children: t("specifications")
|
|
4805
4790
|
}), renderMenu(specificationsItems)]
|
|
4806
4791
|
}) : null, operationsItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4807
4792
|
className: "sidemenu-cont",
|
|
4808
4793
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4809
4794
|
className: "title-span",
|
|
4810
|
-
children:
|
|
4795
|
+
children: t("operations")
|
|
4811
4796
|
}), renderMenu(operationsItems)]
|
|
4812
4797
|
}) : null, projectDataItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4813
4798
|
className: "sidemenu-cont",
|
|
4814
4799
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4815
4800
|
className: "title-span",
|
|
4816
|
-
children:
|
|
4801
|
+
children: t("Project Data")
|
|
4817
4802
|
}), renderMenu(projectDataItems)]
|
|
4818
4803
|
}) : null, showSettings && settingsItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4819
4804
|
className: "sidemenu-cont",
|
|
4820
4805
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4821
4806
|
className: "title-span",
|
|
4822
|
-
children:
|
|
4807
|
+
children: t("Configuration")
|
|
4823
4808
|
}), renderMenu(settingsItems)]
|
|
4824
4809
|
}) : null, settingsItems.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4825
4810
|
className: "sidemenu-cont",
|
|
4826
4811
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4827
4812
|
className: "title-span",
|
|
4828
|
-
children:
|
|
4813
|
+
children: t("Settings")
|
|
4829
4814
|
}), renderMenu(settingsItems)]
|
|
4830
4815
|
}) : null]
|
|
4831
4816
|
});
|
package/package.json
CHANGED
|
@@ -8,17 +8,8 @@ import { formatClassname } from "../../../../helpers/ClassesHelper";
|
|
|
8
8
|
import { isModuleApproved, isSuperAdmin } from "../../../../helpers/user.js";
|
|
9
9
|
import { DownOutlined, RightOutlined } from "@ant-design/icons";
|
|
10
10
|
export const featureIsNotAvailable = (t, isDemo) => {
|
|
11
|
-
// Ensure translation always returns a string
|
|
12
|
-
const safeTranslate = (key) => {
|
|
13
|
-
const result = t(key);
|
|
14
|
-
if (typeof result === 'object' && result !== null) {
|
|
15
|
-
return key;
|
|
16
|
-
}
|
|
17
|
-
return String(result);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
11
|
Modal.error({
|
|
21
|
-
title:
|
|
12
|
+
title: t("Feature not available"),
|
|
22
13
|
content: isDemo
|
|
23
14
|
? "This feature is not available in demo mode."
|
|
24
15
|
: "This feature is not available to you.",
|
|
@@ -51,13 +42,6 @@ export default function SidenavMenu({
|
|
|
51
42
|
// eslint-disable-next-line no-unused-vars
|
|
52
43
|
matchPath,
|
|
53
44
|
}) {
|
|
54
|
-
const translate = (key) => {
|
|
55
|
-
const result = t(key);
|
|
56
|
-
if (typeof result === 'object' && result !== null) {
|
|
57
|
-
return key;
|
|
58
|
-
}
|
|
59
|
-
return String(result);
|
|
60
|
-
};
|
|
61
45
|
const {
|
|
62
46
|
allItems,
|
|
63
47
|
dashboardItems,
|
|
@@ -157,7 +141,7 @@ export default function SidenavMenu({
|
|
|
157
141
|
document.addEventListener("mousemove", onMouseMove);
|
|
158
142
|
}
|
|
159
143
|
},
|
|
160
|
-
label:
|
|
144
|
+
label: t(item.name),
|
|
161
145
|
children: [
|
|
162
146
|
isCollapsed
|
|
163
147
|
? {
|
|
@@ -165,7 +149,7 @@ export default function SidenavMenu({
|
|
|
165
149
|
icon: <CustomIcon width={15} height={15} name={item.icon} />,
|
|
166
150
|
className: "title",
|
|
167
151
|
key: `${item.path}`,
|
|
168
|
-
label:
|
|
152
|
+
label: t(item.name),
|
|
169
153
|
}
|
|
170
154
|
: null,
|
|
171
155
|
...item.items
|
|
@@ -192,7 +176,7 @@ export default function SidenavMenu({
|
|
|
192
176
|
(isDemo && !subitem.demo) ||
|
|
193
177
|
(subitem.isDisabled && subitem.isDisabled(user) && !isDev)
|
|
194
178
|
) {
|
|
195
|
-
featureIsNotAvailable(
|
|
179
|
+
featureIsNotAvailable(t, isDemo);
|
|
196
180
|
return;
|
|
197
181
|
}
|
|
198
182
|
if (subitem.path) {
|
|
@@ -204,7 +188,7 @@ export default function SidenavMenu({
|
|
|
204
188
|
},
|
|
205
189
|
});
|
|
206
190
|
},
|
|
207
|
-
label:
|
|
191
|
+
label: t(subitem.name),
|
|
208
192
|
icon: <CustomIcon width={15} height={15} name={subitem.icon} />,
|
|
209
193
|
})),
|
|
210
194
|
].filter((v) => !!v),
|
|
@@ -321,7 +305,7 @@ export default function SidenavMenu({
|
|
|
321
305
|
},
|
|
322
306
|
});
|
|
323
307
|
},
|
|
324
|
-
label:
|
|
308
|
+
label: t(item.name),
|
|
325
309
|
icon: <CustomIcon width={15} height={15} name={item.icon} />,
|
|
326
310
|
children: [
|
|
327
311
|
{
|
|
@@ -344,7 +328,7 @@ export default function SidenavMenu({
|
|
|
344
328
|
item.isDisabled(user) &&
|
|
345
329
|
!isDev)
|
|
346
330
|
) {
|
|
347
|
-
featureIsNotAvailable(
|
|
331
|
+
featureIsNotAvailable(t, isDemo);
|
|
348
332
|
return;
|
|
349
333
|
}
|
|
350
334
|
if (item.path) {
|
|
@@ -360,7 +344,7 @@ export default function SidenavMenu({
|
|
|
360
344
|
},
|
|
361
345
|
});
|
|
362
346
|
},
|
|
363
|
-
label:
|
|
347
|
+
label: t(item.name),
|
|
364
348
|
},
|
|
365
349
|
],
|
|
366
350
|
}
|
|
@@ -380,7 +364,7 @@ export default function SidenavMenu({
|
|
|
380
364
|
(isDemo && !item.demo) ||
|
|
381
365
|
(item.isDisabled && item.isDisabled(user) && !isDev)
|
|
382
366
|
) {
|
|
383
|
-
featureIsNotAvailable(
|
|
367
|
+
featureIsNotAvailable(t, isDemo);
|
|
384
368
|
return;
|
|
385
369
|
}
|
|
386
370
|
if (item.path) {
|
|
@@ -396,7 +380,7 @@ export default function SidenavMenu({
|
|
|
396
380
|
},
|
|
397
381
|
});
|
|
398
382
|
},
|
|
399
|
-
label:
|
|
383
|
+
label: t(item.name),
|
|
400
384
|
}
|
|
401
385
|
: {
|
|
402
386
|
key: `item-${i}`,
|
|
@@ -443,7 +427,7 @@ export default function SidenavMenu({
|
|
|
443
427
|
document.addEventListener("mousemove", onMouseMove);
|
|
444
428
|
}
|
|
445
429
|
},
|
|
446
|
-
label:
|
|
430
|
+
label: t(item.name),
|
|
447
431
|
children: [
|
|
448
432
|
isCollapsed
|
|
449
433
|
? {
|
|
@@ -452,7 +436,7 @@ export default function SidenavMenu({
|
|
|
452
436
|
<CustomIcon width={15} height={15} name={item.icon} />
|
|
453
437
|
),
|
|
454
438
|
className: "title",
|
|
455
|
-
label:
|
|
439
|
+
label: t(item.name),
|
|
456
440
|
key: `${item.name}-link`,
|
|
457
441
|
}
|
|
458
442
|
: null,
|
|
@@ -466,7 +450,7 @@ export default function SidenavMenu({
|
|
|
466
450
|
: {
|
|
467
451
|
label: (
|
|
468
452
|
<Typography.Text
|
|
469
|
-
ellipsis={{ tooltip:
|
|
453
|
+
ellipsis={{ tooltip: t(subitem.name) }}
|
|
470
454
|
// style={{ color: module === 'tazama' ? 'var(--base-gray-90)' : module === 'cukura' ? 'var(--base-gray-70)' : 'white' }}
|
|
471
455
|
style={{
|
|
472
456
|
color:
|
|
@@ -488,7 +472,7 @@ export default function SidenavMenu({
|
|
|
488
472
|
: "",
|
|
489
473
|
])}
|
|
490
474
|
>
|
|
491
|
-
{
|
|
475
|
+
{t(subitem.name)}
|
|
492
476
|
</Typography.Text>
|
|
493
477
|
),
|
|
494
478
|
style: subitem.style ? subitem.style : {},
|
|
@@ -551,91 +535,91 @@ export default function SidenavMenu({
|
|
|
551
535
|
) : null}
|
|
552
536
|
{analysisItems.length ? (
|
|
553
537
|
<div className="sidemenu-cont">
|
|
554
|
-
<span className="title-span">{
|
|
538
|
+
<span className="title-span">{t("analysis")}</span>
|
|
555
539
|
{renderMenu(analysisItems)}
|
|
556
540
|
</div>
|
|
557
541
|
) : null}
|
|
558
542
|
{coreItems.length ? (
|
|
559
543
|
<div className="sidemenu-cont">
|
|
560
|
-
<span className="title-span">{
|
|
544
|
+
<span className="title-span">{t("core")}</span>
|
|
561
545
|
{renderMenu(coreItems)}
|
|
562
546
|
</div>
|
|
563
547
|
) : null}
|
|
564
548
|
{activityItems.length ? (
|
|
565
549
|
<div className="sidemenu-cont">
|
|
566
|
-
<span className="title-span">{
|
|
550
|
+
<span className="title-span">{t("activities")}</span>
|
|
567
551
|
{renderMenu(activityItems)}
|
|
568
552
|
</div>
|
|
569
553
|
) : null}
|
|
570
554
|
{implementationItems.length ? (
|
|
571
555
|
<div className="sidemenu-cont">
|
|
572
|
-
<span className="title-span">{
|
|
556
|
+
<span className="title-span">{t("implementation")}</span>
|
|
573
557
|
{renderMenu(implementationItems)}
|
|
574
558
|
</div>
|
|
575
559
|
) : null}
|
|
576
560
|
{monitoringItems.length ? (
|
|
577
561
|
<div className="sidemenu-cont">
|
|
578
|
-
<span className="title-span">{
|
|
562
|
+
<span className="title-span">{t("monitoring")}</span>
|
|
579
563
|
{renderMenu(monitoringItems)}
|
|
580
564
|
</div>
|
|
581
565
|
) : null}
|
|
582
566
|
{impactAndBenefitItems.length ? (
|
|
583
567
|
<div className="sidemenu-cont">
|
|
584
|
-
<span className="title-span">{
|
|
568
|
+
<span className="title-span">{t("impact & benefit")}</span>
|
|
585
569
|
{renderMenu(impactAndBenefitItems)}
|
|
586
570
|
</div>
|
|
587
571
|
) : null}
|
|
588
572
|
{integrationItems.length ? (
|
|
589
573
|
<div className="sidemenu-cont">
|
|
590
|
-
<span className="title-span">{
|
|
574
|
+
<span className="title-span">{t("integrations")}</span>
|
|
591
575
|
{renderMenu(integrationItems)}
|
|
592
576
|
</div>
|
|
593
577
|
) : null}
|
|
594
578
|
{moduleItems.length ? (
|
|
595
579
|
<div className="sidemenu-cont">
|
|
596
|
-
<span className="title-span">{
|
|
580
|
+
<span className="title-span">{t("modules")}</span>
|
|
597
581
|
{renderMenu(moduleItems)}
|
|
598
582
|
</div>
|
|
599
583
|
) : null}
|
|
600
584
|
{allItems.length ? (
|
|
601
585
|
<div className="sidemenu-cont">
|
|
602
|
-
<span className="title-span">{
|
|
586
|
+
<span className="title-span">{t("Data")}</span>
|
|
603
587
|
{renderMenu(allItems)}
|
|
604
588
|
</div>
|
|
605
589
|
) : null}
|
|
606
590
|
{walletItems.length ? (
|
|
607
591
|
<div className="sidemenu-cont">
|
|
608
|
-
<span className="title-span">{
|
|
592
|
+
<span className="title-span">{t("Value")}</span>
|
|
609
593
|
{renderMenu(walletItems)}
|
|
610
594
|
</div>
|
|
611
595
|
) : null}
|
|
612
596
|
{specificationsItems.length ? (
|
|
613
597
|
<div className="sidemenu-cont">
|
|
614
|
-
<span className="title-span">{
|
|
598
|
+
<span className="title-span">{t("specifications")}</span>
|
|
615
599
|
{renderMenu(specificationsItems)}
|
|
616
600
|
</div>
|
|
617
601
|
) : null}
|
|
618
602
|
{operationsItems.length ? (
|
|
619
603
|
<div className="sidemenu-cont">
|
|
620
|
-
<span className="title-span">{
|
|
604
|
+
<span className="title-span">{t("operations")}</span>
|
|
621
605
|
{renderMenu(operationsItems)}
|
|
622
606
|
</div>
|
|
623
607
|
) : null}
|
|
624
608
|
{projectDataItems.length ? (
|
|
625
609
|
<div className="sidemenu-cont">
|
|
626
|
-
<span className="title-span">{
|
|
610
|
+
<span className="title-span">{t("Project Data")}</span>
|
|
627
611
|
{renderMenu(projectDataItems)}
|
|
628
612
|
</div>
|
|
629
613
|
) : null}
|
|
630
614
|
{showSettings && settingsItems.length ? (
|
|
631
615
|
<div className="sidemenu-cont">
|
|
632
|
-
<span className="title-span">{
|
|
616
|
+
<span className="title-span">{t("Configuration")}</span>
|
|
633
617
|
{renderMenu(settingsItems)}
|
|
634
618
|
</div>
|
|
635
619
|
) : null}
|
|
636
620
|
{settingsItems.length ? (
|
|
637
621
|
<div className="sidemenu-cont">
|
|
638
|
-
<span className="title-span">{
|
|
622
|
+
<span className="title-span">{t("Settings")}</span>
|
|
639
623
|
{renderMenu(settingsItems)}
|
|
640
624
|
</div>
|
|
641
625
|
) : null}
|