dce-reactkit 5.0.1 → 5.0.2
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 +305 -160
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/FakeProgressBar.d.ts +27 -0
- package/dist/cjs/types/index.d.ts +2 -1
- package/dist/esm/index.js +305 -161
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/FakeProgressBar.d.ts +27 -0
- package/dist/esm/types/index.d.ts +2 -1
- package/dist/index.d.ts +74 -49
- package/package.json +1 -1
- package/src/components/FakeProgressBar.tsx +274 -0
- package/src/index.ts +2 -0
package/dist/cjs/index.js
CHANGED
|
@@ -1789,11 +1789,11 @@ var View;
|
|
|
1789
1789
|
})(View || (View = {}));
|
|
1790
1790
|
/* ------------- Actions ------------ */
|
|
1791
1791
|
// Types of actions
|
|
1792
|
-
var ActionType$
|
|
1792
|
+
var ActionType$b;
|
|
1793
1793
|
(function (ActionType) {
|
|
1794
1794
|
// Fix invalid date so it is now in range
|
|
1795
1795
|
ActionType["FixInvalidDate"] = "FixInvalidDate";
|
|
1796
|
-
})(ActionType$
|
|
1796
|
+
})(ActionType$b || (ActionType$b = {}));
|
|
1797
1797
|
/**
|
|
1798
1798
|
* Reducer that executes actions
|
|
1799
1799
|
* @author Gardenia Liu
|
|
@@ -1801,9 +1801,9 @@ var ActionType$a;
|
|
|
1801
1801
|
* @param action action to execute
|
|
1802
1802
|
* @returns updated state
|
|
1803
1803
|
*/
|
|
1804
|
-
const reducer$
|
|
1804
|
+
const reducer$c = (state, action) => {
|
|
1805
1805
|
switch (action.type) {
|
|
1806
|
-
case ActionType$
|
|
1806
|
+
case ActionType$b.FixInvalidDate: {
|
|
1807
1807
|
return Object.assign(Object.assign({}, state), { view: View.DateChooser });
|
|
1808
1808
|
}
|
|
1809
1809
|
default: {
|
|
@@ -1952,7 +1952,7 @@ const SimpleDateChooser = (props) => {
|
|
|
1952
1952
|
: View.DateChooser),
|
|
1953
1953
|
};
|
|
1954
1954
|
// Initialize state
|
|
1955
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
1955
|
+
const [state, dispatch] = React.useReducer(reducer$c, initialState);
|
|
1956
1956
|
// Destructure common state
|
|
1957
1957
|
const { view, } = state;
|
|
1958
1958
|
/*------------------------------------------------------------------------*/
|
|
@@ -1975,7 +1975,7 @@ const SimpleDateChooser = (props) => {
|
|
|
1975
1975
|
onChange(today.month, today.day, today.year);
|
|
1976
1976
|
// Update state
|
|
1977
1977
|
dispatch({
|
|
1978
|
-
type: ActionType$
|
|
1978
|
+
type: ActionType$b.FixInvalidDate,
|
|
1979
1979
|
});
|
|
1980
1980
|
}
|
|
1981
1981
|
});
|
|
@@ -2522,27 +2522,27 @@ const PopPendingMark = (props) => {
|
|
|
2522
2522
|
*/
|
|
2523
2523
|
/* ------------- Actions ------------ */
|
|
2524
2524
|
// Types of actions
|
|
2525
|
-
var ActionType$
|
|
2525
|
+
var ActionType$a;
|
|
2526
2526
|
(function (ActionType) {
|
|
2527
2527
|
// Indicate that the text was recently copied
|
|
2528
2528
|
ActionType["IndicateRecentlyCopied"] = "indicate-recently-copied";
|
|
2529
2529
|
// Clear the status
|
|
2530
2530
|
ActionType["ClearRecentlyCopiedStatus"] = "clear-recently-copied-status";
|
|
2531
|
-
})(ActionType$
|
|
2531
|
+
})(ActionType$a || (ActionType$a = {}));
|
|
2532
2532
|
/**
|
|
2533
2533
|
* Reducer that executes actions
|
|
2534
2534
|
* @author Gabe Abrams
|
|
2535
2535
|
* @param state current state
|
|
2536
2536
|
* @param action action to execute
|
|
2537
2537
|
*/
|
|
2538
|
-
const reducer$
|
|
2538
|
+
const reducer$b = (state, action) => {
|
|
2539
2539
|
switch (action.type) {
|
|
2540
|
-
case ActionType$
|
|
2540
|
+
case ActionType$a.IndicateRecentlyCopied: {
|
|
2541
2541
|
return {
|
|
2542
2542
|
recentlyCopied: true,
|
|
2543
2543
|
};
|
|
2544
2544
|
}
|
|
2545
|
-
case ActionType$
|
|
2545
|
+
case ActionType$a.ClearRecentlyCopiedStatus: {
|
|
2546
2546
|
return {
|
|
2547
2547
|
recentlyCopied: false,
|
|
2548
2548
|
};
|
|
@@ -2568,7 +2568,7 @@ const CopiableBox = (props) => {
|
|
|
2568
2568
|
recentlyCopied: false,
|
|
2569
2569
|
};
|
|
2570
2570
|
// Initialize state
|
|
2571
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
2571
|
+
const [state, dispatch] = React.useReducer(reducer$b, initialState);
|
|
2572
2572
|
// Destructure common state
|
|
2573
2573
|
const { recentlyCopied, } = state;
|
|
2574
2574
|
/*------------------------------------------------------------------------*/
|
|
@@ -2588,13 +2588,13 @@ const CopiableBox = (props) => {
|
|
|
2588
2588
|
}
|
|
2589
2589
|
// Show copied notice
|
|
2590
2590
|
dispatch({
|
|
2591
|
-
type: ActionType$
|
|
2591
|
+
type: ActionType$a.IndicateRecentlyCopied,
|
|
2592
2592
|
});
|
|
2593
2593
|
// Wait a moment
|
|
2594
2594
|
yield dceCommonkit.waitMs(4000);
|
|
2595
2595
|
// Hide copied notice
|
|
2596
2596
|
dispatch({
|
|
2597
|
-
type: ActionType$
|
|
2597
|
+
type: ActionType$a.ClearRecentlyCopiedStatus,
|
|
2598
2598
|
});
|
|
2599
2599
|
});
|
|
2600
2600
|
/*------------------------------------------------------------------------*/
|
|
@@ -2650,20 +2650,20 @@ const CopiableBox = (props) => {
|
|
|
2650
2650
|
*/
|
|
2651
2651
|
/* ------------- Actions ------------ */
|
|
2652
2652
|
// Types of actions
|
|
2653
|
-
var ActionType$
|
|
2653
|
+
var ActionType$9;
|
|
2654
2654
|
(function (ActionType) {
|
|
2655
2655
|
// Toggle whether a child are being shown
|
|
2656
2656
|
ActionType["ToggleChild"] = "toggle-child";
|
|
2657
|
-
})(ActionType$
|
|
2657
|
+
})(ActionType$9 || (ActionType$9 = {}));
|
|
2658
2658
|
/**
|
|
2659
2659
|
* Reducer that executes actions
|
|
2660
2660
|
* @author Gabe Abrams
|
|
2661
2661
|
* @param state current state
|
|
2662
2662
|
* @param action action to execute
|
|
2663
2663
|
*/
|
|
2664
|
-
const reducer$
|
|
2664
|
+
const reducer$a = (state, action) => {
|
|
2665
2665
|
switch (action.type) {
|
|
2666
|
-
case ActionType$
|
|
2666
|
+
case ActionType$9.ToggleChild: {
|
|
2667
2667
|
return Object.assign(Object.assign({}, state), { childExpanded: Object.assign(Object.assign({}, state.childExpanded), { [String(action.id)]: !state.childExpanded[String(action.id)] }) });
|
|
2668
2668
|
}
|
|
2669
2669
|
default: {
|
|
@@ -2692,7 +2692,7 @@ const NestableItemList = (props) => {
|
|
|
2692
2692
|
childExpanded: initChildExpanded,
|
|
2693
2693
|
};
|
|
2694
2694
|
// Initialize state
|
|
2695
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
2695
|
+
const [state, dispatch] = React.useReducer(reducer$a, initialState);
|
|
2696
2696
|
// Destructure common state
|
|
2697
2697
|
const { childExpanded, } = state;
|
|
2698
2698
|
/*------------------------------------------------------------------------*/
|
|
@@ -2782,7 +2782,7 @@ const NestableItemList = (props) => {
|
|
|
2782
2782
|
backgroundColor: 'transparent',
|
|
2783
2783
|
}, type: "button", onClick: () => {
|
|
2784
2784
|
dispatch({
|
|
2785
|
-
type: ActionType$
|
|
2785
|
+
type: ActionType$9.ToggleChild,
|
|
2786
2786
|
id: item.id,
|
|
2787
2787
|
});
|
|
2788
2788
|
}, "aria-label": `${childExpanded[item.id] ? 'Hide' : 'Show'} items in ${item.name}` },
|
|
@@ -2917,7 +2917,7 @@ var SortType;
|
|
|
2917
2917
|
})(SortType || (SortType = {}));
|
|
2918
2918
|
/* ------------- Actions ------------ */
|
|
2919
2919
|
// Types of actions
|
|
2920
|
-
var ActionType$
|
|
2920
|
+
var ActionType$8;
|
|
2921
2921
|
(function (ActionType) {
|
|
2922
2922
|
// Toggle sort column param
|
|
2923
2923
|
ActionType["ToggleSortColumn"] = "toggle-sort-column";
|
|
@@ -2929,16 +2929,16 @@ var ActionType$7;
|
|
|
2929
2929
|
ActionType["ShowAllColumns"] = "show-all-columns";
|
|
2930
2930
|
// Hide all columns
|
|
2931
2931
|
ActionType["HideAllColumns"] = "hide-all-columns";
|
|
2932
|
-
})(ActionType$
|
|
2932
|
+
})(ActionType$8 || (ActionType$8 = {}));
|
|
2933
2933
|
/**
|
|
2934
2934
|
* Reducer that executes actions
|
|
2935
2935
|
* @author Gabe Abrams
|
|
2936
2936
|
* @param state current state
|
|
2937
2937
|
* @param action action to execute
|
|
2938
2938
|
*/
|
|
2939
|
-
const reducer$
|
|
2939
|
+
const reducer$9 = (state, action) => {
|
|
2940
2940
|
switch (action.type) {
|
|
2941
|
-
case ActionType$
|
|
2941
|
+
case ActionType$8.ToggleSortColumn: {
|
|
2942
2942
|
if (action.param !== state.sortColumnParam) {
|
|
2943
2943
|
// Different column param
|
|
2944
2944
|
return Object.assign(Object.assign({}, state), { sortColumnParam: action.param, sortType: SortType.Ascending });
|
|
@@ -2950,22 +2950,22 @@ const reducer$8 = (state, action) => {
|
|
|
2950
2950
|
// Stop sorting by column
|
|
2951
2951
|
return Object.assign(Object.assign({}, state), { sortColumnParam: undefined, sortType: SortType.Ascending });
|
|
2952
2952
|
}
|
|
2953
|
-
case ActionType$
|
|
2953
|
+
case ActionType$8.UpdateColumnVisibility: {
|
|
2954
2954
|
const { columnVisibilityMap } = state;
|
|
2955
2955
|
columnVisibilityMap[action.param] = action.visible;
|
|
2956
2956
|
return Object.assign(Object.assign({}, state), { columnVisibilityMap });
|
|
2957
2957
|
}
|
|
2958
|
-
case ActionType$
|
|
2958
|
+
case ActionType$8.ToggleColVisCusModalVisibility: {
|
|
2959
2959
|
return Object.assign(Object.assign({}, state), { columnVisibilityCustomizationModalVisible: !state.columnVisibilityCustomizationModalVisible });
|
|
2960
2960
|
}
|
|
2961
|
-
case ActionType$
|
|
2961
|
+
case ActionType$8.ShowAllColumns: {
|
|
2962
2962
|
const { columnVisibilityMap } = state;
|
|
2963
2963
|
Object.keys(columnVisibilityMap).forEach((param) => {
|
|
2964
2964
|
columnVisibilityMap[param] = true;
|
|
2965
2965
|
});
|
|
2966
2966
|
return Object.assign(Object.assign({}, state), { columnVisibilityMap });
|
|
2967
2967
|
}
|
|
2968
|
-
case ActionType$
|
|
2968
|
+
case ActionType$8.HideAllColumns: {
|
|
2969
2969
|
const { columnVisibilityMap } = state;
|
|
2970
2970
|
Object.keys(columnVisibilityMap).forEach((param) => {
|
|
2971
2971
|
columnVisibilityMap[param] = false;
|
|
@@ -3012,7 +3012,7 @@ const IntelliTable = (props) => {
|
|
|
3012
3012
|
columnVisibilityCustomizationModalVisible: false,
|
|
3013
3013
|
};
|
|
3014
3014
|
// Initialize state
|
|
3015
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
3015
|
+
const [state, dispatch] = React.useReducer(reducer$9, initialState);
|
|
3016
3016
|
// Destructure common state
|
|
3017
3017
|
const { sortColumnParam, sortType, columnVisibilityMap, columnVisibilityCustomizationModalVisible, } = state;
|
|
3018
3018
|
/*------------------------------------------------------------------------*/
|
|
@@ -3035,13 +3035,13 @@ const IntelliTable = (props) => {
|
|
|
3035
3035
|
return alert('Choose at least one column', 'To continue, you have to choose at least one column to show');
|
|
3036
3036
|
}
|
|
3037
3037
|
dispatch({
|
|
3038
|
-
type: ActionType$
|
|
3038
|
+
type: ActionType$8.ToggleColVisCusModalVisibility,
|
|
3039
3039
|
});
|
|
3040
3040
|
}, okayVariant: Variant$1.Light },
|
|
3041
3041
|
columns.map((column) => {
|
|
3042
3042
|
return (React__default["default"].createElement(CheckboxButton, { key: column.param, id: `IntelliTable-${id}-toggle-visibility-${column.param}`, className: "mb-2", text: column.title, onChanged: (checked) => {
|
|
3043
3043
|
dispatch({
|
|
3044
|
-
type: ActionType$
|
|
3044
|
+
type: ActionType$8.UpdateColumnVisibility,
|
|
3045
3045
|
param: column.param,
|
|
3046
3046
|
visible: checked,
|
|
3047
3047
|
});
|
|
@@ -3050,12 +3050,12 @@ const IntelliTable = (props) => {
|
|
|
3050
3050
|
React__default["default"].createElement("div", { className: "mt-3" }, "Or you can:"),
|
|
3051
3051
|
React__default["default"].createElement("button", { type: "button", id: `IntelliTable-${id}-select-all-columns`, className: "btn btn-secondary me-2", "aria-label": `show all columns in the ${title} table`, onClick: () => {
|
|
3052
3052
|
dispatch({
|
|
3053
|
-
type: ActionType$
|
|
3053
|
+
type: ActionType$8.ShowAllColumns,
|
|
3054
3054
|
});
|
|
3055
3055
|
} }, "Select All"),
|
|
3056
3056
|
React__default["default"].createElement("button", { type: "button", id: `IntelliTable-${id}-select-none-columns`, className: "btn btn-secondary", "aria-label": `hide all columns in the ${title} table`, onClick: () => {
|
|
3057
3057
|
dispatch({
|
|
3058
|
-
type: ActionType$
|
|
3058
|
+
type: ActionType$8.HideAllColumns,
|
|
3059
3059
|
});
|
|
3060
3060
|
} }, "Deselect All")));
|
|
3061
3061
|
}
|
|
@@ -3106,7 +3106,7 @@ const IntelliTable = (props) => {
|
|
|
3106
3106
|
React__default["default"].createElement("div", null,
|
|
3107
3107
|
React__default["default"].createElement("button", { type: "button", id: `IntelliTable-${id}-sort-by-${column.param}-button`, className: `btn btn-${sortingByThisColumn ? 'light' : 'secondary'} btn-sm ms-1 ps-1 pe-1 pt-0 pb-0`, "aria-label": sortButtonAriaLabel, onClick: () => {
|
|
3108
3108
|
dispatch({
|
|
3109
|
-
type: ActionType$
|
|
3109
|
+
type: ActionType$8.ToggleSortColumn,
|
|
3110
3110
|
param: column.param,
|
|
3111
3111
|
});
|
|
3112
3112
|
} },
|
|
@@ -3295,7 +3295,7 @@ const IntelliTable = (props) => {
|
|
|
3295
3295
|
React__default["default"].createElement(CSVDownloadButton, { "aria-label": `download data as csv for ${title}`, id: `IntelliTable-${id}-download-as-csv`, filename: filename, csv: csv }),
|
|
3296
3296
|
React__default["default"].createElement("button", { type: "button", className: "btn btn-secondary ms-2", "aria-label": `show panel for customizing which columns show in table ${title}`, id: `IntelliTable-${id}-show-column-customization-modal`, onClick: () => {
|
|
3297
3297
|
dispatch({
|
|
3298
|
-
type: ActionType$
|
|
3298
|
+
type: ActionType$8.ToggleColVisCusModalVisibility,
|
|
3299
3299
|
});
|
|
3300
3300
|
} },
|
|
3301
3301
|
"Show/Hide Cols",
|
|
@@ -3718,7 +3718,7 @@ const genHumanReadableName = (machineReadableName) => {
|
|
|
3718
3718
|
};
|
|
3719
3719
|
/* ------------- Actions ------------ */
|
|
3720
3720
|
// Types of actions
|
|
3721
|
-
var ActionType$
|
|
3721
|
+
var ActionType$7;
|
|
3722
3722
|
(function (ActionType) {
|
|
3723
3723
|
// Show the loading bar
|
|
3724
3724
|
ActionType["StartLoading"] = "start-loading";
|
|
@@ -3748,57 +3748,57 @@ var ActionType$6;
|
|
|
3748
3748
|
ActionType["SetPageNumber"] = "set-page-number";
|
|
3749
3749
|
// Reset user made filter change indicator
|
|
3750
3750
|
ActionType["ResetUserMadeFilterChange"] = "reset-user-made-filter-change";
|
|
3751
|
-
})(ActionType$
|
|
3751
|
+
})(ActionType$7 || (ActionType$7 = {}));
|
|
3752
3752
|
/**
|
|
3753
3753
|
* Reducer that executes actions
|
|
3754
3754
|
* @author Gabe Abrams
|
|
3755
3755
|
* @param state current state
|
|
3756
3756
|
* @param action action to execute
|
|
3757
3757
|
*/
|
|
3758
|
-
const reducer$
|
|
3758
|
+
const reducer$8 = (state, action) => {
|
|
3759
3759
|
switch (action.type) {
|
|
3760
|
-
case ActionType$
|
|
3760
|
+
case ActionType$7.StartLoading: {
|
|
3761
3761
|
return Object.assign(Object.assign({}, state), { loading: true });
|
|
3762
3762
|
}
|
|
3763
|
-
case ActionType$
|
|
3763
|
+
case ActionType$7.FinishLoading: {
|
|
3764
3764
|
return Object.assign(Object.assign({}, state), { loading: false, logs: action.logs });
|
|
3765
3765
|
}
|
|
3766
|
-
case ActionType$
|
|
3766
|
+
case ActionType$7.ToggleFilterDrawer: {
|
|
3767
3767
|
return Object.assign(Object.assign({}, state), { expandedFilterDrawer: (state.expandedFilterDrawer === action.filterDrawer
|
|
3768
3768
|
? undefined // hide
|
|
3769
3769
|
: action.filterDrawer) });
|
|
3770
3770
|
}
|
|
3771
|
-
case ActionType$
|
|
3771
|
+
case ActionType$7.HideFilterDrawer: {
|
|
3772
3772
|
return Object.assign(Object.assign({}, state), { expandedFilterDrawer: undefined });
|
|
3773
3773
|
}
|
|
3774
|
-
case ActionType$
|
|
3774
|
+
case ActionType$7.ResetFilters: {
|
|
3775
3775
|
return Object.assign(Object.assign({}, state), { pendingDateFilterState: action.initDateFilterState, pendingContextFilterState: action.initContextFilterState, pendingTagFilterState: action.initTagFilterState, pendingActionErrorFilterState: action.initActionErrorFilterState, pendingAdvancedFilterState: action.initAdvancedFilterState, pageNumber: 1 });
|
|
3776
3776
|
}
|
|
3777
|
-
case ActionType$
|
|
3777
|
+
case ActionType$7.UpdateDateFilterState: {
|
|
3778
3778
|
return Object.assign(Object.assign({}, state), { pendingDateFilterState: action.dateFilterState, userMadeFilterChange: true });
|
|
3779
3779
|
}
|
|
3780
|
-
case ActionType$
|
|
3780
|
+
case ActionType$7.UpdateContextFilterState: {
|
|
3781
3781
|
return Object.assign(Object.assign({}, state), { pendingContextFilterState: action.contextFilterState, userMadeFilterChange: true });
|
|
3782
3782
|
}
|
|
3783
|
-
case ActionType$
|
|
3783
|
+
case ActionType$7.UpdateTagFilterState: {
|
|
3784
3784
|
return Object.assign(Object.assign({}, state), { pendingTagFilterState: action.tagFilterState, userMadeFilterChange: true });
|
|
3785
3785
|
}
|
|
3786
|
-
case ActionType$
|
|
3786
|
+
case ActionType$7.UpdateActionErrorFilterState: {
|
|
3787
3787
|
return Object.assign(Object.assign({}, state), { pendingActionErrorFilterState: action.actionErrorFilterState, userMadeFilterChange: true });
|
|
3788
3788
|
}
|
|
3789
|
-
case ActionType$
|
|
3789
|
+
case ActionType$7.UpdateAdvancedFilterState: {
|
|
3790
3790
|
return Object.assign(Object.assign({}, state), { pendingAdvancedFilterState: action.advancedFilterState, userMadeFilterChange: true });
|
|
3791
3791
|
}
|
|
3792
|
-
case ActionType$
|
|
3792
|
+
case ActionType$7.SetHasAnotherPage: {
|
|
3793
3793
|
return Object.assign(Object.assign({}, state), { hasAnotherPage: action.hasAnotherPage });
|
|
3794
3794
|
}
|
|
3795
|
-
case ActionType$
|
|
3795
|
+
case ActionType$7.SetNumPages: {
|
|
3796
3796
|
return Object.assign(Object.assign({}, state), { numPages: action.numPages });
|
|
3797
3797
|
}
|
|
3798
|
-
case ActionType$
|
|
3798
|
+
case ActionType$7.SetPageNumber: {
|
|
3799
3799
|
return Object.assign(Object.assign({}, state), { pageNumber: action.pageNumber });
|
|
3800
3800
|
}
|
|
3801
|
-
case ActionType$
|
|
3801
|
+
case ActionType$7.ResetUserMadeFilterChange: {
|
|
3802
3802
|
return Object.assign(Object.assign({}, state), { userMadeFilterChange: false });
|
|
3803
3803
|
}
|
|
3804
3804
|
default: {
|
|
@@ -3931,7 +3931,7 @@ const LogReviewer = (props) => {
|
|
|
3931
3931
|
userMadeFilterChange: false,
|
|
3932
3932
|
};
|
|
3933
3933
|
// Initialize state
|
|
3934
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
3934
|
+
const [state, dispatch] = React.useReducer(reducer$8, initialState);
|
|
3935
3935
|
// Destructure common state
|
|
3936
3936
|
const { loading, logs, expandedFilterDrawer, pendingDateFilterState, pendingContextFilterState, pendingTagFilterState, pendingActionErrorFilterState, pendingAdvancedFilterState, pageNumber, numPages, userMadeFilterChange, } = state;
|
|
3937
3937
|
/* -------------- Refs -------------- */
|
|
@@ -3957,7 +3957,7 @@ const LogReviewer = (props) => {
|
|
|
3957
3957
|
const fetchLogs = (opts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
3958
3958
|
const { filters, pageNum, filtersChanged, } = opts;
|
|
3959
3959
|
dispatch({
|
|
3960
|
-
type: ActionType$
|
|
3960
|
+
type: ActionType$7.StartLoading,
|
|
3961
3961
|
});
|
|
3962
3962
|
try {
|
|
3963
3963
|
// Send filters to the server
|
|
@@ -3974,23 +3974,23 @@ const LogReviewer = (props) => {
|
|
|
3974
3974
|
});
|
|
3975
3975
|
fetchedLogs = fetchedLogs.concat(response.items);
|
|
3976
3976
|
dispatch({
|
|
3977
|
-
type: ActionType$
|
|
3977
|
+
type: ActionType$7.SetHasAnotherPage,
|
|
3978
3978
|
hasAnotherPage: response.hasAnotherPage,
|
|
3979
3979
|
});
|
|
3980
3980
|
if (filtersChanged && response.numPages !== undefined) {
|
|
3981
3981
|
dispatch({
|
|
3982
|
-
type: ActionType$
|
|
3982
|
+
type: ActionType$7.SetNumPages,
|
|
3983
3983
|
numPages: response.numPages,
|
|
3984
3984
|
});
|
|
3985
3985
|
}
|
|
3986
3986
|
// Update logs in state
|
|
3987
3987
|
dispatch({
|
|
3988
|
-
type: ActionType$
|
|
3988
|
+
type: ActionType$7.FinishLoading,
|
|
3989
3989
|
logs: fetchedLogs,
|
|
3990
3990
|
});
|
|
3991
3991
|
// Update page number
|
|
3992
3992
|
dispatch({
|
|
3993
|
-
type: ActionType$
|
|
3993
|
+
type: ActionType$7.SetPageNumber,
|
|
3994
3994
|
pageNumber: pageNum,
|
|
3995
3995
|
});
|
|
3996
3996
|
}
|
|
@@ -4049,7 +4049,7 @@ const LogReviewer = (props) => {
|
|
|
4049
4049
|
React__default["default"].createElement("div", { className: "LogReviewer-filter-toggle-buttons alert alert-secondary p-2 m-0" },
|
|
4050
4050
|
React__default["default"].createElement("button", { type: "button", id: "LogReviewer-toggle-date-filter-drawer", className: `btn btn-${FilterDrawer.Date === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle date filter drawer", onClick: () => {
|
|
4051
4051
|
dispatch({
|
|
4052
|
-
type: ActionType$
|
|
4052
|
+
type: ActionType$7.ToggleFilterDrawer,
|
|
4053
4053
|
filterDrawer: FilterDrawer.Date,
|
|
4054
4054
|
});
|
|
4055
4055
|
} },
|
|
@@ -4057,7 +4057,7 @@ const LogReviewer = (props) => {
|
|
|
4057
4057
|
"Date"),
|
|
4058
4058
|
React__default["default"].createElement("button", { type: "button", id: "LogReviewer-toggle-context-filter-drawer", className: `btn btn-${FilterDrawer.Context === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle context filter drawer", onClick: () => {
|
|
4059
4059
|
dispatch({
|
|
4060
|
-
type: ActionType$
|
|
4060
|
+
type: ActionType$7.ToggleFilterDrawer,
|
|
4061
4061
|
filterDrawer: FilterDrawer.Context,
|
|
4062
4062
|
});
|
|
4063
4063
|
} },
|
|
@@ -4065,7 +4065,7 @@ const LogReviewer = (props) => {
|
|
|
4065
4065
|
"Context"),
|
|
4066
4066
|
(LogMetadata.Tag && Object.keys(LogMetadata.Tag).length > 0) && (React__default["default"].createElement("button", { type: "button", id: "LogReviewer-toggle-tag-filter-drawer", className: `btn btn-${FilterDrawer.Tag === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle tag filter drawer", onClick: () => {
|
|
4067
4067
|
dispatch({
|
|
4068
|
-
type: ActionType$
|
|
4068
|
+
type: ActionType$7.ToggleFilterDrawer,
|
|
4069
4069
|
filterDrawer: FilterDrawer.Tag,
|
|
4070
4070
|
});
|
|
4071
4071
|
} },
|
|
@@ -4073,7 +4073,7 @@ const LogReviewer = (props) => {
|
|
|
4073
4073
|
"Tag")),
|
|
4074
4074
|
React__default["default"].createElement("button", { type: "button", id: "LogReviewer-toggle-action-filter-drawer", className: `btn btn-${FilterDrawer.Action === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle action and error filter drawer", onClick: () => {
|
|
4075
4075
|
dispatch({
|
|
4076
|
-
type: ActionType$
|
|
4076
|
+
type: ActionType$7.ToggleFilterDrawer,
|
|
4077
4077
|
filterDrawer: FilterDrawer.Action,
|
|
4078
4078
|
});
|
|
4079
4079
|
} },
|
|
@@ -4081,7 +4081,7 @@ const LogReviewer = (props) => {
|
|
|
4081
4081
|
"Action"),
|
|
4082
4082
|
React__default["default"].createElement("button", { type: "button", id: "LogReviewer-toggle-advanced-filter-drawer", className: `btn btn-${FilterDrawer.Advanced === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle advanced filter drawer", onClick: () => {
|
|
4083
4083
|
dispatch({
|
|
4084
|
-
type: ActionType$
|
|
4084
|
+
type: ActionType$7.ToggleFilterDrawer,
|
|
4085
4085
|
filterDrawer: FilterDrawer.Advanced,
|
|
4086
4086
|
});
|
|
4087
4087
|
} },
|
|
@@ -4110,7 +4110,7 @@ const LogReviewer = (props) => {
|
|
|
4110
4110
|
filtersChanged: true,
|
|
4111
4111
|
});
|
|
4112
4112
|
dispatch({
|
|
4113
|
-
type: ActionType$
|
|
4113
|
+
type: ActionType$7.ResetFilters,
|
|
4114
4114
|
initActionErrorFilterState,
|
|
4115
4115
|
initAdvancedFilterState,
|
|
4116
4116
|
initContextFilterState,
|
|
@@ -4118,7 +4118,7 @@ const LogReviewer = (props) => {
|
|
|
4118
4118
|
initTagFilterState,
|
|
4119
4119
|
});
|
|
4120
4120
|
dispatch({
|
|
4121
|
-
type: ActionType$
|
|
4121
|
+
type: ActionType$7.HideFilterDrawer,
|
|
4122
4122
|
});
|
|
4123
4123
|
} },
|
|
4124
4124
|
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faTimes }),
|
|
@@ -4126,11 +4126,11 @@ const LogReviewer = (props) => {
|
|
|
4126
4126
|
"Reset"),
|
|
4127
4127
|
userMadeFilterChange && (React__default["default"].createElement("button", { type: "button", id: "LogReviewer-submit-filters-button", className: "btn btn-primary ms-2", "aria-label": "submit filters", onClick: () => {
|
|
4128
4128
|
dispatch({
|
|
4129
|
-
type: ActionType$
|
|
4129
|
+
type: ActionType$7.HideFilterDrawer,
|
|
4130
4130
|
});
|
|
4131
4131
|
// Reset user made filter change indicator
|
|
4132
4132
|
dispatch({
|
|
4133
|
-
type: ActionType$
|
|
4133
|
+
type: ActionType$7.ResetUserMadeFilterChange,
|
|
4134
4134
|
});
|
|
4135
4135
|
// Save active filters
|
|
4136
4136
|
// Deep clone the pending filter states to avoid any reference issues
|
|
@@ -4165,7 +4165,7 @@ const LogReviewer = (props) => {
|
|
|
4165
4165
|
React__default["default"].createElement(SimpleDateChooser, { ariaLabel: "filter start date", name: "filter-start-date", year: pendingDateFilterState.startDate.year, month: pendingDateFilterState.startDate.month, day: pendingDateFilterState.startDate.day, dontAllowFuture: true, numMonthsToShow: 36, onChange: (month, day, year) => {
|
|
4166
4166
|
const newDateFilterState = Object.assign(Object.assign({}, pendingDateFilterState), { startDate: { month, day, year } });
|
|
4167
4167
|
dispatch({
|
|
4168
|
-
type: ActionType$
|
|
4168
|
+
type: ActionType$7.UpdateDateFilterState,
|
|
4169
4169
|
dateFilterState: newDateFilterState,
|
|
4170
4170
|
});
|
|
4171
4171
|
} }),
|
|
@@ -4183,7 +4183,7 @@ const LogReviewer = (props) => {
|
|
|
4183
4183
|
}
|
|
4184
4184
|
const newDateFilterState = Object.assign(Object.assign({}, pendingDateFilterState), { endDate: { month, day, year } });
|
|
4185
4185
|
dispatch({
|
|
4186
|
-
type: ActionType$
|
|
4186
|
+
type: ActionType$7.UpdateDateFilterState,
|
|
4187
4187
|
dateFilterState: newDateFilterState,
|
|
4188
4188
|
});
|
|
4189
4189
|
} })));
|
|
@@ -4276,7 +4276,7 @@ const LogReviewer = (props) => {
|
|
|
4276
4276
|
});
|
|
4277
4277
|
// Update state
|
|
4278
4278
|
dispatch({
|
|
4279
|
-
type: ActionType$
|
|
4279
|
+
type: ActionType$7.UpdateContextFilterState,
|
|
4280
4280
|
contextFilterState: newContextFilterState,
|
|
4281
4281
|
});
|
|
4282
4282
|
} }));
|
|
@@ -4291,7 +4291,7 @@ const LogReviewer = (props) => {
|
|
|
4291
4291
|
return (React__default["default"].createElement(CheckboxButton, { key: tag, id: `LogReviewer-tag-${tag}-checkbox`, text: description, ariaLabel: `require that logs be tagged with "${description}" or any other selected tag`, checked: pendingTagFilterState[tag], onChanged: (checked) => {
|
|
4292
4292
|
const newTagFilterState = Object.assign(Object.assign({}, pendingTagFilterState), { [tag]: checked });
|
|
4293
4293
|
dispatch({
|
|
4294
|
-
type: ActionType$
|
|
4294
|
+
type: ActionType$7.UpdateTagFilterState,
|
|
4295
4295
|
tagFilterState: newTagFilterState,
|
|
4296
4296
|
});
|
|
4297
4297
|
}, checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light }));
|
|
@@ -4304,21 +4304,21 @@ const LogReviewer = (props) => {
|
|
|
4304
4304
|
React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-all", text: "All Logs", onSelected: () => {
|
|
4305
4305
|
const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { type: undefined });
|
|
4306
4306
|
dispatch({
|
|
4307
|
-
type: ActionType$
|
|
4307
|
+
type: ActionType$7.UpdateActionErrorFilterState,
|
|
4308
4308
|
actionErrorFilterState: newActionErrorFilterState,
|
|
4309
4309
|
});
|
|
4310
4310
|
}, ariaLabel: "show logs of all types", selected: pendingActionErrorFilterState.type === undefined, unselectedVariant: Variant$1.Light }),
|
|
4311
4311
|
React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-action-only", text: "Action Logs Only", onSelected: () => {
|
|
4312
4312
|
const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { type: dceCommonkit.LogType.Action });
|
|
4313
4313
|
dispatch({
|
|
4314
|
-
type: ActionType$
|
|
4314
|
+
type: ActionType$7.UpdateActionErrorFilterState,
|
|
4315
4315
|
actionErrorFilterState: newActionErrorFilterState,
|
|
4316
4316
|
});
|
|
4317
4317
|
}, ariaLabel: "only show action logs", selected: pendingActionErrorFilterState.type === dceCommonkit.LogType.Action, unselectedVariant: Variant$1.Light }),
|
|
4318
4318
|
React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-error-only", text: "Action Error Only", onSelected: () => {
|
|
4319
4319
|
const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { type: dceCommonkit.LogType.Error });
|
|
4320
4320
|
dispatch({
|
|
4321
|
-
type: ActionType$
|
|
4321
|
+
type: ActionType$7.UpdateActionErrorFilterState,
|
|
4322
4322
|
actionErrorFilterState: newActionErrorFilterState,
|
|
4323
4323
|
});
|
|
4324
4324
|
}, ariaLabel: "only show error logs", selected: pendingActionErrorFilterState.type === dceCommonkit.LogType.Error, noMarginOnRight: true, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light })),
|
|
@@ -4330,7 +4330,7 @@ const LogReviewer = (props) => {
|
|
|
4330
4330
|
return (React__default["default"].createElement(CheckboxButton, { key: action, id: `LogReviewer-action-${action}-checkbox`, text: description, ariaLabel: `include logs with action type "${description}" in results`, noMarginOnRight: true, checked: pendingActionErrorFilterState.action[action], onChanged: (checked) => {
|
|
4331
4331
|
const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { action: Object.assign(Object.assign({}, pendingActionErrorFilterState.action), { [action]: checked }) });
|
|
4332
4332
|
dispatch({
|
|
4333
|
-
type: ActionType$
|
|
4333
|
+
type: ActionType$7.UpdateActionErrorFilterState,
|
|
4334
4334
|
actionErrorFilterState: newActionErrorFilterState,
|
|
4335
4335
|
});
|
|
4336
4336
|
}, checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light }));
|
|
@@ -4341,7 +4341,7 @@ const LogReviewer = (props) => {
|
|
|
4341
4341
|
return (React__default["default"].createElement(CheckboxButton, { key: target, id: `LogReviewer-target-${target}-checkbox`, text: description, ariaLabel: `include logs with target "${description}" in results`, checked: pendingActionErrorFilterState.target[target], noMarginOnRight: true, onChanged: (checked) => {
|
|
4342
4342
|
const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { target: Object.assign(Object.assign({}, pendingActionErrorFilterState.target), { [target]: checked }) });
|
|
4343
4343
|
dispatch({
|
|
4344
|
-
type: ActionType$
|
|
4344
|
+
type: ActionType$7.UpdateActionErrorFilterState,
|
|
4345
4345
|
actionErrorFilterState: newActionErrorFilterState,
|
|
4346
4346
|
});
|
|
4347
4347
|
}, checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light }));
|
|
@@ -4353,7 +4353,7 @@ const LogReviewer = (props) => {
|
|
|
4353
4353
|
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for error message", value: pendingActionErrorFilterState.errorMessage, placeholder: "e.g. undefined is not a function", onChange: (e) => {
|
|
4354
4354
|
const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { errorMessage: e.target.value });
|
|
4355
4355
|
dispatch({
|
|
4356
|
-
type: ActionType$
|
|
4356
|
+
type: ActionType$7.UpdateActionErrorFilterState,
|
|
4357
4357
|
actionErrorFilterState: newActionErrorFilterState,
|
|
4358
4358
|
});
|
|
4359
4359
|
} })),
|
|
@@ -4364,7 +4364,7 @@ const LogReviewer = (props) => {
|
|
|
4364
4364
|
.trim()
|
|
4365
4365
|
.toUpperCase()) });
|
|
4366
4366
|
dispatch({
|
|
4367
|
-
type: ActionType$
|
|
4367
|
+
type: ActionType$7.UpdateActionErrorFilterState,
|
|
4368
4368
|
actionErrorFilterState: newActionErrorFilterState,
|
|
4369
4369
|
});
|
|
4370
4370
|
} }))))));
|
|
@@ -4378,7 +4378,7 @@ const LogReviewer = (props) => {
|
|
|
4378
4378
|
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for user first name", value: pendingAdvancedFilterState.userFirstName, placeholder: "e.g. Divardo", onChange: (e) => {
|
|
4379
4379
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { userFirstName: e.target.value });
|
|
4380
4380
|
dispatch({
|
|
4381
|
-
type: ActionType$
|
|
4381
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4382
4382
|
advancedFilterState: newAdvancedFilterState,
|
|
4383
4383
|
});
|
|
4384
4384
|
} })),
|
|
@@ -4387,7 +4387,7 @@ const LogReviewer = (props) => {
|
|
|
4387
4387
|
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for user last name", value: pendingAdvancedFilterState.userLastName, placeholder: "e.g. Calicci", onChange: (e) => {
|
|
4388
4388
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { userLastName: e.target.value });
|
|
4389
4389
|
dispatch({
|
|
4390
|
-
type: ActionType$
|
|
4390
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4391
4391
|
advancedFilterState: newAdvancedFilterState,
|
|
4392
4392
|
});
|
|
4393
4393
|
} })),
|
|
@@ -4397,7 +4397,7 @@ const LogReviewer = (props) => {
|
|
|
4397
4397
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { userEmail: ((e.target.value)
|
|
4398
4398
|
.trim()) });
|
|
4399
4399
|
dispatch({
|
|
4400
|
-
type: ActionType$
|
|
4400
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4401
4401
|
advancedFilterState: newAdvancedFilterState,
|
|
4402
4402
|
});
|
|
4403
4403
|
} })),
|
|
@@ -4410,7 +4410,7 @@ const LogReviewer = (props) => {
|
|
|
4410
4410
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { userId: ((e.target.value)
|
|
4411
4411
|
.trim()) });
|
|
4412
4412
|
dispatch({
|
|
4413
|
-
type: ActionType$
|
|
4413
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4414
4414
|
advancedFilterState: newAdvancedFilterState,
|
|
4415
4415
|
});
|
|
4416
4416
|
}
|
|
@@ -4419,21 +4419,21 @@ const LogReviewer = (props) => {
|
|
|
4419
4419
|
React__default["default"].createElement(CheckboxButton, { text: "Students", onChanged: (checked) => {
|
|
4420
4420
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { includeLearners: checked });
|
|
4421
4421
|
dispatch({
|
|
4422
|
-
type: ActionType$
|
|
4422
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4423
4423
|
advancedFilterState: newAdvancedFilterState,
|
|
4424
4424
|
});
|
|
4425
4425
|
}, checked: pendingAdvancedFilterState.includeLearners, ariaLabel: "show logs from students", checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light }),
|
|
4426
4426
|
React__default["default"].createElement(CheckboxButton, { text: "Teaching Team Members", onChanged: (checked) => {
|
|
4427
4427
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { includeTTMs: checked });
|
|
4428
4428
|
dispatch({
|
|
4429
|
-
type: ActionType$
|
|
4429
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4430
4430
|
advancedFilterState: newAdvancedFilterState,
|
|
4431
4431
|
});
|
|
4432
4432
|
}, checked: pendingAdvancedFilterState.includeTTMs, ariaLabel: "show logs from teaching team members", checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light }),
|
|
4433
4433
|
React__default["default"].createElement(CheckboxButton, { text: "Admins", onChanged: (checked) => {
|
|
4434
4434
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { includeAdmins: checked });
|
|
4435
4435
|
dispatch({
|
|
4436
|
-
type: ActionType$
|
|
4436
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4437
4437
|
advancedFilterState: newAdvancedFilterState,
|
|
4438
4438
|
});
|
|
4439
4439
|
}, checked: pendingAdvancedFilterState.includeAdmins, ariaLabel: "show logs from admins", checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light }))),
|
|
@@ -4443,7 +4443,7 @@ const LogReviewer = (props) => {
|
|
|
4443
4443
|
React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for course name", value: pendingAdvancedFilterState.courseName, placeholder: "e.g. GLC 200", onChange: (e) => {
|
|
4444
4444
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { courseName: e.target.value });
|
|
4445
4445
|
dispatch({
|
|
4446
|
-
type: ActionType$
|
|
4446
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4447
4447
|
advancedFilterState: newAdvancedFilterState,
|
|
4448
4448
|
});
|
|
4449
4449
|
} })),
|
|
@@ -4456,7 +4456,7 @@ const LogReviewer = (props) => {
|
|
|
4456
4456
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { courseId: ((e.target.value)
|
|
4457
4457
|
.trim()) });
|
|
4458
4458
|
dispatch({
|
|
4459
|
-
type: ActionType$
|
|
4459
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4460
4460
|
advancedFilterState: newAdvancedFilterState,
|
|
4461
4461
|
});
|
|
4462
4462
|
}
|
|
@@ -4466,21 +4466,21 @@ const LogReviewer = (props) => {
|
|
|
4466
4466
|
React__default["default"].createElement(RadioButton, { text: "All Devices", ariaLabel: "show logs from all devices", selected: pendingAdvancedFilterState.isMobile === undefined, onSelected: () => {
|
|
4467
4467
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { isMobile: undefined });
|
|
4468
4468
|
dispatch({
|
|
4469
|
-
type: ActionType$
|
|
4469
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4470
4470
|
advancedFilterState: newAdvancedFilterState,
|
|
4471
4471
|
});
|
|
4472
4472
|
}, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light }),
|
|
4473
4473
|
React__default["default"].createElement(RadioButton, { text: "Mobile Only", ariaLabel: "show logs from mobile devices", selected: pendingAdvancedFilterState.isMobile === true, onSelected: () => {
|
|
4474
4474
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { isMobile: true });
|
|
4475
4475
|
dispatch({
|
|
4476
|
-
type: ActionType$
|
|
4476
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4477
4477
|
advancedFilterState: newAdvancedFilterState,
|
|
4478
4478
|
});
|
|
4479
4479
|
}, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light }),
|
|
4480
4480
|
React__default["default"].createElement(RadioButton, { text: "Desktop Only", ariaLabel: "show logs from desktop devices", selected: pendingAdvancedFilterState.isMobile === false, onSelected: () => {
|
|
4481
4481
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { isMobile: false });
|
|
4482
4482
|
dispatch({
|
|
4483
|
-
type: ActionType$
|
|
4483
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4484
4484
|
advancedFilterState: newAdvancedFilterState,
|
|
4485
4485
|
});
|
|
4486
4486
|
}, noMarginOnRight: true, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light }))),
|
|
@@ -4489,21 +4489,21 @@ const LogReviewer = (props) => {
|
|
|
4489
4489
|
React__default["default"].createElement(RadioButton, { text: "Both", ariaLabel: "show logs from all sources", selected: pendingAdvancedFilterState.source === undefined, onSelected: () => {
|
|
4490
4490
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { source: undefined });
|
|
4491
4491
|
dispatch({
|
|
4492
|
-
type: ActionType$
|
|
4492
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4493
4493
|
advancedFilterState: newAdvancedFilterState,
|
|
4494
4494
|
});
|
|
4495
4495
|
}, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light }),
|
|
4496
4496
|
React__default["default"].createElement(RadioButton, { text: "Client Only", ariaLabel: "show logs from client source", selected: pendingAdvancedFilterState.source === dceCommonkit.LogSource.Client, onSelected: () => {
|
|
4497
4497
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { source: dceCommonkit.LogSource.Client });
|
|
4498
4498
|
dispatch({
|
|
4499
|
-
type: ActionType$
|
|
4499
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4500
4500
|
advancedFilterState: newAdvancedFilterState,
|
|
4501
4501
|
});
|
|
4502
4502
|
}, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light }),
|
|
4503
4503
|
React__default["default"].createElement(RadioButton, { text: "Server Only", ariaLabel: "show logs from server source", selected: pendingAdvancedFilterState.source === dceCommonkit.LogSource.Server, onSelected: () => {
|
|
4504
4504
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { source: dceCommonkit.LogSource.Server });
|
|
4505
4505
|
dispatch({
|
|
4506
|
-
type: ActionType$
|
|
4506
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4507
4507
|
advancedFilterState: newAdvancedFilterState,
|
|
4508
4508
|
});
|
|
4509
4509
|
}, noMarginOnRight: true, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light })),
|
|
@@ -4514,7 +4514,7 @@ const LogReviewer = (props) => {
|
|
|
4514
4514
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { routePath: ((e.target.value)
|
|
4515
4515
|
.trim()) });
|
|
4516
4516
|
dispatch({
|
|
4517
|
-
type: ActionType$
|
|
4517
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4518
4518
|
advancedFilterState: newAdvancedFilterState,
|
|
4519
4519
|
});
|
|
4520
4520
|
} })),
|
|
@@ -4524,7 +4524,7 @@ const LogReviewer = (props) => {
|
|
|
4524
4524
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { routeTemplate: ((e.target.value)
|
|
4525
4525
|
.trim()) });
|
|
4526
4526
|
dispatch({
|
|
4527
|
-
type: ActionType$
|
|
4527
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4528
4528
|
advancedFilterState: newAdvancedFilterState,
|
|
4529
4529
|
});
|
|
4530
4530
|
} })))))));
|
|
@@ -12621,11 +12621,11 @@ var CreatableSelect$1 = CreatableSelect;
|
|
|
12621
12621
|
*/
|
|
12622
12622
|
/* ------------- Actions ------------ */
|
|
12623
12623
|
// Types of actions
|
|
12624
|
-
var ActionType$
|
|
12624
|
+
var ActionType$6;
|
|
12625
12625
|
(function (ActionType) {
|
|
12626
12626
|
// Update the input value
|
|
12627
12627
|
ActionType["SetInputValue"] = "SetInputValue";
|
|
12628
|
-
})(ActionType$
|
|
12628
|
+
})(ActionType$6 || (ActionType$6 = {}));
|
|
12629
12629
|
/**
|
|
12630
12630
|
* Reducer that executes actions
|
|
12631
12631
|
* @author Yuen Ler Chow
|
|
@@ -12633,9 +12633,9 @@ var ActionType$5;
|
|
|
12633
12633
|
* @param action action to execute
|
|
12634
12634
|
* @returns updated state
|
|
12635
12635
|
*/
|
|
12636
|
-
const reducer$
|
|
12636
|
+
const reducer$7 = (state, action) => {
|
|
12637
12637
|
switch (action.type) {
|
|
12638
|
-
case ActionType$
|
|
12638
|
+
case ActionType$6.SetInputValue: {
|
|
12639
12639
|
return Object.assign(Object.assign({}, state), { inputValue: action.value });
|
|
12640
12640
|
}
|
|
12641
12641
|
default: {
|
|
@@ -12655,7 +12655,7 @@ const CreatableMultiselect = (props) => {
|
|
|
12655
12655
|
inputValue: '',
|
|
12656
12656
|
};
|
|
12657
12657
|
// Initialize state
|
|
12658
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
12658
|
+
const [state, dispatch] = React.useReducer(reducer$7, initialState);
|
|
12659
12659
|
// Destructure common state
|
|
12660
12660
|
const { inputValue } = state;
|
|
12661
12661
|
/*------------------------------------------------------------------------*/
|
|
@@ -12732,7 +12732,7 @@ const CreatableMultiselect = (props) => {
|
|
|
12732
12732
|
}
|
|
12733
12733
|
// Reset text field to empty because the values have been added
|
|
12734
12734
|
dispatch({
|
|
12735
|
-
type: ActionType$
|
|
12735
|
+
type: ActionType$6.SetInputValue,
|
|
12736
12736
|
value: '',
|
|
12737
12737
|
});
|
|
12738
12738
|
};
|
|
@@ -12771,7 +12771,7 @@ const CreatableMultiselect = (props) => {
|
|
|
12771
12771
|
else {
|
|
12772
12772
|
// simply update the input value to the new input value
|
|
12773
12773
|
dispatch({
|
|
12774
|
-
type: ActionType$
|
|
12774
|
+
type: ActionType$6.SetInputValue,
|
|
12775
12775
|
value: newValue,
|
|
12776
12776
|
});
|
|
12777
12777
|
}
|
|
@@ -12823,13 +12823,13 @@ const style$2 = `
|
|
|
12823
12823
|
`;
|
|
12824
12824
|
/* ------------- Actions ------------ */
|
|
12825
12825
|
// Types of actions
|
|
12826
|
-
var ActionType$
|
|
12826
|
+
var ActionType$5;
|
|
12827
12827
|
(function (ActionType) {
|
|
12828
12828
|
// Update the DBEntry
|
|
12829
12829
|
ActionType["UpdateDBEntry"] = "UpdateDBEntry";
|
|
12830
12830
|
// Start the save spinner
|
|
12831
12831
|
ActionType["StartSave"] = "StartSave";
|
|
12832
|
-
})(ActionType$
|
|
12832
|
+
})(ActionType$5 || (ActionType$5 = {}));
|
|
12833
12833
|
/**
|
|
12834
12834
|
* Reducer that executes actions
|
|
12835
12835
|
* @author Yuen Ler Chow
|
|
@@ -12837,12 +12837,12 @@ var ActionType$4;
|
|
|
12837
12837
|
* @param action action to execute
|
|
12838
12838
|
* @returns updated state
|
|
12839
12839
|
*/
|
|
12840
|
-
const reducer$
|
|
12840
|
+
const reducer$6 = (state, action) => {
|
|
12841
12841
|
switch (action.type) {
|
|
12842
|
-
case ActionType$
|
|
12842
|
+
case ActionType$5.UpdateDBEntry: {
|
|
12843
12843
|
return Object.assign(Object.assign({}, state), { entry: action.dbEntry });
|
|
12844
12844
|
}
|
|
12845
|
-
case ActionType$
|
|
12845
|
+
case ActionType$5.StartSave: {
|
|
12846
12846
|
return Object.assign(Object.assign({}, state), { saving: true });
|
|
12847
12847
|
}
|
|
12848
12848
|
default: {
|
|
@@ -12867,7 +12867,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12867
12867
|
saving: false,
|
|
12868
12868
|
};
|
|
12869
12869
|
// Initialize state
|
|
12870
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
12870
|
+
const [state, dispatch] = React.useReducer(reducer$6, initialState);
|
|
12871
12871
|
// Destructure common state
|
|
12872
12872
|
const { entry, saving, } = state;
|
|
12873
12873
|
/*------------------------------------------------------------------------*/
|
|
@@ -12879,7 +12879,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12879
12879
|
*/
|
|
12880
12880
|
const save = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
12881
12881
|
// Start the save loading indicator
|
|
12882
|
-
dispatch({ type: ActionType$
|
|
12882
|
+
dispatch({ type: ActionType$5.StartSave });
|
|
12883
12883
|
// add all default values to the entry
|
|
12884
12884
|
entryFields.forEach((field) => {
|
|
12885
12885
|
if (field.defaultValue && !entry[field.objectKey]) {
|
|
@@ -13062,7 +13062,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
13062
13062
|
return (React__default["default"].createElement(RadioButton, { key: choice.value, text: choice.title, selected: entry[field.objectKey] === choice.value, onSelected: () => {
|
|
13063
13063
|
entry[field.objectKey] = choice.value;
|
|
13064
13064
|
dispatch({
|
|
13065
|
-
type: ActionType$
|
|
13065
|
+
type: ActionType$5.UpdateDBEntry,
|
|
13066
13066
|
dbEntry: entry,
|
|
13067
13067
|
});
|
|
13068
13068
|
}, ariaLabel: choice.title }));
|
|
@@ -13074,7 +13074,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
13074
13074
|
React__default["default"].createElement("input", { disabled: disabled, type: "text", className: "form-control", placeholder: field.placeholder, "aria-describedby": "AddOrEditDBEntry-form-name-label", value: entry[field.objectKey] || '', onChange: (e) => {
|
|
13075
13075
|
entry[field.objectKey] = (e.target.value);
|
|
13076
13076
|
dispatch({
|
|
13077
|
-
type: ActionType$
|
|
13077
|
+
type: ActionType$5.UpdateDBEntry,
|
|
13078
13078
|
dbEntry: entry,
|
|
13079
13079
|
});
|
|
13080
13080
|
} }))));
|
|
@@ -13087,7 +13087,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
13087
13087
|
entry[field.objectKey] = (e.target.value
|
|
13088
13088
|
.replace(/[^0-9]/g, ''));
|
|
13089
13089
|
dispatch({
|
|
13090
|
-
type: ActionType$
|
|
13090
|
+
type: ActionType$5.UpdateDBEntry,
|
|
13091
13091
|
dbEntry: entry,
|
|
13092
13092
|
});
|
|
13093
13093
|
} }))));
|
|
@@ -13117,7 +13117,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
13117
13117
|
}
|
|
13118
13118
|
// Save
|
|
13119
13119
|
dispatch({
|
|
13120
|
-
type: ActionType$
|
|
13120
|
+
type: ActionType$5.UpdateDBEntry,
|
|
13121
13121
|
dbEntry: entry,
|
|
13122
13122
|
});
|
|
13123
13123
|
}, ariaLabel: choice.title }));
|
|
@@ -13132,7 +13132,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
13132
13132
|
// Update entry and save
|
|
13133
13133
|
entry[field.objectKey] = values;
|
|
13134
13134
|
dispatch({
|
|
13135
|
-
type: ActionType$
|
|
13135
|
+
type: ActionType$5.UpdateDBEntry,
|
|
13136
13136
|
dbEntry: entry,
|
|
13137
13137
|
});
|
|
13138
13138
|
} })))));
|
|
@@ -13145,7 +13145,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
13145
13145
|
React__default["default"].createElement(CreatableMultiselect, { disabled: disabled, type: DBEntryFieldType$1.NumberArray, values: entry[field.objectKey] || [], onChange: (values) => {
|
|
13146
13146
|
entry[field.objectKey] = values;
|
|
13147
13147
|
dispatch({
|
|
13148
|
-
type: ActionType$
|
|
13148
|
+
type: ActionType$5.UpdateDBEntry,
|
|
13149
13149
|
dbEntry: entry,
|
|
13150
13150
|
});
|
|
13151
13151
|
} })))));
|
|
@@ -13219,7 +13219,7 @@ const generateEndpointPath = (collectionName, adminsOnly = true) => {
|
|
|
13219
13219
|
*/
|
|
13220
13220
|
/* ------------- Actions ------------ */
|
|
13221
13221
|
// Types of actions
|
|
13222
|
-
var ActionType$
|
|
13222
|
+
var ActionType$4;
|
|
13223
13223
|
(function (ActionType) {
|
|
13224
13224
|
// Show adder
|
|
13225
13225
|
ActionType["ShowAdder"] = "ShowAdder";
|
|
@@ -13233,7 +13233,7 @@ var ActionType$3;
|
|
|
13233
13233
|
ActionType["StartDelete"] = "StartDelete";
|
|
13234
13234
|
// Finish deletion process
|
|
13235
13235
|
ActionType["FinishDelete"] = "FinishDelete";
|
|
13236
|
-
})(ActionType$
|
|
13236
|
+
})(ActionType$4 || (ActionType$4 = {}));
|
|
13237
13237
|
/**
|
|
13238
13238
|
* Reducer that executes actions
|
|
13239
13239
|
* @author Yuen Ler Chow
|
|
@@ -13241,18 +13241,18 @@ var ActionType$3;
|
|
|
13241
13241
|
* @param action action to execute
|
|
13242
13242
|
* @returns updated state
|
|
13243
13243
|
*/
|
|
13244
|
-
const reducer$
|
|
13244
|
+
const reducer$5 = (state, action) => {
|
|
13245
13245
|
switch (action.type) {
|
|
13246
|
-
case ActionType$
|
|
13246
|
+
case ActionType$4.FinishLoading: {
|
|
13247
13247
|
return Object.assign(Object.assign({}, state), { loading: false, dbEntries: action.dbEntries });
|
|
13248
13248
|
}
|
|
13249
|
-
case ActionType$
|
|
13249
|
+
case ActionType$4.ShowAdder: {
|
|
13250
13250
|
return Object.assign(Object.assign({}, state), { adding: true, dbEntryToEdit: undefined });
|
|
13251
13251
|
}
|
|
13252
|
-
case ActionType$
|
|
13252
|
+
case ActionType$4.ShowEditor: {
|
|
13253
13253
|
return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: action.dbEntry });
|
|
13254
13254
|
}
|
|
13255
|
-
case ActionType$
|
|
13255
|
+
case ActionType$4.FinishAdd: {
|
|
13256
13256
|
// Handle cancel
|
|
13257
13257
|
const finishedEntry = action.dbEntry;
|
|
13258
13258
|
if (!finishedEntry) {
|
|
@@ -13276,10 +13276,10 @@ const reducer$4 = (state, action) => {
|
|
|
13276
13276
|
// Update the state
|
|
13277
13277
|
return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: undefined, dbEntries: updatedDbEntries });
|
|
13278
13278
|
}
|
|
13279
|
-
case ActionType$
|
|
13279
|
+
case ActionType$4.StartDelete: {
|
|
13280
13280
|
return Object.assign(Object.assign({}, state), { loading: true });
|
|
13281
13281
|
}
|
|
13282
|
-
case ActionType$
|
|
13282
|
+
case ActionType$4.FinishDelete: {
|
|
13283
13283
|
return Object.assign(Object.assign({}, state), { loading: false,
|
|
13284
13284
|
// Remove the deleted entry from the list
|
|
13285
13285
|
dbEntries: state.dbEntries.filter((entry) => {
|
|
@@ -13305,7 +13305,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
13305
13305
|
loading: true,
|
|
13306
13306
|
};
|
|
13307
13307
|
// Initialize state
|
|
13308
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
13308
|
+
const [state, dispatch] = React.useReducer(reducer$5, initialState);
|
|
13309
13309
|
// Destructure common state
|
|
13310
13310
|
const { adding, dbEntryToEdit, dbEntries, loading, } = state;
|
|
13311
13311
|
/*------------------------------------------------------------------------*/
|
|
@@ -13331,7 +13331,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
13331
13331
|
try {
|
|
13332
13332
|
// Start loader
|
|
13333
13333
|
dispatch({
|
|
13334
|
-
type: ActionType$
|
|
13334
|
+
type: ActionType$4.StartDelete,
|
|
13335
13335
|
});
|
|
13336
13336
|
// Perform deletion
|
|
13337
13337
|
yield visitServerEndpoint({
|
|
@@ -13340,7 +13340,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
13340
13340
|
});
|
|
13341
13341
|
// Finish loader
|
|
13342
13342
|
dispatch({
|
|
13343
|
-
type: ActionType$
|
|
13343
|
+
type: ActionType$4.FinishDelete,
|
|
13344
13344
|
dbEntry: entry,
|
|
13345
13345
|
idPropName,
|
|
13346
13346
|
});
|
|
@@ -13369,7 +13369,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
13369
13369
|
});
|
|
13370
13370
|
// Save loaded data
|
|
13371
13371
|
dispatch({
|
|
13372
|
-
type: ActionType$
|
|
13372
|
+
type: ActionType$4.FinishLoading,
|
|
13373
13373
|
dbEntries: data,
|
|
13374
13374
|
});
|
|
13375
13375
|
}
|
|
@@ -13412,7 +13412,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
13412
13412
|
React__default["default"].createElement("span", { className: "d-none d-md-inline ms-1" }, "Remove")),
|
|
13413
13413
|
!disableEdit && (React__default["default"].createElement("button", { type: "button", id: `DBEntryManagerPanel-edit-with-id-${entry[idPropName]}`, className: "btn btn-primary", "aria-label": `edit db entry: ${entry[titlePropName]}`, onClick: () => {
|
|
13414
13414
|
dispatch({
|
|
13415
|
-
type: ActionType$
|
|
13415
|
+
type: ActionType$4.ShowEditor,
|
|
13416
13416
|
dbEntry: entry,
|
|
13417
13417
|
});
|
|
13418
13418
|
} },
|
|
@@ -13422,7 +13422,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
13422
13422
|
React__default["default"].createElement("div", { className: "d-grid" },
|
|
13423
13423
|
React__default["default"].createElement("button", { type: "button", id: "DBEntryManagerPanel-add-entry", className: "btn btn-lg btn-primary", "aria-label": `add a new ${itemName} entry to the list of entries`, onClick: () => {
|
|
13424
13424
|
dispatch({
|
|
13425
|
-
type: ActionType$
|
|
13425
|
+
type: ActionType$4.ShowAdder,
|
|
13426
13426
|
});
|
|
13427
13427
|
} },
|
|
13428
13428
|
React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faPlus, className: "me-2" }),
|
|
@@ -13434,7 +13434,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
13434
13434
|
if (!loading && (adding || dbEntryToEdit)) {
|
|
13435
13435
|
body = (React__default["default"].createElement(AddOrEditDBEntry, { saveEndpointPath: endpoint, validateEntry: validateEntry, modifyEntry: modifyEntry, entryFields: entryFields, dbEntryToEdit: dbEntryToEdit, idPropName: idPropName, entries: dbEntries, itemName: itemName, onFinished: (entry) => {
|
|
13436
13436
|
dispatch({
|
|
13437
|
-
type: ActionType$
|
|
13437
|
+
type: ActionType$4.FinishAdd,
|
|
13438
13438
|
dbEntry: entry,
|
|
13439
13439
|
idPropName,
|
|
13440
13440
|
});
|
|
@@ -13610,25 +13610,25 @@ const getItemIds = (items) => {
|
|
|
13610
13610
|
};
|
|
13611
13611
|
/* ------------- Actions ------------ */
|
|
13612
13612
|
// Types of actions
|
|
13613
|
-
var ActionType$
|
|
13613
|
+
var ActionType$3;
|
|
13614
13614
|
(function (ActionType) {
|
|
13615
13615
|
// Hide the "jump to bottom" button
|
|
13616
13616
|
ActionType["HideJumpToBottomButton"] = "HideJumpToBottomButton";
|
|
13617
13617
|
// Show the "jump to bottom" button
|
|
13618
13618
|
ActionType["ShowJumpToBottomButton"] = "ShowJumpToBottomButton";
|
|
13619
|
-
})(ActionType$
|
|
13619
|
+
})(ActionType$3 || (ActionType$3 = {}));
|
|
13620
13620
|
/**
|
|
13621
13621
|
* Reducer that executes actions
|
|
13622
13622
|
* @author Gabe Abrams
|
|
13623
13623
|
* @param state current state
|
|
13624
13624
|
* @param action action to execute
|
|
13625
13625
|
*/
|
|
13626
|
-
const reducer$
|
|
13626
|
+
const reducer$4 = (state, action) => {
|
|
13627
13627
|
switch (action.type) {
|
|
13628
|
-
case ActionType$
|
|
13628
|
+
case ActionType$3.HideJumpToBottomButton: {
|
|
13629
13629
|
return Object.assign(Object.assign({}, state), { jumpToBottomButtonVisible: false });
|
|
13630
13630
|
}
|
|
13631
|
-
case ActionType$
|
|
13631
|
+
case ActionType$3.ShowJumpToBottomButton: {
|
|
13632
13632
|
return Object.assign(Object.assign({}, state), { jumpToBottomButtonVisible: true });
|
|
13633
13633
|
}
|
|
13634
13634
|
default: {
|
|
@@ -13652,7 +13652,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13652
13652
|
jumpToBottomButtonVisible: false,
|
|
13653
13653
|
};
|
|
13654
13654
|
// Initialize state
|
|
13655
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
13655
|
+
const [state, dispatch] = React.useReducer(reducer$4, initialState);
|
|
13656
13656
|
// Destructure common state
|
|
13657
13657
|
const { jumpToBottomButtonVisible, } = state;
|
|
13658
13658
|
/* -------------- Refs -------------- */
|
|
@@ -13698,7 +13698,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13698
13698
|
}
|
|
13699
13699
|
// Update state
|
|
13700
13700
|
dispatch({
|
|
13701
|
-
type: ActionType$
|
|
13701
|
+
type: ActionType$3.HideJumpToBottomButton,
|
|
13702
13702
|
});
|
|
13703
13703
|
// Scroll to bottom
|
|
13704
13704
|
container.current.scrollTop = (container.current.scrollHeight
|
|
@@ -13722,7 +13722,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13722
13722
|
if (isScrolledToBottom()) {
|
|
13723
13723
|
// Hide button
|
|
13724
13724
|
dispatch({
|
|
13725
|
-
type: ActionType$
|
|
13725
|
+
type: ActionType$3.HideJumpToBottomButton,
|
|
13726
13726
|
});
|
|
13727
13727
|
}
|
|
13728
13728
|
};
|
|
@@ -13764,7 +13764,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13764
13764
|
else {
|
|
13765
13765
|
// Not scrolled to bottom. Show "jump to bottom" button.
|
|
13766
13766
|
dispatch({
|
|
13767
|
-
type: ActionType$
|
|
13767
|
+
type: ActionType$3.ShowJumpToBottomButton,
|
|
13768
13768
|
});
|
|
13769
13769
|
}
|
|
13770
13770
|
}, [items]);
|
|
@@ -13834,25 +13834,25 @@ const combineClassNames = (classNames) => {
|
|
|
13834
13834
|
*/
|
|
13835
13835
|
/* ------------- Actions ------------ */
|
|
13836
13836
|
// Types of actions
|
|
13837
|
-
var ActionType$
|
|
13837
|
+
var ActionType$2;
|
|
13838
13838
|
(function (ActionType) {
|
|
13839
13839
|
// Start hovering on an option
|
|
13840
13840
|
ActionType["StartHover"] = "StartHover";
|
|
13841
13841
|
// Stop hovering on an option
|
|
13842
13842
|
ActionType["StopHover"] = "StopHover";
|
|
13843
|
-
})(ActionType$
|
|
13843
|
+
})(ActionType$2 || (ActionType$2 = {}));
|
|
13844
13844
|
/**
|
|
13845
13845
|
* Reducer that executes actions
|
|
13846
13846
|
* @author Gabe Abrams
|
|
13847
13847
|
* @param state current state
|
|
13848
13848
|
* @param action action to execute
|
|
13849
13849
|
*/
|
|
13850
|
-
const reducer$
|
|
13850
|
+
const reducer$3 = (state, action) => {
|
|
13851
13851
|
switch (action.type) {
|
|
13852
|
-
case ActionType$
|
|
13852
|
+
case ActionType$2.StartHover: {
|
|
13853
13853
|
return Object.assign(Object.assign({}, state), { hoveredOptionId: action.hoveredOptionId });
|
|
13854
13854
|
}
|
|
13855
|
-
case ActionType$
|
|
13855
|
+
case ActionType$2.StopHover: {
|
|
13856
13856
|
return Object.assign(Object.assign({}, state), { hoveredOptionId: undefined });
|
|
13857
13857
|
}
|
|
13858
13858
|
default: {
|
|
@@ -13876,7 +13876,7 @@ const MultiSwitch = (props) => {
|
|
|
13876
13876
|
hoveredOptionId: undefined,
|
|
13877
13877
|
};
|
|
13878
13878
|
// Initialize state
|
|
13879
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
13879
|
+
const [state, dispatch] = React.useReducer(reducer$3, initialState);
|
|
13880
13880
|
// Destructure common state
|
|
13881
13881
|
const { hoveredOptionId, } = state;
|
|
13882
13882
|
/*------------------------------------------------------------------------*/
|
|
@@ -14008,27 +14008,27 @@ const MultiSwitch = (props) => {
|
|
|
14008
14008
|
: `click to select option "${option.label}"`), onClick: () => {
|
|
14009
14009
|
// Remove hover
|
|
14010
14010
|
dispatch({
|
|
14011
|
-
type: ActionType$
|
|
14011
|
+
type: ActionType$2.StopHover,
|
|
14012
14012
|
});
|
|
14013
14013
|
// Notify parent
|
|
14014
14014
|
onChange(option.id);
|
|
14015
14015
|
}, onMouseEnter: () => {
|
|
14016
14016
|
dispatch({
|
|
14017
|
-
type: ActionType$
|
|
14017
|
+
type: ActionType$2.StartHover,
|
|
14018
14018
|
hoveredOptionId: option.id,
|
|
14019
14019
|
});
|
|
14020
14020
|
}, onMouseLeave: () => {
|
|
14021
14021
|
dispatch({
|
|
14022
|
-
type: ActionType$
|
|
14022
|
+
type: ActionType$2.StopHover,
|
|
14023
14023
|
});
|
|
14024
14024
|
}, onFocus: () => {
|
|
14025
14025
|
dispatch({
|
|
14026
|
-
type: ActionType$
|
|
14026
|
+
type: ActionType$2.StartHover,
|
|
14027
14027
|
hoveredOptionId: option.id,
|
|
14028
14028
|
});
|
|
14029
14029
|
}, onBlur: () => {
|
|
14030
14030
|
dispatch({
|
|
14031
|
-
type: ActionType$
|
|
14031
|
+
type: ActionType$2.StopHover,
|
|
14032
14032
|
});
|
|
14033
14033
|
}, style: {
|
|
14034
14034
|
pointerEvents: ((option.id === selectedOptionId)
|
|
@@ -14067,13 +14067,13 @@ var DropdownItemType$1 = DropdownItemType;
|
|
|
14067
14067
|
*/
|
|
14068
14068
|
/* ------------- Actions ------------ */
|
|
14069
14069
|
// Types of actions
|
|
14070
|
-
var ActionType;
|
|
14070
|
+
var ActionType$1;
|
|
14071
14071
|
(function (ActionType) {
|
|
14072
14072
|
// Toggle opening the dropdown menu
|
|
14073
14073
|
ActionType["ToggleDropdown"] = "ToggleDropdown";
|
|
14074
14074
|
// Close the dropdown menu
|
|
14075
14075
|
ActionType["CloseDropdown"] = "CloseDropdown";
|
|
14076
|
-
})(ActionType || (ActionType = {}));
|
|
14076
|
+
})(ActionType$1 || (ActionType$1 = {}));
|
|
14077
14077
|
/**
|
|
14078
14078
|
* Reducer that executes actions
|
|
14079
14079
|
* @author Alessandra De Lucas
|
|
@@ -14081,12 +14081,12 @@ var ActionType;
|
|
|
14081
14081
|
* @param state current state
|
|
14082
14082
|
* @param action action to execute
|
|
14083
14083
|
*/
|
|
14084
|
-
const reducer$
|
|
14084
|
+
const reducer$2 = (state, action) => {
|
|
14085
14085
|
switch (action.type) {
|
|
14086
|
-
case ActionType.ToggleDropdown: {
|
|
14086
|
+
case ActionType$1.ToggleDropdown: {
|
|
14087
14087
|
return Object.assign(Object.assign({}, state), { isDropdownOpen: !state.isDropdownOpen });
|
|
14088
14088
|
}
|
|
14089
|
-
case ActionType.CloseDropdown: {
|
|
14089
|
+
case ActionType$1.CloseDropdown: {
|
|
14090
14090
|
return Object.assign(Object.assign({}, state), { isDropdownOpen: false });
|
|
14091
14091
|
}
|
|
14092
14092
|
default: {
|
|
@@ -14110,7 +14110,7 @@ const Dropdown = (props) => {
|
|
|
14110
14110
|
isDropdownOpen: false,
|
|
14111
14111
|
};
|
|
14112
14112
|
// Initialize state
|
|
14113
|
-
const [state, dispatch] = React.useReducer(reducer$
|
|
14113
|
+
const [state, dispatch] = React.useReducer(reducer$2, initialState);
|
|
14114
14114
|
// Destructure common state
|
|
14115
14115
|
const { isDropdownOpen, } = state;
|
|
14116
14116
|
/* -------------- Refs -------------- */
|
|
@@ -14130,7 +14130,7 @@ const Dropdown = (props) => {
|
|
|
14130
14130
|
dropdownRef.current
|
|
14131
14131
|
// Click occurred outside the dropdown
|
|
14132
14132
|
&& !dropdownRef.current.contains(event.target)) {
|
|
14133
|
-
dispatch({ type: ActionType.CloseDropdown });
|
|
14133
|
+
dispatch({ type: ActionType$1.CloseDropdown });
|
|
14134
14134
|
}
|
|
14135
14135
|
};
|
|
14136
14136
|
/*------------------------------------------------------------------------*/
|
|
@@ -14159,7 +14159,7 @@ const Dropdown = (props) => {
|
|
|
14159
14159
|
dropdownButton.variant === Variant$1.Light && 'text-dark',
|
|
14160
14160
|
]), type: "button", id: dropdownButton.id, "aria-expanded": isDropdownOpen, "aria-label": dropdownButton.ariaLabel, onClick: () => {
|
|
14161
14161
|
dispatch({
|
|
14162
|
-
type: ActionType.ToggleDropdown,
|
|
14162
|
+
type: ActionType$1.ToggleDropdown,
|
|
14163
14163
|
});
|
|
14164
14164
|
} }, dropdownButton.content),
|
|
14165
14165
|
React__default["default"].createElement("ul", { className: combineClassNames([
|
|
@@ -14181,7 +14181,7 @@ const Dropdown = (props) => {
|
|
|
14181
14181
|
React__default["default"].createElement("button", { type: "button", "aria-label": item.ariaLabel, className: "dropdown-item", onClick: (e) => {
|
|
14182
14182
|
e.preventDefault();
|
|
14183
14183
|
dispatch({
|
|
14184
|
-
type: ActionType.CloseDropdown,
|
|
14184
|
+
type: ActionType$1.CloseDropdown,
|
|
14185
14185
|
});
|
|
14186
14186
|
item.onClick();
|
|
14187
14187
|
} }, item.content)));
|
|
@@ -14389,6 +14389,150 @@ const ProgressBar = (props) => {
|
|
|
14389
14389
|
"\u00A0"))));
|
|
14390
14390
|
};
|
|
14391
14391
|
|
|
14392
|
+
/**
|
|
14393
|
+
* Fake progress bar that approaches completion but never fully finishes.
|
|
14394
|
+
* Built on top of the existing ProgressBar component.
|
|
14395
|
+
*
|
|
14396
|
+
* Two phases:
|
|
14397
|
+
* 1. Fast phase (0–90%): random jumps of 1–5% at randomized intervals,
|
|
14398
|
+
* paced to reach ~90% in roughly estimatedTimeSec seconds.
|
|
14399
|
+
* 2. Slow phase (90–99%): crawls 1% at a time with longer random delays,
|
|
14400
|
+
* never reaching 100% on its own.
|
|
14401
|
+
*
|
|
14402
|
+
* When isFinished becomes true, the bar immediately jumps to 100%.
|
|
14403
|
+
* @author Yuen Ler Chow
|
|
14404
|
+
*/
|
|
14405
|
+
/*------------------------------------------------------------------------*/
|
|
14406
|
+
/* ------------------------------ Constants ----------------------------- */
|
|
14407
|
+
/*------------------------------------------------------------------------*/
|
|
14408
|
+
// Percent where the bar switches from fast random jumps to a slow crawl
|
|
14409
|
+
const SLOW_PHASE_START_PERCENT = 90;
|
|
14410
|
+
// Highest percent the bar will reach on its own (before isFinished is true)
|
|
14411
|
+
const MAX_UNFINISHED_PERCENT = 99;
|
|
14412
|
+
// Average step size during the fast phase (uniform random from 1–5)
|
|
14413
|
+
const AVG_FAST_PHASE_STEP = 3;
|
|
14414
|
+
// Minimum delay (ms) between steps during the slow phase
|
|
14415
|
+
const SLOW_PHASE_MIN_DELAY_MS = 2000;
|
|
14416
|
+
// Maximum delay (ms) between steps during the slow phase
|
|
14417
|
+
const SLOW_PHASE_MAX_DELAY_MS = 5000;
|
|
14418
|
+
/* ------------- Actions ------------ */
|
|
14419
|
+
// Types of actions
|
|
14420
|
+
var ActionType;
|
|
14421
|
+
(function (ActionType) {
|
|
14422
|
+
// Advance the progress by a given step
|
|
14423
|
+
ActionType["Advance"] = "Advance";
|
|
14424
|
+
// Set progress to 100% (task complete)
|
|
14425
|
+
ActionType["Complete"] = "Complete";
|
|
14426
|
+
})(ActionType || (ActionType = {}));
|
|
14427
|
+
/**
|
|
14428
|
+
* Reducer that executes actions
|
|
14429
|
+
* @author Yuen Ler Chow
|
|
14430
|
+
* @param state current state
|
|
14431
|
+
* @param action action to execute
|
|
14432
|
+
*/
|
|
14433
|
+
const reducer$1 = (state, action) => {
|
|
14434
|
+
switch (action.type) {
|
|
14435
|
+
case ActionType.Advance: {
|
|
14436
|
+
return Object.assign(Object.assign({}, state), { progress: Math.min(100, state.progress + action.step) });
|
|
14437
|
+
}
|
|
14438
|
+
case ActionType.Complete: {
|
|
14439
|
+
return Object.assign(Object.assign({}, state), { progress: 100 });
|
|
14440
|
+
}
|
|
14441
|
+
default: {
|
|
14442
|
+
return state;
|
|
14443
|
+
}
|
|
14444
|
+
}
|
|
14445
|
+
};
|
|
14446
|
+
/*------------------------------------------------------------------------*/
|
|
14447
|
+
/* ------------------------------ Component ----------------------------- */
|
|
14448
|
+
/*------------------------------------------------------------------------*/
|
|
14449
|
+
const FakeProgressBar = (props) => {
|
|
14450
|
+
/*------------------------------------------------------------------------*/
|
|
14451
|
+
/* -------------------------------- Setup ------------------------------- */
|
|
14452
|
+
/*------------------------------------------------------------------------*/
|
|
14453
|
+
/* -------------- Props ------------- */
|
|
14454
|
+
// Destructure props
|
|
14455
|
+
const { isFinished, estimatedTimeSec = 8, striped, variant, bgVariant, showOutline, size, } = props;
|
|
14456
|
+
/* -------------- State ------------- */
|
|
14457
|
+
// Initial state
|
|
14458
|
+
const initialState = {
|
|
14459
|
+
progress: 0,
|
|
14460
|
+
};
|
|
14461
|
+
// Initialize state
|
|
14462
|
+
const [state, dispatch] = React.useReducer(reducer$1, initialState);
|
|
14463
|
+
// Destructure common state
|
|
14464
|
+
const { progress, } = state;
|
|
14465
|
+
// Convert estimate to milliseconds
|
|
14466
|
+
const estimatedMs = estimatedTimeSec * 1000;
|
|
14467
|
+
// Average interval between updates to reach ~90% in the estimated time
|
|
14468
|
+
const avgIntervalMs = (estimatedMs / SLOW_PHASE_START_PERCENT) * AVG_FAST_PHASE_STEP;
|
|
14469
|
+
/*------------------------------------------------------------------------*/
|
|
14470
|
+
/* ------------------------- Lifecycle Functions ------------------------ */
|
|
14471
|
+
/*------------------------------------------------------------------------*/
|
|
14472
|
+
/**
|
|
14473
|
+
* Animate to 100% when isFinished becomes true
|
|
14474
|
+
* @author Yuen Ler Chow
|
|
14475
|
+
*/
|
|
14476
|
+
React.useEffect(() => {
|
|
14477
|
+
if (isFinished) {
|
|
14478
|
+
dispatch({
|
|
14479
|
+
type: ActionType.Complete,
|
|
14480
|
+
});
|
|
14481
|
+
}
|
|
14482
|
+
}, [isFinished]);
|
|
14483
|
+
/**
|
|
14484
|
+
* Advance the progress in two phases:
|
|
14485
|
+
* 1) Random jumps up to 90%
|
|
14486
|
+
* 2) Slow crawl from 90% to 99%
|
|
14487
|
+
* @author Yuen Ler Chow
|
|
14488
|
+
*/
|
|
14489
|
+
React.useEffect(() => {
|
|
14490
|
+
// Stop if already finished or at max
|
|
14491
|
+
if (isFinished || progress >= MAX_UNFINISHED_PERCENT) {
|
|
14492
|
+
return;
|
|
14493
|
+
}
|
|
14494
|
+
// Determine which phase we are in
|
|
14495
|
+
const inFastPhase = progress < SLOW_PHASE_START_PERCENT;
|
|
14496
|
+
// Default values
|
|
14497
|
+
let delay = avgIntervalMs;
|
|
14498
|
+
let step = 1;
|
|
14499
|
+
if (inFastPhase) {
|
|
14500
|
+
// Randomize delay around the average interval for variability
|
|
14501
|
+
const randomnessMultiplier = 0.5 + (Math.random());
|
|
14502
|
+
delay = avgIntervalMs * randomnessMultiplier;
|
|
14503
|
+
// Randomly move forward by 1-5%, capped at 90%
|
|
14504
|
+
step = Math.min(1 + Math.floor(Math.random() * 5), SLOW_PHASE_START_PERCENT - progress);
|
|
14505
|
+
}
|
|
14506
|
+
else {
|
|
14507
|
+
// Crawl slowly 1% at a time, clamped so we don't exceed 99%
|
|
14508
|
+
delay = SLOW_PHASE_MIN_DELAY_MS + (Math.random() * (SLOW_PHASE_MAX_DELAY_MS - SLOW_PHASE_MIN_DELAY_MS));
|
|
14509
|
+
step = Math.min(1, MAX_UNFINISHED_PERCENT - progress);
|
|
14510
|
+
}
|
|
14511
|
+
// Track whether this effect invocation is still current
|
|
14512
|
+
let cancelled = false;
|
|
14513
|
+
// Wait then dispatch the next progress update
|
|
14514
|
+
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
14515
|
+
yield dceCommonkit.waitMs(delay);
|
|
14516
|
+
if (!cancelled) {
|
|
14517
|
+
dispatch({
|
|
14518
|
+
type: ActionType.Advance,
|
|
14519
|
+
step,
|
|
14520
|
+
});
|
|
14521
|
+
}
|
|
14522
|
+
}))();
|
|
14523
|
+
return () => {
|
|
14524
|
+
cancelled = true;
|
|
14525
|
+
};
|
|
14526
|
+
}, [progress, avgIntervalMs, isFinished]);
|
|
14527
|
+
/*------------------------------------------------------------------------*/
|
|
14528
|
+
/* ------------------------------- Render ------------------------------- */
|
|
14529
|
+
/*------------------------------------------------------------------------*/
|
|
14530
|
+
/*----------------------------------------*/
|
|
14531
|
+
/* --------------- Main UI -------------- */
|
|
14532
|
+
/*----------------------------------------*/
|
|
14533
|
+
return (React__default["default"].createElement(ProgressBar, { percentProgress: progress, striped: striped, variant: variant, bgVariant: bgVariant, showOutline: showOutline, size: size }));
|
|
14534
|
+
};
|
|
14535
|
+
|
|
14392
14536
|
// True if user is on mobile or tablet
|
|
14393
14537
|
let cachedResult;
|
|
14394
14538
|
/**
|
|
@@ -14853,6 +14997,7 @@ exports.Dropdown = Dropdown;
|
|
|
14853
14997
|
exports.DropdownItemType = DropdownItemType$1;
|
|
14854
14998
|
exports.DynamicWord = DynamicWord;
|
|
14855
14999
|
exports.ErrorBox = ErrorBox;
|
|
15000
|
+
exports.FakeProgressBar = FakeProgressBar;
|
|
14856
15001
|
exports.IntelliTable = IntelliTable;
|
|
14857
15002
|
exports.ItemPicker = ItemPicker;
|
|
14858
15003
|
exports.LoadingSpinner = LoadingSpinner;
|