dce-reactkit 3.9.4-beta-logreviewer.8 → 3.9.4-beta-logreviewer.9
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/cjs/index.js +29 -28
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +29 -28
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/LogReviewer.tsx +20 -1
- package/src/components/Pagination.tsx +6 -2
- package/src/server/initServer.ts +12 -29
package/dist/cjs/index.js
CHANGED
|
@@ -3372,8 +3372,10 @@ const Pagination = ({ currentPage, numPages, loading = false, onPageChanged, })
|
|
|
3372
3372
|
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faArrowLeft }),
|
|
3373
3373
|
' ',
|
|
3374
3374
|
"Prev")),
|
|
3375
|
-
currentPage > 3
|
|
3376
|
-
|
|
3375
|
+
currentPage > 3
|
|
3376
|
+
&& pages[0] !== 1
|
|
3377
|
+
&& (React__default["default"].createElement("li", { className: "page-item" },
|
|
3378
|
+
React__default["default"].createElement("button", { type: "button", className: "page-link", onClick: () => { return onPageChanged(1); }, disabled: loading }, "1"))),
|
|
3377
3379
|
currentPage > 4 && (React__default["default"].createElement("li", { className: "page-item disabled" },
|
|
3378
3380
|
React__default["default"].createElement("span", { className: "page-link" }, "..."))),
|
|
3379
3381
|
pages.map((pageNum) => {
|
|
@@ -3382,8 +3384,10 @@ const Pagination = ({ currentPage, numPages, loading = false, onPageChanged, })
|
|
|
3382
3384
|
}),
|
|
3383
3385
|
currentPage < numPages - 3 && (React__default["default"].createElement("li", { className: "page-item disabled" },
|
|
3384
3386
|
React__default["default"].createElement("span", { className: "page-link" }, "..."))),
|
|
3385
|
-
currentPage < numPages - 2
|
|
3386
|
-
|
|
3387
|
+
currentPage < numPages - 2
|
|
3388
|
+
&& pages[pages.length - 1] !== numPages
|
|
3389
|
+
&& (React__default["default"].createElement("li", { className: "page-item" },
|
|
3390
|
+
React__default["default"].createElement("button", { type: "button", className: "page-link", onClick: () => { return onPageChanged(numPages); }, disabled: loading }, numPages))),
|
|
3387
3391
|
React__default["default"].createElement("li", { className: `page-item ${(currentPage >= numPages || loading) ? 'disabled' : ''}` },
|
|
3388
3392
|
React__default["default"].createElement("button", { type: "button", className: "page-link", onClick: () => { return onPageChanged(currentPage + 1); }, disabled: currentPage >= numPages || loading },
|
|
3389
3393
|
"Next",
|
|
@@ -3894,7 +3898,7 @@ const LogReviewer = (props) => {
|
|
|
3894
3898
|
else {
|
|
3895
3899
|
// Case: subcontexts exist
|
|
3896
3900
|
initContextFilterState[context] = {};
|
|
3897
|
-
Object.
|
|
3901
|
+
Object.keys(contextMap[context]).forEach((subcontext) => {
|
|
3898
3902
|
// Skip self ("_")
|
|
3899
3903
|
if (subcontext === '_') {
|
|
3900
3904
|
return;
|
|
@@ -4114,6 +4118,14 @@ const LogReviewer = (props) => {
|
|
|
4114
4118
|
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faList, className: "me-2" }),
|
|
4115
4119
|
"Advanced"),
|
|
4116
4120
|
React__default["default"].createElement("button", { type: "button", id: "LogReviewer-reset-filters-button", className: "btn btn-light", "aria-label": "reset filters", onClick: () => {
|
|
4121
|
+
// Save active filters
|
|
4122
|
+
activeFiltersRef.current = {
|
|
4123
|
+
dateFilterState: JSON.parse(JSON.stringify(initDateFilterState)),
|
|
4124
|
+
contextFilterState: JSON.parse(JSON.stringify(initContextFilterState)),
|
|
4125
|
+
tagFilterState: JSON.parse(JSON.stringify(initTagFilterState)),
|
|
4126
|
+
actionErrorFilterState: JSON.parse(JSON.stringify(initActionErrorFilterState)),
|
|
4127
|
+
advancedFilterState: JSON.parse(JSON.stringify(initAdvancedFilterState)),
|
|
4128
|
+
};
|
|
4117
4129
|
fetchLogs({
|
|
4118
4130
|
filters: {
|
|
4119
4131
|
dateFilterState: initDateFilterState,
|
|
@@ -14109,39 +14121,28 @@ const initServer = (opts) => {
|
|
|
14109
14121
|
};
|
|
14110
14122
|
/* ------------ Context Filter ------------ */
|
|
14111
14123
|
// Process context filters to include selected contexts and subcontexts
|
|
14112
|
-
const
|
|
14113
|
-
const selectedSubcontexts = [];
|
|
14114
|
-
// Process each context filter
|
|
14124
|
+
const contextConditions = [];
|
|
14115
14125
|
Object.keys(contextFilterState).forEach((context) => {
|
|
14116
14126
|
const value = contextFilterState[context];
|
|
14117
14127
|
if (typeof value === 'boolean') {
|
|
14118
14128
|
if (value) {
|
|
14119
|
-
|
|
14129
|
+
// The entire context is selected
|
|
14130
|
+
contextConditions.push({ context });
|
|
14120
14131
|
}
|
|
14121
14132
|
}
|
|
14122
14133
|
else {
|
|
14123
|
-
//
|
|
14124
|
-
const
|
|
14125
|
-
|
|
14126
|
-
|
|
14127
|
-
|
|
14128
|
-
|
|
14129
|
-
|
|
14134
|
+
// The context has subcontexts
|
|
14135
|
+
const subcontexts = Object.keys(value).filter((subcontext) => { return value[subcontext]; });
|
|
14136
|
+
if (subcontexts.length > 0) {
|
|
14137
|
+
contextConditions.push({
|
|
14138
|
+
context,
|
|
14139
|
+
subcontext: { $in: subcontexts },
|
|
14140
|
+
});
|
|
14130
14141
|
}
|
|
14131
|
-
// Add all selected subcontexts
|
|
14132
|
-
Object.keys(value).forEach((subcontext) => {
|
|
14133
|
-
if (value[subcontext]) {
|
|
14134
|
-
selectedSubcontexts.push(subcontext);
|
|
14135
|
-
}
|
|
14136
|
-
});
|
|
14137
14142
|
}
|
|
14138
14143
|
});
|
|
14139
|
-
|
|
14140
|
-
|
|
14141
|
-
query.context = { $in: selectedContexts };
|
|
14142
|
-
}
|
|
14143
|
-
if (selectedSubcontexts.length > 0) {
|
|
14144
|
-
query.subcontext = { $in: selectedSubcontexts };
|
|
14144
|
+
if (contextConditions.length > 0) {
|
|
14145
|
+
query.$or = contextConditions;
|
|
14145
14146
|
}
|
|
14146
14147
|
/* -------------- Tag Filter -------------- */
|
|
14147
14148
|
const selectedTags = Object.keys(tagFilterState).filter((tag) => { return tagFilterState[tag]; });
|