datastake-daf 0.6.367 → 0.6.368
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/.env +8 -0
- package/.vscode/settings.json +13 -0
- package/dist/components/index.js +58 -66
- package/dist/hooks/index.js +39 -34
- package/package.json +1 -1
- package/src/@daf/core/components/Charts/ColumnChart/ColumnChart.stories.jsx +0 -28
- package/src/@daf/core/components/Graphs/StakeholderMappings/index.jsx +0 -3
- package/src/@daf/core/components/Graphs/components/BaseGraph.jsx +37 -40
- package/src/@daf/core/components/Graphs/components/Nodes/NameNode.jsx +32 -42
- package/src/@daf/hooks/useFilters.js +317 -277
- package/src/@daf/hooks/useSources.js +6 -3
package/.env
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cSpell.words": ["cukura"],
|
|
3
|
+
"files.autoSave": "afterDelay",
|
|
4
|
+
"editor.wordWrap": "on",
|
|
5
|
+
"editor.autoClosingBrackets": "always",
|
|
6
|
+
"editor.autoClosingComments": "always",
|
|
7
|
+
"editor.autoClosingQuotes": "always",
|
|
8
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
9
|
+
"editor.formatOnPaste": true,
|
|
10
|
+
"editor.formatOnSave": true,
|
|
11
|
+
"notebook.defaultFormatter": "esbenp.prettier-vscode",
|
|
12
|
+
"javascript.format.semicolons": "insert"
|
|
13
|
+
}
|
package/dist/components/index.js
CHANGED
|
@@ -47000,6 +47000,7 @@ const filterParams = value => {
|
|
|
47000
47000
|
};
|
|
47001
47001
|
};
|
|
47002
47002
|
|
|
47003
|
+
const NEW_PAGINATION_TITLES = ["nashiriki"];
|
|
47003
47004
|
const useFilters = ({
|
|
47004
47005
|
view,
|
|
47005
47006
|
module,
|
|
@@ -47013,55 +47014,57 @@ const useFilters = ({
|
|
|
47013
47014
|
doPagination = true,
|
|
47014
47015
|
getRedirectLink
|
|
47015
47016
|
}) => {
|
|
47017
|
+
const PAGE = NEW_PAGINATION_TITLES.includes(module) ? "skip" : "page";
|
|
47018
|
+
const PAGE_SIZE = NEW_PAGINATION_TITLES.includes(module) ? "take" : "pageSize";
|
|
47016
47019
|
const params = React.useMemo(() => new URLSearchParams(location.search), [location.search]);
|
|
47017
47020
|
const [activeFilters, setActiveFilters] = React.useState(defaultActiveFilters || getDefaultActiveFilters(params, selectFiltersConfig, defaultPageSize, defaultUrlParams, doPagination));
|
|
47018
47021
|
const [pagination, setPagination] = React.useState(defaultActiveFilters ? {
|
|
47019
|
-
current: defaultActiveFilters
|
|
47020
|
-
|
|
47022
|
+
current: defaultActiveFilters[PAGE] || 1,
|
|
47023
|
+
[PAGE_SIZE]: defaultActiveFilters[PAGE_SIZE] || defaultPageSize,
|
|
47021
47024
|
showSizeChanger: true
|
|
47022
47025
|
} : {
|
|
47023
|
-
current: !isNaN(Number(params.get(
|
|
47024
|
-
|
|
47026
|
+
current: !isNaN(Number(params.get(PAGE))) ? Number(params.get(PAGE)) || 1 : 1,
|
|
47027
|
+
[PAGE_SIZE]: !isNaN(Number(params.get(PAGE_SIZE))) ? Number(params.get(PAGE_SIZE)) || defaultPageSize : defaultPageSize,
|
|
47025
47028
|
showSizeChanger: true
|
|
47026
47029
|
});
|
|
47027
47030
|
React.useEffect(() => {
|
|
47028
47031
|
if (defaultActiveFilters) {
|
|
47029
47032
|
setPagination(prev => ({
|
|
47030
47033
|
...prev,
|
|
47031
|
-
current: defaultActiveFilters
|
|
47032
|
-
|
|
47034
|
+
current: defaultActiveFilters[PAGE] || 1,
|
|
47035
|
+
[PAGE_SIZE]: defaultActiveFilters[PAGE_SIZE] || defaultPageSize,
|
|
47033
47036
|
showSizeChanger: true
|
|
47034
47037
|
}));
|
|
47035
47038
|
return;
|
|
47036
47039
|
}
|
|
47037
47040
|
setPagination(prev => ({
|
|
47038
47041
|
...prev,
|
|
47039
|
-
current: !isNaN(Number(params.get(
|
|
47040
|
-
|
|
47042
|
+
current: !isNaN(Number(params.get(PAGE))) ? Number(params.get(PAGE)) || 1 : 1,
|
|
47043
|
+
[PAGE_SIZE]: !isNaN(Number(params.get(PAGE_SIZE))) ? Number(params.get(PAGE_SIZE)) || defaultPageSize : defaultPageSize,
|
|
47041
47044
|
showSizeChanger: true
|
|
47042
47045
|
}));
|
|
47043
47046
|
}, []);
|
|
47044
47047
|
const updateQuery = React.useCallback((filters, page) => {
|
|
47045
47048
|
const qs = Object.keys(filters).filter(key => {
|
|
47046
47049
|
if (!doPagination) {
|
|
47047
|
-
return !!filters[key] && key !==
|
|
47050
|
+
return !!filters[key] && key !== PAGE && key !== PAGE_SIZE;
|
|
47048
47051
|
}
|
|
47049
47052
|
return !!filters[key];
|
|
47050
47053
|
}).map(key => {
|
|
47051
|
-
if (filters[key] && typeof filters[key] ===
|
|
47054
|
+
if (filters[key] && typeof filters[key] === "object") {
|
|
47052
47055
|
return `${key}=${JSON.stringify(filters[key])}`;
|
|
47053
47056
|
}
|
|
47054
47057
|
return `${key}=${filters[key]}`;
|
|
47055
|
-
}).join(
|
|
47058
|
+
}).join("&");
|
|
47056
47059
|
if (view) {
|
|
47057
|
-
if (typeof getRedirectLink ===
|
|
47058
|
-
goTo(getRedirectLink(view ===
|
|
47060
|
+
if (typeof getRedirectLink === "function") {
|
|
47061
|
+
goTo(getRedirectLink(view === "mine-monitoring" ? qs !== "" ? `${location.pathname}?${qs}` : doPagination ? `${location.pathname}?${PAGE}=${page}` : location.pathname : qs !== "" ? `${`/app/${view}`}?${qs}` : doPagination ? `${`/app/${view}`}?${PAGE}=${page}` : `${`/app/${view}`}`));
|
|
47059
47062
|
return;
|
|
47060
47063
|
}
|
|
47061
|
-
if (view ===
|
|
47062
|
-
goTo(qs !==
|
|
47064
|
+
if (view === "mine-monitoring") {
|
|
47065
|
+
goTo(qs !== "" ? `${location.pathname}?${qs}` : doPagination ? `${location.pathname}?${PAGE}=${page}` : location.pathname);
|
|
47063
47066
|
} else {
|
|
47064
|
-
goTo(qs !==
|
|
47067
|
+
goTo(qs !== "" ? `${`/app/${module}/${view}`}?${qs}` : doPagination ? `${`/app/${module}/${view}`}?${PAGE}=${page}` : `${`/app/${module}/${view}`}`);
|
|
47065
47068
|
}
|
|
47066
47069
|
}
|
|
47067
47070
|
}, [module, view, location.pathname]); // Updated dependency array
|
|
@@ -47094,9 +47097,9 @@ const useFilters = ({
|
|
|
47094
47097
|
const filters = StorageManager.saveFilters(module, view, {
|
|
47095
47098
|
...filteredFilters
|
|
47096
47099
|
});
|
|
47097
|
-
if (!filters
|
|
47098
|
-
filters
|
|
47099
|
-
filters
|
|
47100
|
+
if (!filters[PAGE_SIZE]) {
|
|
47101
|
+
filters[PAGE] = 1;
|
|
47102
|
+
filters[PAGE_SIZE] = pagination[PAGE_SIZE];
|
|
47100
47103
|
}
|
|
47101
47104
|
updateQuery(filters, 1);
|
|
47102
47105
|
}, [activeFilters]);
|
|
@@ -47107,7 +47110,7 @@ const useFilters = ({
|
|
|
47107
47110
|
const {
|
|
47108
47111
|
show
|
|
47109
47112
|
} = conf;
|
|
47110
|
-
if (typeof show ===
|
|
47113
|
+
if (typeof show === "function") {
|
|
47111
47114
|
if (show(filters)) {
|
|
47112
47115
|
return all;
|
|
47113
47116
|
}
|
|
@@ -47125,7 +47128,7 @@ const useFilters = ({
|
|
|
47125
47128
|
...prev
|
|
47126
47129
|
};
|
|
47127
47130
|
Object.keys(o).forEach(k => {
|
|
47128
|
-
if (Object.keys(selectFiltersConfig).includes(k) || k ===
|
|
47131
|
+
if (Object.keys(selectFiltersConfig).includes(k) || k === "authorId") {
|
|
47129
47132
|
delete o[k];
|
|
47130
47133
|
}
|
|
47131
47134
|
});
|
|
@@ -47133,7 +47136,7 @@ const useFilters = ({
|
|
|
47133
47136
|
o[k] = v;
|
|
47134
47137
|
});
|
|
47135
47138
|
if (doPagination) {
|
|
47136
|
-
o
|
|
47139
|
+
o[PAGE] = 1;
|
|
47137
47140
|
}
|
|
47138
47141
|
return o;
|
|
47139
47142
|
});
|
|
@@ -47153,11 +47156,11 @@ const useFilters = ({
|
|
|
47153
47156
|
} = sorter || {};
|
|
47154
47157
|
let fs = {
|
|
47155
47158
|
...activeFilters,
|
|
47156
|
-
|
|
47157
|
-
|
|
47159
|
+
[PAGE]: page[PAGE_SIZE] !== activeFilters[PAGE_SIZE] ? 1 : page.current,
|
|
47160
|
+
[PAGE_SIZE]: page[PAGE_SIZE] || defaultPageSize
|
|
47158
47161
|
};
|
|
47159
47162
|
if (sorter && (columnKey !== sortBy || order !== sortDir)) {
|
|
47160
|
-
fs
|
|
47163
|
+
fs[PAGE] = 1;
|
|
47161
47164
|
}
|
|
47162
47165
|
if (order) {
|
|
47163
47166
|
fs = {
|
|
@@ -47167,8 +47170,8 @@ const useFilters = ({
|
|
|
47167
47170
|
};
|
|
47168
47171
|
} else if (sortBy || sortDir) {
|
|
47169
47172
|
fs = Object.keys(fs).reduce((all, key) => {
|
|
47170
|
-
if (key !==
|
|
47171
|
-
if (key ===
|
|
47173
|
+
if (key !== "sortDir" && key !== "sortBy") {
|
|
47174
|
+
if (key === PAGE || key === PAGE_SIZE) {
|
|
47172
47175
|
all[key] = fs[key];
|
|
47173
47176
|
} else {
|
|
47174
47177
|
all[key] = activeFilters[key];
|
|
@@ -47182,19 +47185,19 @@ const useFilters = ({
|
|
|
47182
47185
|
page.current = 1;
|
|
47183
47186
|
}
|
|
47184
47187
|
const filters = StorageManager.saveFilters(module, view, {
|
|
47185
|
-
|
|
47188
|
+
[PAGE]: page.current
|
|
47186
47189
|
}, true);
|
|
47187
47190
|
updateQuery(filters, page.current);
|
|
47188
47191
|
setPagination(prev => ({
|
|
47189
47192
|
...prev,
|
|
47190
|
-
current: fs
|
|
47191
|
-
|
|
47193
|
+
current: fs[PAGE],
|
|
47194
|
+
[PAGE_SIZE]: fs[PAGE_SIZE] || defaultPageSize
|
|
47192
47195
|
}));
|
|
47193
47196
|
};
|
|
47194
47197
|
const onSearch = React.useCallback((activeFilter, value) => {
|
|
47195
47198
|
setActiveFilters(prev => ({
|
|
47196
47199
|
...prev,
|
|
47197
|
-
|
|
47200
|
+
[PAGE]: 1,
|
|
47198
47201
|
searchParams: activeFilter,
|
|
47199
47202
|
search: value
|
|
47200
47203
|
}));
|
|
@@ -47204,7 +47207,7 @@ const useFilters = ({
|
|
|
47204
47207
|
}));
|
|
47205
47208
|
}, []);
|
|
47206
47209
|
const totalPages = React.useMemo(() => {
|
|
47207
|
-
return Math.ceil(pagination.total / pagination
|
|
47210
|
+
return Math.ceil(pagination.total / pagination[PAGE_SIZE]);
|
|
47208
47211
|
}, [pagination]);
|
|
47209
47212
|
const canGoPrev = React.useMemo(() => pagination.current !== 1, [pagination]);
|
|
47210
47213
|
const canGoNext = React.useMemo(() => pagination.current !== totalPages && totalPages, [pagination, totalPages]);
|
|
@@ -51378,7 +51381,6 @@ function NameNode({
|
|
|
51378
51381
|
token
|
|
51379
51382
|
} = useToken$7();
|
|
51380
51383
|
const translateFN = typeof data?.t === "function" ? data.t : key => key;
|
|
51381
|
-
const isPdf = data?.isPdf;
|
|
51382
51384
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
51383
51385
|
children: [/*#__PURE__*/jsxRuntime.jsx(react.Handle, {
|
|
51384
51386
|
type: "source",
|
|
@@ -51397,7 +51399,6 @@ function NameNode({
|
|
|
51397
51399
|
opacity: 0
|
|
51398
51400
|
}
|
|
51399
51401
|
}), /*#__PURE__*/jsxRuntime.jsxs(Style$d, {
|
|
51400
|
-
$isPdf: isPdf,
|
|
51401
51402
|
style: {
|
|
51402
51403
|
opacity: data.isEmpty ? 0.5 : 1
|
|
51403
51404
|
},
|
|
@@ -51448,7 +51449,7 @@ function NameNode({
|
|
|
51448
51449
|
}
|
|
51449
51450
|
})
|
|
51450
51451
|
}) : null]
|
|
51451
|
-
}),
|
|
51452
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
51452
51453
|
style: {
|
|
51453
51454
|
marginLeft: "auto"
|
|
51454
51455
|
},
|
|
@@ -51485,32 +51486,27 @@ function NameNode({
|
|
|
51485
51486
|
});
|
|
51486
51487
|
}
|
|
51487
51488
|
const Style$d = dt.div`
|
|
51488
|
-
|
|
51489
|
-
|
|
51490
|
-
|
|
51491
|
-
|
|
51492
|
-
|
|
51493
|
-
|
|
51494
|
-
|
|
51495
|
-
|
|
51496
|
-
box-shadow: 0px 5.64px 17.56px 5.02px #0000000d;
|
|
51497
|
-
/* Ensure borders/colors survive PDF rendering */
|
|
51498
|
-
border: ${props => props.$isPdf ? '1px solid var(--base-gray-30)' : 'none'};
|
|
51499
|
-
-webkit-print-color-adjust: exact;
|
|
51500
|
-
print-color-adjust: exact;
|
|
51489
|
+
width: ${NAME_CARD_WIDTH}px;
|
|
51490
|
+
display: flex;
|
|
51491
|
+
background: white;
|
|
51492
|
+
border-radius: 8px;
|
|
51493
|
+
box-shadow: 0px 3.76px 10.03px 0px #00000014;
|
|
51494
|
+
box-shadow: 0px 1.88px 3.76px -2.51px #0000001f;
|
|
51495
|
+
overflow: hidden;
|
|
51496
|
+
box-shadow: 0px 5.64px 17.56px 5.02px #0000000d;
|
|
51501
51497
|
|
|
51502
|
-
|
|
51503
|
-
|
|
51504
|
-
|
|
51505
|
-
|
|
51506
|
-
|
|
51507
|
-
|
|
51498
|
+
.left {
|
|
51499
|
+
width: 32px;
|
|
51500
|
+
background: red;
|
|
51501
|
+
border-top-left-radius: 12px;
|
|
51502
|
+
border-bottom-left-radius: 12px;
|
|
51503
|
+
}
|
|
51508
51504
|
|
|
51509
|
-
|
|
51510
|
-
|
|
51511
|
-
|
|
51512
|
-
|
|
51513
|
-
|
|
51505
|
+
.right {
|
|
51506
|
+
padding: 16px 12px;
|
|
51507
|
+
width: 100%
|
|
51508
|
+
border-bottom: 1px solid var(--base-gray-30);
|
|
51509
|
+
}
|
|
51514
51510
|
`;
|
|
51515
51511
|
|
|
51516
51512
|
const Style$c = dt.div`
|
|
@@ -52085,7 +52081,6 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
|
|
|
52085
52081
|
t,
|
|
52086
52082
|
withDuration = true,
|
|
52087
52083
|
onFilterChange,
|
|
52088
|
-
isPdf,
|
|
52089
52084
|
...props
|
|
52090
52085
|
}, ref) {
|
|
52091
52086
|
const {
|
|
@@ -52142,7 +52137,7 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
|
|
|
52142
52137
|
duration: withDuration ? 300 : undefined
|
|
52143
52138
|
},
|
|
52144
52139
|
...props,
|
|
52145
|
-
children:
|
|
52140
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(react.Controls, {
|
|
52146
52141
|
position: "bottom-right",
|
|
52147
52142
|
showFitView: false,
|
|
52148
52143
|
showInteractive: false,
|
|
@@ -52659,8 +52654,7 @@ function positionDataNodes(_ref2) {
|
|
|
52659
52654
|
total,
|
|
52660
52655
|
mainNode,
|
|
52661
52656
|
type,
|
|
52662
|
-
hasContent
|
|
52663
|
-
isPdf
|
|
52657
|
+
hasContent
|
|
52664
52658
|
} = _ref2;
|
|
52665
52659
|
const DATA_NODE_WIDTH = DATA_NODE_SIZE[type].width;
|
|
52666
52660
|
const DATA_NODE_HEIGHT = DATA_NODE_SIZE[type].height;
|
|
@@ -52877,7 +52871,6 @@ function StakeholderMappings(_ref3) {
|
|
|
52877
52871
|
isLeftSide: node.data.order % 2 !== 0,
|
|
52878
52872
|
isAboveMainNode: node.data.order <= 2,
|
|
52879
52873
|
iconNode: node,
|
|
52880
|
-
isPdf: true,
|
|
52881
52874
|
index: 0,
|
|
52882
52875
|
total: 1,
|
|
52883
52876
|
mainNode,
|
|
@@ -52976,8 +52969,7 @@ function StakeholderMappings(_ref3) {
|
|
|
52976
52969
|
duration: 300
|
|
52977
52970
|
});
|
|
52978
52971
|
},
|
|
52979
|
-
ref: reactFlowWrapper
|
|
52980
|
-
isPdf: isPdf
|
|
52972
|
+
ref: reactFlowWrapper
|
|
52981
52973
|
});
|
|
52982
52974
|
}
|
|
52983
52975
|
var index$1 = withProvider(StakeholderMappings);
|
package/dist/hooks/index.js
CHANGED
|
@@ -200,6 +200,7 @@ class StorageManager {
|
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
+
const NEW_PAGINATION_TITLES = ["nashiriki"];
|
|
203
204
|
const useFilters = ({
|
|
204
205
|
view,
|
|
205
206
|
module,
|
|
@@ -213,55 +214,57 @@ const useFilters = ({
|
|
|
213
214
|
doPagination = true,
|
|
214
215
|
getRedirectLink
|
|
215
216
|
}) => {
|
|
217
|
+
const PAGE = NEW_PAGINATION_TITLES.includes(module) ? "skip" : "page";
|
|
218
|
+
const PAGE_SIZE = NEW_PAGINATION_TITLES.includes(module) ? "take" : "pageSize";
|
|
216
219
|
const params = React.useMemo(() => new URLSearchParams(location.search), [location.search]);
|
|
217
220
|
const [activeFilters, setActiveFilters] = React.useState(defaultActiveFilters || getDefaultActiveFilters(params, selectFiltersConfig, defaultPageSize, defaultUrlParams, doPagination));
|
|
218
221
|
const [pagination, setPagination] = React.useState(defaultActiveFilters ? {
|
|
219
|
-
current: defaultActiveFilters
|
|
220
|
-
|
|
222
|
+
current: defaultActiveFilters[PAGE] || 1,
|
|
223
|
+
[PAGE_SIZE]: defaultActiveFilters[PAGE_SIZE] || defaultPageSize,
|
|
221
224
|
showSizeChanger: true
|
|
222
225
|
} : {
|
|
223
|
-
current: !isNaN(Number(params.get(
|
|
224
|
-
|
|
226
|
+
current: !isNaN(Number(params.get(PAGE))) ? Number(params.get(PAGE)) || 1 : 1,
|
|
227
|
+
[PAGE_SIZE]: !isNaN(Number(params.get(PAGE_SIZE))) ? Number(params.get(PAGE_SIZE)) || defaultPageSize : defaultPageSize,
|
|
225
228
|
showSizeChanger: true
|
|
226
229
|
});
|
|
227
230
|
React.useEffect(() => {
|
|
228
231
|
if (defaultActiveFilters) {
|
|
229
232
|
setPagination(prev => ({
|
|
230
233
|
...prev,
|
|
231
|
-
current: defaultActiveFilters
|
|
232
|
-
|
|
234
|
+
current: defaultActiveFilters[PAGE] || 1,
|
|
235
|
+
[PAGE_SIZE]: defaultActiveFilters[PAGE_SIZE] || defaultPageSize,
|
|
233
236
|
showSizeChanger: true
|
|
234
237
|
}));
|
|
235
238
|
return;
|
|
236
239
|
}
|
|
237
240
|
setPagination(prev => ({
|
|
238
241
|
...prev,
|
|
239
|
-
current: !isNaN(Number(params.get(
|
|
240
|
-
|
|
242
|
+
current: !isNaN(Number(params.get(PAGE))) ? Number(params.get(PAGE)) || 1 : 1,
|
|
243
|
+
[PAGE_SIZE]: !isNaN(Number(params.get(PAGE_SIZE))) ? Number(params.get(PAGE_SIZE)) || defaultPageSize : defaultPageSize,
|
|
241
244
|
showSizeChanger: true
|
|
242
245
|
}));
|
|
243
246
|
}, []);
|
|
244
247
|
const updateQuery = React.useCallback((filters, page) => {
|
|
245
248
|
const qs = Object.keys(filters).filter(key => {
|
|
246
249
|
if (!doPagination) {
|
|
247
|
-
return !!filters[key] && key !==
|
|
250
|
+
return !!filters[key] && key !== PAGE && key !== PAGE_SIZE;
|
|
248
251
|
}
|
|
249
252
|
return !!filters[key];
|
|
250
253
|
}).map(key => {
|
|
251
|
-
if (filters[key] && typeof filters[key] ===
|
|
254
|
+
if (filters[key] && typeof filters[key] === "object") {
|
|
252
255
|
return `${key}=${JSON.stringify(filters[key])}`;
|
|
253
256
|
}
|
|
254
257
|
return `${key}=${filters[key]}`;
|
|
255
|
-
}).join(
|
|
258
|
+
}).join("&");
|
|
256
259
|
if (view) {
|
|
257
|
-
if (typeof getRedirectLink ===
|
|
258
|
-
goTo(getRedirectLink(view ===
|
|
260
|
+
if (typeof getRedirectLink === "function") {
|
|
261
|
+
goTo(getRedirectLink(view === "mine-monitoring" ? qs !== "" ? `${location.pathname}?${qs}` : doPagination ? `${location.pathname}?${PAGE}=${page}` : location.pathname : qs !== "" ? `${`/app/${view}`}?${qs}` : doPagination ? `${`/app/${view}`}?${PAGE}=${page}` : `${`/app/${view}`}`));
|
|
259
262
|
return;
|
|
260
263
|
}
|
|
261
|
-
if (view ===
|
|
262
|
-
goTo(qs !==
|
|
264
|
+
if (view === "mine-monitoring") {
|
|
265
|
+
goTo(qs !== "" ? `${location.pathname}?${qs}` : doPagination ? `${location.pathname}?${PAGE}=${page}` : location.pathname);
|
|
263
266
|
} else {
|
|
264
|
-
goTo(qs !==
|
|
267
|
+
goTo(qs !== "" ? `${`/app/${module}/${view}`}?${qs}` : doPagination ? `${`/app/${module}/${view}`}?${PAGE}=${page}` : `${`/app/${module}/${view}`}`);
|
|
265
268
|
}
|
|
266
269
|
}
|
|
267
270
|
}, [module, view, location.pathname]); // Updated dependency array
|
|
@@ -294,9 +297,9 @@ const useFilters = ({
|
|
|
294
297
|
const filters = StorageManager.saveFilters(module, view, {
|
|
295
298
|
...filteredFilters
|
|
296
299
|
});
|
|
297
|
-
if (!filters
|
|
298
|
-
filters
|
|
299
|
-
filters
|
|
300
|
+
if (!filters[PAGE_SIZE]) {
|
|
301
|
+
filters[PAGE] = 1;
|
|
302
|
+
filters[PAGE_SIZE] = pagination[PAGE_SIZE];
|
|
300
303
|
}
|
|
301
304
|
updateQuery(filters, 1);
|
|
302
305
|
}, [activeFilters]);
|
|
@@ -307,7 +310,7 @@ const useFilters = ({
|
|
|
307
310
|
const {
|
|
308
311
|
show
|
|
309
312
|
} = conf;
|
|
310
|
-
if (typeof show ===
|
|
313
|
+
if (typeof show === "function") {
|
|
311
314
|
if (show(filters)) {
|
|
312
315
|
return all;
|
|
313
316
|
}
|
|
@@ -325,7 +328,7 @@ const useFilters = ({
|
|
|
325
328
|
...prev
|
|
326
329
|
};
|
|
327
330
|
Object.keys(o).forEach(k => {
|
|
328
|
-
if (Object.keys(selectFiltersConfig).includes(k) || k ===
|
|
331
|
+
if (Object.keys(selectFiltersConfig).includes(k) || k === "authorId") {
|
|
329
332
|
delete o[k];
|
|
330
333
|
}
|
|
331
334
|
});
|
|
@@ -333,7 +336,7 @@ const useFilters = ({
|
|
|
333
336
|
o[k] = v;
|
|
334
337
|
});
|
|
335
338
|
if (doPagination) {
|
|
336
|
-
o
|
|
339
|
+
o[PAGE] = 1;
|
|
337
340
|
}
|
|
338
341
|
return o;
|
|
339
342
|
});
|
|
@@ -353,11 +356,11 @@ const useFilters = ({
|
|
|
353
356
|
} = sorter || {};
|
|
354
357
|
let fs = {
|
|
355
358
|
...activeFilters,
|
|
356
|
-
|
|
357
|
-
|
|
359
|
+
[PAGE]: page[PAGE_SIZE] !== activeFilters[PAGE_SIZE] ? 1 : page.current,
|
|
360
|
+
[PAGE_SIZE]: page[PAGE_SIZE] || defaultPageSize
|
|
358
361
|
};
|
|
359
362
|
if (sorter && (columnKey !== sortBy || order !== sortDir)) {
|
|
360
|
-
fs
|
|
363
|
+
fs[PAGE] = 1;
|
|
361
364
|
}
|
|
362
365
|
if (order) {
|
|
363
366
|
fs = {
|
|
@@ -367,8 +370,8 @@ const useFilters = ({
|
|
|
367
370
|
};
|
|
368
371
|
} else if (sortBy || sortDir) {
|
|
369
372
|
fs = Object.keys(fs).reduce((all, key) => {
|
|
370
|
-
if (key !==
|
|
371
|
-
if (key ===
|
|
373
|
+
if (key !== "sortDir" && key !== "sortBy") {
|
|
374
|
+
if (key === PAGE || key === PAGE_SIZE) {
|
|
372
375
|
all[key] = fs[key];
|
|
373
376
|
} else {
|
|
374
377
|
all[key] = activeFilters[key];
|
|
@@ -382,19 +385,19 @@ const useFilters = ({
|
|
|
382
385
|
page.current = 1;
|
|
383
386
|
}
|
|
384
387
|
const filters = StorageManager.saveFilters(module, view, {
|
|
385
|
-
|
|
388
|
+
[PAGE]: page.current
|
|
386
389
|
}, true);
|
|
387
390
|
updateQuery(filters, page.current);
|
|
388
391
|
setPagination(prev => ({
|
|
389
392
|
...prev,
|
|
390
|
-
current: fs
|
|
391
|
-
|
|
393
|
+
current: fs[PAGE],
|
|
394
|
+
[PAGE_SIZE]: fs[PAGE_SIZE] || defaultPageSize
|
|
392
395
|
}));
|
|
393
396
|
};
|
|
394
397
|
const onSearch = React.useCallback((activeFilter, value) => {
|
|
395
398
|
setActiveFilters(prev => ({
|
|
396
399
|
...prev,
|
|
397
|
-
|
|
400
|
+
[PAGE]: 1,
|
|
398
401
|
searchParams: activeFilter,
|
|
399
402
|
search: value
|
|
400
403
|
}));
|
|
@@ -404,7 +407,7 @@ const useFilters = ({
|
|
|
404
407
|
}));
|
|
405
408
|
}, []);
|
|
406
409
|
const totalPages = React.useMemo(() => {
|
|
407
|
-
return Math.ceil(pagination.total / pagination
|
|
410
|
+
return Math.ceil(pagination.total / pagination[PAGE_SIZE]);
|
|
408
411
|
}, [pagination]);
|
|
409
412
|
const canGoPrev = React.useMemo(() => pagination.current !== 1, [pagination]);
|
|
410
413
|
const canGoNext = React.useMemo(() => pagination.current !== totalPages && totalPages, [pagination, totalPages]);
|
|
@@ -1159,6 +1162,8 @@ const useIsMobile = () => {
|
|
|
1159
1162
|
return isMobile;
|
|
1160
1163
|
};
|
|
1161
1164
|
|
|
1165
|
+
const PAGE = "page";
|
|
1166
|
+
const PAGE_SIZE = "pageSize";
|
|
1162
1167
|
function useSource({
|
|
1163
1168
|
user = {},
|
|
1164
1169
|
t = () => {},
|
|
@@ -1177,8 +1182,8 @@ function useSource({
|
|
|
1177
1182
|
const {
|
|
1178
1183
|
data
|
|
1179
1184
|
} = await getData({
|
|
1180
|
-
|
|
1181
|
-
|
|
1185
|
+
[PAGE]: 1,
|
|
1186
|
+
[PAGE_SIZE]: 100,
|
|
1182
1187
|
type: "partners"
|
|
1183
1188
|
});
|
|
1184
1189
|
if (id === undefined) {
|
package/package.json
CHANGED
|
@@ -457,34 +457,6 @@ export const Pdf = {
|
|
|
457
457
|
showBackground: true,
|
|
458
458
|
isPercentage: true,
|
|
459
459
|
shouldSeperateLegendName: true,
|
|
460
|
-
formattedXAxis: (s) => {
|
|
461
|
-
if (!s) return "";
|
|
462
|
-
|
|
463
|
-
const limit = 20;
|
|
464
|
-
let result = "";
|
|
465
|
-
let line = "";
|
|
466
|
-
|
|
467
|
-
for (let word of s.split(" ")) {
|
|
468
|
-
if ((line + word).length <= limit) {
|
|
469
|
-
line += (line ? " " : "") + word;
|
|
470
|
-
} else if (word.length > limit) {
|
|
471
|
-
// break long word with hyphen
|
|
472
|
-
while (word.length > limit) {
|
|
473
|
-
result += word.slice(0, limit - 1) + "-\n";
|
|
474
|
-
word = word.slice(limit - 1);
|
|
475
|
-
}
|
|
476
|
-
line = word;
|
|
477
|
-
} else {
|
|
478
|
-
// move current line into result
|
|
479
|
-
if (line) result += line + "\n";
|
|
480
|
-
line = word;
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
if (line) result += line;
|
|
485
|
-
|
|
486
|
-
return result;
|
|
487
|
-
},
|
|
488
460
|
},
|
|
489
461
|
render: (args) => {
|
|
490
462
|
return <Widget title="Pdf Column Chart" className={"with-border-header"}>
|
|
@@ -72,7 +72,6 @@ function positionDataNodes({
|
|
|
72
72
|
mainNode,
|
|
73
73
|
type,
|
|
74
74
|
hasContent,
|
|
75
|
-
isPdf,
|
|
76
75
|
}) {
|
|
77
76
|
const DATA_NODE_WIDTH = DATA_NODE_SIZE[type].width;
|
|
78
77
|
const DATA_NODE_HEIGHT = DATA_NODE_SIZE[type].height;
|
|
@@ -326,7 +325,6 @@ function StakeholderMappings({
|
|
|
326
325
|
isLeftSide: node.data.order % 2 !== 0,
|
|
327
326
|
isAboveMainNode: node.data.order <= 2,
|
|
328
327
|
iconNode: node,
|
|
329
|
-
isPdf: true,
|
|
330
328
|
index: 0,
|
|
331
329
|
total: 1,
|
|
332
330
|
mainNode,
|
|
@@ -446,7 +444,6 @@ function StakeholderMappings({
|
|
|
446
444
|
});
|
|
447
445
|
}}
|
|
448
446
|
ref={reactFlowWrapper}
|
|
449
|
-
isPdf={isPdf}
|
|
450
447
|
/>
|
|
451
448
|
);
|
|
452
449
|
}
|