datastake-daf 0.6.503 → 0.6.504
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/layouts/index.js
CHANGED
|
@@ -5200,7 +5200,10 @@ const Sidenav = ({
|
|
|
5200
5200
|
changeNotificationState,
|
|
5201
5201
|
userHelpers = {},
|
|
5202
5202
|
isDev = false,
|
|
5203
|
-
appName = 'app'
|
|
5203
|
+
appName = 'app',
|
|
5204
|
+
getRedirectLink,
|
|
5205
|
+
isDatastake,
|
|
5206
|
+
selectedProject
|
|
5204
5207
|
}) => {
|
|
5205
5208
|
const hoverDiv = o.useRef();
|
|
5206
5209
|
const hoverDivSecond = o.useRef();
|
|
@@ -5216,20 +5219,19 @@ const Sidenav = ({
|
|
|
5216
5219
|
pathname
|
|
5217
5220
|
} = location || {};
|
|
5218
5221
|
const mod = o.useMemo(() => module, [module, user]);
|
|
5219
|
-
const
|
|
5220
|
-
// Simple redirect link logic - can be customized
|
|
5222
|
+
const _getRedirectLink = getRedirectLink || (link => {
|
|
5221
5223
|
if (window.location.pathname.includes(`/${appName}`)) {
|
|
5222
5224
|
return `/${appName}${link}`;
|
|
5223
5225
|
}
|
|
5224
5226
|
return link;
|
|
5225
|
-
};
|
|
5227
|
+
});
|
|
5226
5228
|
const checkPath = i => {
|
|
5227
5229
|
if (!matchPath || !pathname) return false;
|
|
5228
5230
|
return matchPath({
|
|
5229
|
-
path:
|
|
5231
|
+
path: _getRedirectLink(i.path),
|
|
5230
5232
|
exact: true
|
|
5231
5233
|
}, pathname) || i.subPath && i.subPath.filter(s => matchPath({
|
|
5232
|
-
path:
|
|
5234
|
+
path: _getRedirectLink(s),
|
|
5233
5235
|
exact: true
|
|
5234
5236
|
}, pathname)).length ? true : false;
|
|
5235
5237
|
};
|
|
@@ -6094,7 +6096,8 @@ const UserDropdownMenu = ({
|
|
|
6094
6096
|
module,
|
|
6095
6097
|
checkPermission = () => false,
|
|
6096
6098
|
appName = 'app',
|
|
6097
|
-
userHelpers = {}
|
|
6099
|
+
userHelpers = {},
|
|
6100
|
+
isDev = false
|
|
6098
6101
|
}) => {
|
|
6099
6102
|
const {
|
|
6100
6103
|
windowWidth
|
|
@@ -6832,11 +6835,17 @@ function AppLayout({
|
|
|
6832
6835
|
exitImpersonation,
|
|
6833
6836
|
updateLanguage,
|
|
6834
6837
|
getUserOptions,
|
|
6838
|
+
selectedProject,
|
|
6835
6839
|
// Navigation (injected from app)
|
|
6836
6840
|
navigate,
|
|
6837
6841
|
location,
|
|
6838
6842
|
matchPath,
|
|
6839
6843
|
Outlet,
|
|
6844
|
+
getRedirectLink,
|
|
6845
|
+
isDatastake,
|
|
6846
|
+
// Others
|
|
6847
|
+
userHelpers = {},
|
|
6848
|
+
isDev = false,
|
|
6840
6849
|
// i18n (injected from app)
|
|
6841
6850
|
t = key => key,
|
|
6842
6851
|
// Permissions (injected from app)
|
|
@@ -6997,7 +7006,12 @@ function AppLayout({
|
|
|
6997
7006
|
t: t,
|
|
6998
7007
|
changeNotificationState: changeNotificationState,
|
|
6999
7008
|
checkPermission: checkPermission,
|
|
7000
|
-
appName: appName
|
|
7009
|
+
appName: appName,
|
|
7010
|
+
getRedirectLink: getRedirectLink,
|
|
7011
|
+
isDatastake: isDatastake,
|
|
7012
|
+
selectedProject: selectedProject,
|
|
7013
|
+
userHelpers: userHelpers,
|
|
7014
|
+
isDev: isDev
|
|
7001
7015
|
})]
|
|
7002
7016
|
}) : null, /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7003
7017
|
style: {
|
|
@@ -7040,13 +7054,30 @@ function AppLayout({
|
|
|
7040
7054
|
user: user,
|
|
7041
7055
|
notificationHandlers: notificationHandlers,
|
|
7042
7056
|
NotificationsHistoryProvider: NotificationsHistoryProvider,
|
|
7057
|
+
firebaseEnabled: true,
|
|
7058
|
+
useFirebaseHook: notificationHandlers.useFirebaseHook,
|
|
7043
7059
|
children: /*#__PURE__*/jsxRuntime.jsx(NotificationsHistoryProvider, {
|
|
7044
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
7060
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Dropdown, {
|
|
7061
|
+
menu: {
|
|
7062
|
+
items: [{
|
|
7063
|
+
key: 'notifications',
|
|
7064
|
+
label: /*#__PURE__*/jsxRuntime.jsx(Notifications, {
|
|
7065
|
+
userPreferences: userPreferences,
|
|
7066
|
+
module: module,
|
|
7067
|
+
t: t,
|
|
7068
|
+
navigate: navigate,
|
|
7069
|
+
appName: appName
|
|
7070
|
+
}),
|
|
7071
|
+
disabled: true
|
|
7072
|
+
}]
|
|
7073
|
+
},
|
|
7074
|
+
rootClassName: formatClassname(['dark-menu min-w-300', appName]),
|
|
7075
|
+
trigger: ['click'],
|
|
7076
|
+
placement: "bottom",
|
|
7077
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7078
|
+
className: "notification-icon",
|
|
7079
|
+
children: /*#__PURE__*/jsxRuntime.jsx(icons.BellOutlined, {})
|
|
7080
|
+
})
|
|
7050
7081
|
})
|
|
7051
7082
|
})
|
|
7052
7083
|
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -7099,7 +7130,9 @@ function AppLayout({
|
|
|
7099
7130
|
t: t,
|
|
7100
7131
|
logOut: logOut,
|
|
7101
7132
|
checkPermission: checkPermission,
|
|
7102
|
-
appName: appName
|
|
7133
|
+
appName: appName,
|
|
7134
|
+
userHelpers: userHelpers,
|
|
7135
|
+
isDev: isDev
|
|
7103
7136
|
})
|
|
7104
7137
|
})]
|
|
7105
7138
|
})]
|
|
@@ -7121,7 +7154,10 @@ function AppLayout({
|
|
|
7121
7154
|
logOut: logOut,
|
|
7122
7155
|
changeNotificationState: changeNotificationState,
|
|
7123
7156
|
matchPath: matchPath,
|
|
7124
|
-
appName: appName
|
|
7157
|
+
appName: appName,
|
|
7158
|
+
userHelpers: userHelpers,
|
|
7159
|
+
isDev: isDev,
|
|
7160
|
+
selectedProject: selectedProject
|
|
7125
7161
|
}) : null, logOutPopupVisible ? /*#__PURE__*/jsxRuntime.jsx(LoginPopup, {
|
|
7126
7162
|
user: user,
|
|
7127
7163
|
t: t,
|
package/package.json
CHANGED
|
@@ -94,6 +94,9 @@ const Sidenav = ({
|
|
|
94
94
|
userHelpers = {},
|
|
95
95
|
isDev = false,
|
|
96
96
|
appName = 'app',
|
|
97
|
+
getRedirectLink,
|
|
98
|
+
isDatastake,
|
|
99
|
+
selectedProject,
|
|
97
100
|
}) => {
|
|
98
101
|
const hoverDiv = useRef();
|
|
99
102
|
const hoverDivSecond = useRef();
|
|
@@ -109,22 +112,21 @@ const Sidenav = ({
|
|
|
109
112
|
|
|
110
113
|
const mod = useMemo(() => module, [module, user]);
|
|
111
114
|
|
|
112
|
-
const
|
|
113
|
-
// Simple redirect link logic - can be customized
|
|
115
|
+
const _getRedirectLink = getRedirectLink || ((link) => {
|
|
114
116
|
if (window.location.pathname.includes(`/${appName}`)) {
|
|
115
117
|
return `/${appName}${link}`;
|
|
116
118
|
}
|
|
117
119
|
return link;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
+
});
|
|
121
|
+
|
|
120
122
|
const checkPath = (i) => {
|
|
121
123
|
if (!matchPath || !pathname) return false;
|
|
122
124
|
|
|
123
125
|
return (matchPath({
|
|
124
|
-
path:
|
|
126
|
+
path: _getRedirectLink(i.path),
|
|
125
127
|
exact: true,
|
|
126
128
|
}, pathname) || (i.subPath && i.subPath.filter(s => matchPath({
|
|
127
|
-
path:
|
|
129
|
+
path: _getRedirectLink(s),
|
|
128
130
|
exact: true,
|
|
129
131
|
}, pathname)).length)) ? true : false;
|
|
130
132
|
};
|
|
@@ -3,11 +3,12 @@ import React, { useState, useEffect, useMemo } from "react";
|
|
|
3
3
|
import { useResizeContext } from "../../core/context/Resize/index.js";
|
|
4
4
|
import { useForms } from "../../core/context/Forms/index.js";
|
|
5
5
|
import { formatClassname } from '../../../helpers/ClassesHelper.js';
|
|
6
|
-
import { Layout, Select } from 'antd';
|
|
6
|
+
import { Layout, Select, Dropdown } from 'antd';
|
|
7
7
|
import {
|
|
8
8
|
MenuFoldOutlined,
|
|
9
9
|
MenuUnfoldOutlined,
|
|
10
10
|
MenuOutlined,
|
|
11
|
+
BellOutlined
|
|
11
12
|
} from '@ant-design/icons';
|
|
12
13
|
import Sidenav from "./components/Sidenav/index.js";
|
|
13
14
|
import { UserDropdownMenu } from "./components/UserDropdown/index.js";
|
|
@@ -60,12 +61,19 @@ function AppLayout({
|
|
|
60
61
|
exitImpersonation,
|
|
61
62
|
updateLanguage,
|
|
62
63
|
getUserOptions,
|
|
64
|
+
selectedProject,
|
|
63
65
|
|
|
64
66
|
// Navigation (injected from app)
|
|
65
67
|
navigate,
|
|
66
68
|
location,
|
|
67
69
|
matchPath,
|
|
68
70
|
Outlet,
|
|
71
|
+
getRedirectLink,
|
|
72
|
+
isDatastake,
|
|
73
|
+
|
|
74
|
+
// Others
|
|
75
|
+
userHelpers = {},
|
|
76
|
+
isDev = false,
|
|
69
77
|
|
|
70
78
|
// i18n (injected from app)
|
|
71
79
|
t = (key) => key,
|
|
@@ -238,6 +246,11 @@ function AppLayout({
|
|
|
238
246
|
changeNotificationState={changeNotificationState}
|
|
239
247
|
checkPermission={checkPermission}
|
|
240
248
|
appName={appName}
|
|
249
|
+
getRedirectLink={getRedirectLink}
|
|
250
|
+
isDatastake={isDatastake}
|
|
251
|
+
selectedProject={selectedProject}
|
|
252
|
+
userHelpers={userHelpers}
|
|
253
|
+
isDev={isDev}
|
|
241
254
|
/>
|
|
242
255
|
</div>
|
|
243
256
|
) : null}
|
|
@@ -276,23 +289,43 @@ function AppLayout({
|
|
|
276
289
|
</div>
|
|
277
290
|
|
|
278
291
|
<div className="d-flex right-sidebar">
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
292
|
+
{canViewNotifications ? (
|
|
293
|
+
<NotificationsProvider
|
|
294
|
+
user={user}
|
|
295
|
+
notificationHandlers={notificationHandlers}
|
|
296
|
+
NotificationsHistoryProvider={NotificationsHistoryProvider}
|
|
297
|
+
firebaseEnabled={true}
|
|
298
|
+
useFirebaseHook={notificationHandlers.useFirebaseHook}
|
|
299
|
+
>
|
|
300
|
+
<NotificationsHistoryProvider>
|
|
301
|
+
<Dropdown
|
|
302
|
+
menu={{
|
|
303
|
+
items: [{
|
|
304
|
+
key: 'notifications',
|
|
305
|
+
label: (
|
|
306
|
+
<Notifications
|
|
307
|
+
userPreferences={userPreferences}
|
|
308
|
+
module={module}
|
|
309
|
+
t={t}
|
|
310
|
+
navigate={navigate}
|
|
311
|
+
appName={appName}
|
|
312
|
+
/>
|
|
313
|
+
),
|
|
314
|
+
disabled: true,
|
|
315
|
+
}]
|
|
316
|
+
}}
|
|
317
|
+
rootClassName={formatClassname(['dark-menu min-w-300', appName])}
|
|
318
|
+
trigger={['click']}
|
|
319
|
+
placement="bottom"
|
|
320
|
+
>
|
|
321
|
+
<div className="notification-icon">
|
|
322
|
+
<BellOutlined />
|
|
323
|
+
{/* Add notification count badge if needed */}
|
|
324
|
+
</div>
|
|
325
|
+
</Dropdown>
|
|
326
|
+
</NotificationsHistoryProvider>
|
|
327
|
+
</NotificationsProvider>
|
|
328
|
+
) : <div className="notification-icon" />}
|
|
296
329
|
|
|
297
330
|
<div className="flex flex-column">
|
|
298
331
|
<Select
|
|
@@ -337,6 +370,8 @@ function AppLayout({
|
|
|
337
370
|
logOut={logOut}
|
|
338
371
|
checkPermission={checkPermission}
|
|
339
372
|
appName={appName}
|
|
373
|
+
userHelpers={userHelpers}
|
|
374
|
+
isDev={isDev}
|
|
340
375
|
/>
|
|
341
376
|
</div>
|
|
342
377
|
</div>
|
|
@@ -363,6 +398,9 @@ function AppLayout({
|
|
|
363
398
|
changeNotificationState={changeNotificationState}
|
|
364
399
|
matchPath={matchPath}
|
|
365
400
|
appName={appName}
|
|
401
|
+
userHelpers={userHelpers}
|
|
402
|
+
isDev={isDev}
|
|
403
|
+
selectedProject={selectedProject}
|
|
366
404
|
/>
|
|
367
405
|
) : null}
|
|
368
406
|
|