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/esm/index.js
CHANGED
|
@@ -1763,11 +1763,11 @@ var View;
|
|
|
1763
1763
|
})(View || (View = {}));
|
|
1764
1764
|
/* ------------- Actions ------------ */
|
|
1765
1765
|
// Types of actions
|
|
1766
|
-
var ActionType$
|
|
1766
|
+
var ActionType$b;
|
|
1767
1767
|
(function (ActionType) {
|
|
1768
1768
|
// Fix invalid date so it is now in range
|
|
1769
1769
|
ActionType["FixInvalidDate"] = "FixInvalidDate";
|
|
1770
|
-
})(ActionType$
|
|
1770
|
+
})(ActionType$b || (ActionType$b = {}));
|
|
1771
1771
|
/**
|
|
1772
1772
|
* Reducer that executes actions
|
|
1773
1773
|
* @author Gardenia Liu
|
|
@@ -1775,9 +1775,9 @@ var ActionType$a;
|
|
|
1775
1775
|
* @param action action to execute
|
|
1776
1776
|
* @returns updated state
|
|
1777
1777
|
*/
|
|
1778
|
-
const reducer$
|
|
1778
|
+
const reducer$c = (state, action) => {
|
|
1779
1779
|
switch (action.type) {
|
|
1780
|
-
case ActionType$
|
|
1780
|
+
case ActionType$b.FixInvalidDate: {
|
|
1781
1781
|
return Object.assign(Object.assign({}, state), { view: View.DateChooser });
|
|
1782
1782
|
}
|
|
1783
1783
|
default: {
|
|
@@ -1926,7 +1926,7 @@ const SimpleDateChooser = (props) => {
|
|
|
1926
1926
|
: View.DateChooser),
|
|
1927
1927
|
};
|
|
1928
1928
|
// Initialize state
|
|
1929
|
-
const [state, dispatch] = useReducer(reducer$
|
|
1929
|
+
const [state, dispatch] = useReducer(reducer$c, initialState);
|
|
1930
1930
|
// Destructure common state
|
|
1931
1931
|
const { view, } = state;
|
|
1932
1932
|
/*------------------------------------------------------------------------*/
|
|
@@ -1949,7 +1949,7 @@ const SimpleDateChooser = (props) => {
|
|
|
1949
1949
|
onChange(today.month, today.day, today.year);
|
|
1950
1950
|
// Update state
|
|
1951
1951
|
dispatch({
|
|
1952
|
-
type: ActionType$
|
|
1952
|
+
type: ActionType$b.FixInvalidDate,
|
|
1953
1953
|
});
|
|
1954
1954
|
}
|
|
1955
1955
|
});
|
|
@@ -2496,27 +2496,27 @@ const PopPendingMark = (props) => {
|
|
|
2496
2496
|
*/
|
|
2497
2497
|
/* ------------- Actions ------------ */
|
|
2498
2498
|
// Types of actions
|
|
2499
|
-
var ActionType$
|
|
2499
|
+
var ActionType$a;
|
|
2500
2500
|
(function (ActionType) {
|
|
2501
2501
|
// Indicate that the text was recently copied
|
|
2502
2502
|
ActionType["IndicateRecentlyCopied"] = "indicate-recently-copied";
|
|
2503
2503
|
// Clear the status
|
|
2504
2504
|
ActionType["ClearRecentlyCopiedStatus"] = "clear-recently-copied-status";
|
|
2505
|
-
})(ActionType$
|
|
2505
|
+
})(ActionType$a || (ActionType$a = {}));
|
|
2506
2506
|
/**
|
|
2507
2507
|
* Reducer that executes actions
|
|
2508
2508
|
* @author Gabe Abrams
|
|
2509
2509
|
* @param state current state
|
|
2510
2510
|
* @param action action to execute
|
|
2511
2511
|
*/
|
|
2512
|
-
const reducer$
|
|
2512
|
+
const reducer$b = (state, action) => {
|
|
2513
2513
|
switch (action.type) {
|
|
2514
|
-
case ActionType$
|
|
2514
|
+
case ActionType$a.IndicateRecentlyCopied: {
|
|
2515
2515
|
return {
|
|
2516
2516
|
recentlyCopied: true,
|
|
2517
2517
|
};
|
|
2518
2518
|
}
|
|
2519
|
-
case ActionType$
|
|
2519
|
+
case ActionType$a.ClearRecentlyCopiedStatus: {
|
|
2520
2520
|
return {
|
|
2521
2521
|
recentlyCopied: false,
|
|
2522
2522
|
};
|
|
@@ -2542,7 +2542,7 @@ const CopiableBox = (props) => {
|
|
|
2542
2542
|
recentlyCopied: false,
|
|
2543
2543
|
};
|
|
2544
2544
|
// Initialize state
|
|
2545
|
-
const [state, dispatch] = useReducer(reducer$
|
|
2545
|
+
const [state, dispatch] = useReducer(reducer$b, initialState);
|
|
2546
2546
|
// Destructure common state
|
|
2547
2547
|
const { recentlyCopied, } = state;
|
|
2548
2548
|
/*------------------------------------------------------------------------*/
|
|
@@ -2562,13 +2562,13 @@ const CopiableBox = (props) => {
|
|
|
2562
2562
|
}
|
|
2563
2563
|
// Show copied notice
|
|
2564
2564
|
dispatch({
|
|
2565
|
-
type: ActionType$
|
|
2565
|
+
type: ActionType$a.IndicateRecentlyCopied,
|
|
2566
2566
|
});
|
|
2567
2567
|
// Wait a moment
|
|
2568
2568
|
yield waitMs(4000);
|
|
2569
2569
|
// Hide copied notice
|
|
2570
2570
|
dispatch({
|
|
2571
|
-
type: ActionType$
|
|
2571
|
+
type: ActionType$a.ClearRecentlyCopiedStatus,
|
|
2572
2572
|
});
|
|
2573
2573
|
});
|
|
2574
2574
|
/*------------------------------------------------------------------------*/
|
|
@@ -2624,20 +2624,20 @@ const CopiableBox = (props) => {
|
|
|
2624
2624
|
*/
|
|
2625
2625
|
/* ------------- Actions ------------ */
|
|
2626
2626
|
// Types of actions
|
|
2627
|
-
var ActionType$
|
|
2627
|
+
var ActionType$9;
|
|
2628
2628
|
(function (ActionType) {
|
|
2629
2629
|
// Toggle whether a child are being shown
|
|
2630
2630
|
ActionType["ToggleChild"] = "toggle-child";
|
|
2631
|
-
})(ActionType$
|
|
2631
|
+
})(ActionType$9 || (ActionType$9 = {}));
|
|
2632
2632
|
/**
|
|
2633
2633
|
* Reducer that executes actions
|
|
2634
2634
|
* @author Gabe Abrams
|
|
2635
2635
|
* @param state current state
|
|
2636
2636
|
* @param action action to execute
|
|
2637
2637
|
*/
|
|
2638
|
-
const reducer$
|
|
2638
|
+
const reducer$a = (state, action) => {
|
|
2639
2639
|
switch (action.type) {
|
|
2640
|
-
case ActionType$
|
|
2640
|
+
case ActionType$9.ToggleChild: {
|
|
2641
2641
|
return Object.assign(Object.assign({}, state), { childExpanded: Object.assign(Object.assign({}, state.childExpanded), { [String(action.id)]: !state.childExpanded[String(action.id)] }) });
|
|
2642
2642
|
}
|
|
2643
2643
|
default: {
|
|
@@ -2666,7 +2666,7 @@ const NestableItemList = (props) => {
|
|
|
2666
2666
|
childExpanded: initChildExpanded,
|
|
2667
2667
|
};
|
|
2668
2668
|
// Initialize state
|
|
2669
|
-
const [state, dispatch] = useReducer(reducer$
|
|
2669
|
+
const [state, dispatch] = useReducer(reducer$a, initialState);
|
|
2670
2670
|
// Destructure common state
|
|
2671
2671
|
const { childExpanded, } = state;
|
|
2672
2672
|
/*------------------------------------------------------------------------*/
|
|
@@ -2756,7 +2756,7 @@ const NestableItemList = (props) => {
|
|
|
2756
2756
|
backgroundColor: 'transparent',
|
|
2757
2757
|
}, type: "button", onClick: () => {
|
|
2758
2758
|
dispatch({
|
|
2759
|
-
type: ActionType$
|
|
2759
|
+
type: ActionType$9.ToggleChild,
|
|
2760
2760
|
id: item.id,
|
|
2761
2761
|
});
|
|
2762
2762
|
}, "aria-label": `${childExpanded[item.id] ? 'Hide' : 'Show'} items in ${item.name}` },
|
|
@@ -2891,7 +2891,7 @@ var SortType;
|
|
|
2891
2891
|
})(SortType || (SortType = {}));
|
|
2892
2892
|
/* ------------- Actions ------------ */
|
|
2893
2893
|
// Types of actions
|
|
2894
|
-
var ActionType$
|
|
2894
|
+
var ActionType$8;
|
|
2895
2895
|
(function (ActionType) {
|
|
2896
2896
|
// Toggle sort column param
|
|
2897
2897
|
ActionType["ToggleSortColumn"] = "toggle-sort-column";
|
|
@@ -2903,16 +2903,16 @@ var ActionType$7;
|
|
|
2903
2903
|
ActionType["ShowAllColumns"] = "show-all-columns";
|
|
2904
2904
|
// Hide all columns
|
|
2905
2905
|
ActionType["HideAllColumns"] = "hide-all-columns";
|
|
2906
|
-
})(ActionType$
|
|
2906
|
+
})(ActionType$8 || (ActionType$8 = {}));
|
|
2907
2907
|
/**
|
|
2908
2908
|
* Reducer that executes actions
|
|
2909
2909
|
* @author Gabe Abrams
|
|
2910
2910
|
* @param state current state
|
|
2911
2911
|
* @param action action to execute
|
|
2912
2912
|
*/
|
|
2913
|
-
const reducer$
|
|
2913
|
+
const reducer$9 = (state, action) => {
|
|
2914
2914
|
switch (action.type) {
|
|
2915
|
-
case ActionType$
|
|
2915
|
+
case ActionType$8.ToggleSortColumn: {
|
|
2916
2916
|
if (action.param !== state.sortColumnParam) {
|
|
2917
2917
|
// Different column param
|
|
2918
2918
|
return Object.assign(Object.assign({}, state), { sortColumnParam: action.param, sortType: SortType.Ascending });
|
|
@@ -2924,22 +2924,22 @@ const reducer$8 = (state, action) => {
|
|
|
2924
2924
|
// Stop sorting by column
|
|
2925
2925
|
return Object.assign(Object.assign({}, state), { sortColumnParam: undefined, sortType: SortType.Ascending });
|
|
2926
2926
|
}
|
|
2927
|
-
case ActionType$
|
|
2927
|
+
case ActionType$8.UpdateColumnVisibility: {
|
|
2928
2928
|
const { columnVisibilityMap } = state;
|
|
2929
2929
|
columnVisibilityMap[action.param] = action.visible;
|
|
2930
2930
|
return Object.assign(Object.assign({}, state), { columnVisibilityMap });
|
|
2931
2931
|
}
|
|
2932
|
-
case ActionType$
|
|
2932
|
+
case ActionType$8.ToggleColVisCusModalVisibility: {
|
|
2933
2933
|
return Object.assign(Object.assign({}, state), { columnVisibilityCustomizationModalVisible: !state.columnVisibilityCustomizationModalVisible });
|
|
2934
2934
|
}
|
|
2935
|
-
case ActionType$
|
|
2935
|
+
case ActionType$8.ShowAllColumns: {
|
|
2936
2936
|
const { columnVisibilityMap } = state;
|
|
2937
2937
|
Object.keys(columnVisibilityMap).forEach((param) => {
|
|
2938
2938
|
columnVisibilityMap[param] = true;
|
|
2939
2939
|
});
|
|
2940
2940
|
return Object.assign(Object.assign({}, state), { columnVisibilityMap });
|
|
2941
2941
|
}
|
|
2942
|
-
case ActionType$
|
|
2942
|
+
case ActionType$8.HideAllColumns: {
|
|
2943
2943
|
const { columnVisibilityMap } = state;
|
|
2944
2944
|
Object.keys(columnVisibilityMap).forEach((param) => {
|
|
2945
2945
|
columnVisibilityMap[param] = false;
|
|
@@ -2986,7 +2986,7 @@ const IntelliTable = (props) => {
|
|
|
2986
2986
|
columnVisibilityCustomizationModalVisible: false,
|
|
2987
2987
|
};
|
|
2988
2988
|
// Initialize state
|
|
2989
|
-
const [state, dispatch] = useReducer(reducer$
|
|
2989
|
+
const [state, dispatch] = useReducer(reducer$9, initialState);
|
|
2990
2990
|
// Destructure common state
|
|
2991
2991
|
const { sortColumnParam, sortType, columnVisibilityMap, columnVisibilityCustomizationModalVisible, } = state;
|
|
2992
2992
|
/*------------------------------------------------------------------------*/
|
|
@@ -3009,13 +3009,13 @@ const IntelliTable = (props) => {
|
|
|
3009
3009
|
return alert('Choose at least one column', 'To continue, you have to choose at least one column to show');
|
|
3010
3010
|
}
|
|
3011
3011
|
dispatch({
|
|
3012
|
-
type: ActionType$
|
|
3012
|
+
type: ActionType$8.ToggleColVisCusModalVisibility,
|
|
3013
3013
|
});
|
|
3014
3014
|
}, okayVariant: Variant$1.Light },
|
|
3015
3015
|
columns.map((column) => {
|
|
3016
3016
|
return (React__default.createElement(CheckboxButton, { key: column.param, id: `IntelliTable-${id}-toggle-visibility-${column.param}`, className: "mb-2", text: column.title, onChanged: (checked) => {
|
|
3017
3017
|
dispatch({
|
|
3018
|
-
type: ActionType$
|
|
3018
|
+
type: ActionType$8.UpdateColumnVisibility,
|
|
3019
3019
|
param: column.param,
|
|
3020
3020
|
visible: checked,
|
|
3021
3021
|
});
|
|
@@ -3024,12 +3024,12 @@ const IntelliTable = (props) => {
|
|
|
3024
3024
|
React__default.createElement("div", { className: "mt-3" }, "Or you can:"),
|
|
3025
3025
|
React__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: () => {
|
|
3026
3026
|
dispatch({
|
|
3027
|
-
type: ActionType$
|
|
3027
|
+
type: ActionType$8.ShowAllColumns,
|
|
3028
3028
|
});
|
|
3029
3029
|
} }, "Select All"),
|
|
3030
3030
|
React__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: () => {
|
|
3031
3031
|
dispatch({
|
|
3032
|
-
type: ActionType$
|
|
3032
|
+
type: ActionType$8.HideAllColumns,
|
|
3033
3033
|
});
|
|
3034
3034
|
} }, "Deselect All")));
|
|
3035
3035
|
}
|
|
@@ -3080,7 +3080,7 @@ const IntelliTable = (props) => {
|
|
|
3080
3080
|
React__default.createElement("div", null,
|
|
3081
3081
|
React__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: () => {
|
|
3082
3082
|
dispatch({
|
|
3083
|
-
type: ActionType$
|
|
3083
|
+
type: ActionType$8.ToggleSortColumn,
|
|
3084
3084
|
param: column.param,
|
|
3085
3085
|
});
|
|
3086
3086
|
} },
|
|
@@ -3269,7 +3269,7 @@ const IntelliTable = (props) => {
|
|
|
3269
3269
|
React__default.createElement(CSVDownloadButton, { "aria-label": `download data as csv for ${title}`, id: `IntelliTable-${id}-download-as-csv`, filename: filename, csv: csv }),
|
|
3270
3270
|
React__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: () => {
|
|
3271
3271
|
dispatch({
|
|
3272
|
-
type: ActionType$
|
|
3272
|
+
type: ActionType$8.ToggleColVisCusModalVisibility,
|
|
3273
3273
|
});
|
|
3274
3274
|
} },
|
|
3275
3275
|
"Show/Hide Cols",
|
|
@@ -3692,7 +3692,7 @@ const genHumanReadableName = (machineReadableName) => {
|
|
|
3692
3692
|
};
|
|
3693
3693
|
/* ------------- Actions ------------ */
|
|
3694
3694
|
// Types of actions
|
|
3695
|
-
var ActionType$
|
|
3695
|
+
var ActionType$7;
|
|
3696
3696
|
(function (ActionType) {
|
|
3697
3697
|
// Show the loading bar
|
|
3698
3698
|
ActionType["StartLoading"] = "start-loading";
|
|
@@ -3722,57 +3722,57 @@ var ActionType$6;
|
|
|
3722
3722
|
ActionType["SetPageNumber"] = "set-page-number";
|
|
3723
3723
|
// Reset user made filter change indicator
|
|
3724
3724
|
ActionType["ResetUserMadeFilterChange"] = "reset-user-made-filter-change";
|
|
3725
|
-
})(ActionType$
|
|
3725
|
+
})(ActionType$7 || (ActionType$7 = {}));
|
|
3726
3726
|
/**
|
|
3727
3727
|
* Reducer that executes actions
|
|
3728
3728
|
* @author Gabe Abrams
|
|
3729
3729
|
* @param state current state
|
|
3730
3730
|
* @param action action to execute
|
|
3731
3731
|
*/
|
|
3732
|
-
const reducer$
|
|
3732
|
+
const reducer$8 = (state, action) => {
|
|
3733
3733
|
switch (action.type) {
|
|
3734
|
-
case ActionType$
|
|
3734
|
+
case ActionType$7.StartLoading: {
|
|
3735
3735
|
return Object.assign(Object.assign({}, state), { loading: true });
|
|
3736
3736
|
}
|
|
3737
|
-
case ActionType$
|
|
3737
|
+
case ActionType$7.FinishLoading: {
|
|
3738
3738
|
return Object.assign(Object.assign({}, state), { loading: false, logs: action.logs });
|
|
3739
3739
|
}
|
|
3740
|
-
case ActionType$
|
|
3740
|
+
case ActionType$7.ToggleFilterDrawer: {
|
|
3741
3741
|
return Object.assign(Object.assign({}, state), { expandedFilterDrawer: (state.expandedFilterDrawer === action.filterDrawer
|
|
3742
3742
|
? undefined // hide
|
|
3743
3743
|
: action.filterDrawer) });
|
|
3744
3744
|
}
|
|
3745
|
-
case ActionType$
|
|
3745
|
+
case ActionType$7.HideFilterDrawer: {
|
|
3746
3746
|
return Object.assign(Object.assign({}, state), { expandedFilterDrawer: undefined });
|
|
3747
3747
|
}
|
|
3748
|
-
case ActionType$
|
|
3748
|
+
case ActionType$7.ResetFilters: {
|
|
3749
3749
|
return Object.assign(Object.assign({}, state), { pendingDateFilterState: action.initDateFilterState, pendingContextFilterState: action.initContextFilterState, pendingTagFilterState: action.initTagFilterState, pendingActionErrorFilterState: action.initActionErrorFilterState, pendingAdvancedFilterState: action.initAdvancedFilterState, pageNumber: 1 });
|
|
3750
3750
|
}
|
|
3751
|
-
case ActionType$
|
|
3751
|
+
case ActionType$7.UpdateDateFilterState: {
|
|
3752
3752
|
return Object.assign(Object.assign({}, state), { pendingDateFilterState: action.dateFilterState, userMadeFilterChange: true });
|
|
3753
3753
|
}
|
|
3754
|
-
case ActionType$
|
|
3754
|
+
case ActionType$7.UpdateContextFilterState: {
|
|
3755
3755
|
return Object.assign(Object.assign({}, state), { pendingContextFilterState: action.contextFilterState, userMadeFilterChange: true });
|
|
3756
3756
|
}
|
|
3757
|
-
case ActionType$
|
|
3757
|
+
case ActionType$7.UpdateTagFilterState: {
|
|
3758
3758
|
return Object.assign(Object.assign({}, state), { pendingTagFilterState: action.tagFilterState, userMadeFilterChange: true });
|
|
3759
3759
|
}
|
|
3760
|
-
case ActionType$
|
|
3760
|
+
case ActionType$7.UpdateActionErrorFilterState: {
|
|
3761
3761
|
return Object.assign(Object.assign({}, state), { pendingActionErrorFilterState: action.actionErrorFilterState, userMadeFilterChange: true });
|
|
3762
3762
|
}
|
|
3763
|
-
case ActionType$
|
|
3763
|
+
case ActionType$7.UpdateAdvancedFilterState: {
|
|
3764
3764
|
return Object.assign(Object.assign({}, state), { pendingAdvancedFilterState: action.advancedFilterState, userMadeFilterChange: true });
|
|
3765
3765
|
}
|
|
3766
|
-
case ActionType$
|
|
3766
|
+
case ActionType$7.SetHasAnotherPage: {
|
|
3767
3767
|
return Object.assign(Object.assign({}, state), { hasAnotherPage: action.hasAnotherPage });
|
|
3768
3768
|
}
|
|
3769
|
-
case ActionType$
|
|
3769
|
+
case ActionType$7.SetNumPages: {
|
|
3770
3770
|
return Object.assign(Object.assign({}, state), { numPages: action.numPages });
|
|
3771
3771
|
}
|
|
3772
|
-
case ActionType$
|
|
3772
|
+
case ActionType$7.SetPageNumber: {
|
|
3773
3773
|
return Object.assign(Object.assign({}, state), { pageNumber: action.pageNumber });
|
|
3774
3774
|
}
|
|
3775
|
-
case ActionType$
|
|
3775
|
+
case ActionType$7.ResetUserMadeFilterChange: {
|
|
3776
3776
|
return Object.assign(Object.assign({}, state), { userMadeFilterChange: false });
|
|
3777
3777
|
}
|
|
3778
3778
|
default: {
|
|
@@ -3905,7 +3905,7 @@ const LogReviewer = (props) => {
|
|
|
3905
3905
|
userMadeFilterChange: false,
|
|
3906
3906
|
};
|
|
3907
3907
|
// Initialize state
|
|
3908
|
-
const [state, dispatch] = useReducer(reducer$
|
|
3908
|
+
const [state, dispatch] = useReducer(reducer$8, initialState);
|
|
3909
3909
|
// Destructure common state
|
|
3910
3910
|
const { loading, logs, expandedFilterDrawer, pendingDateFilterState, pendingContextFilterState, pendingTagFilterState, pendingActionErrorFilterState, pendingAdvancedFilterState, pageNumber, numPages, userMadeFilterChange, } = state;
|
|
3911
3911
|
/* -------------- Refs -------------- */
|
|
@@ -3931,7 +3931,7 @@ const LogReviewer = (props) => {
|
|
|
3931
3931
|
const fetchLogs = (opts) => __awaiter(void 0, void 0, void 0, function* () {
|
|
3932
3932
|
const { filters, pageNum, filtersChanged, } = opts;
|
|
3933
3933
|
dispatch({
|
|
3934
|
-
type: ActionType$
|
|
3934
|
+
type: ActionType$7.StartLoading,
|
|
3935
3935
|
});
|
|
3936
3936
|
try {
|
|
3937
3937
|
// Send filters to the server
|
|
@@ -3948,23 +3948,23 @@ const LogReviewer = (props) => {
|
|
|
3948
3948
|
});
|
|
3949
3949
|
fetchedLogs = fetchedLogs.concat(response.items);
|
|
3950
3950
|
dispatch({
|
|
3951
|
-
type: ActionType$
|
|
3951
|
+
type: ActionType$7.SetHasAnotherPage,
|
|
3952
3952
|
hasAnotherPage: response.hasAnotherPage,
|
|
3953
3953
|
});
|
|
3954
3954
|
if (filtersChanged && response.numPages !== undefined) {
|
|
3955
3955
|
dispatch({
|
|
3956
|
-
type: ActionType$
|
|
3956
|
+
type: ActionType$7.SetNumPages,
|
|
3957
3957
|
numPages: response.numPages,
|
|
3958
3958
|
});
|
|
3959
3959
|
}
|
|
3960
3960
|
// Update logs in state
|
|
3961
3961
|
dispatch({
|
|
3962
|
-
type: ActionType$
|
|
3962
|
+
type: ActionType$7.FinishLoading,
|
|
3963
3963
|
logs: fetchedLogs,
|
|
3964
3964
|
});
|
|
3965
3965
|
// Update page number
|
|
3966
3966
|
dispatch({
|
|
3967
|
-
type: ActionType$
|
|
3967
|
+
type: ActionType$7.SetPageNumber,
|
|
3968
3968
|
pageNumber: pageNum,
|
|
3969
3969
|
});
|
|
3970
3970
|
}
|
|
@@ -4023,7 +4023,7 @@ const LogReviewer = (props) => {
|
|
|
4023
4023
|
React__default.createElement("div", { className: "LogReviewer-filter-toggle-buttons alert alert-secondary p-2 m-0" },
|
|
4024
4024
|
React__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: () => {
|
|
4025
4025
|
dispatch({
|
|
4026
|
-
type: ActionType$
|
|
4026
|
+
type: ActionType$7.ToggleFilterDrawer,
|
|
4027
4027
|
filterDrawer: FilterDrawer.Date,
|
|
4028
4028
|
});
|
|
4029
4029
|
} },
|
|
@@ -4031,7 +4031,7 @@ const LogReviewer = (props) => {
|
|
|
4031
4031
|
"Date"),
|
|
4032
4032
|
React__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: () => {
|
|
4033
4033
|
dispatch({
|
|
4034
|
-
type: ActionType$
|
|
4034
|
+
type: ActionType$7.ToggleFilterDrawer,
|
|
4035
4035
|
filterDrawer: FilterDrawer.Context,
|
|
4036
4036
|
});
|
|
4037
4037
|
} },
|
|
@@ -4039,7 +4039,7 @@ const LogReviewer = (props) => {
|
|
|
4039
4039
|
"Context"),
|
|
4040
4040
|
(LogMetadata.Tag && Object.keys(LogMetadata.Tag).length > 0) && (React__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: () => {
|
|
4041
4041
|
dispatch({
|
|
4042
|
-
type: ActionType$
|
|
4042
|
+
type: ActionType$7.ToggleFilterDrawer,
|
|
4043
4043
|
filterDrawer: FilterDrawer.Tag,
|
|
4044
4044
|
});
|
|
4045
4045
|
} },
|
|
@@ -4047,7 +4047,7 @@ const LogReviewer = (props) => {
|
|
|
4047
4047
|
"Tag")),
|
|
4048
4048
|
React__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: () => {
|
|
4049
4049
|
dispatch({
|
|
4050
|
-
type: ActionType$
|
|
4050
|
+
type: ActionType$7.ToggleFilterDrawer,
|
|
4051
4051
|
filterDrawer: FilterDrawer.Action,
|
|
4052
4052
|
});
|
|
4053
4053
|
} },
|
|
@@ -4055,7 +4055,7 @@ const LogReviewer = (props) => {
|
|
|
4055
4055
|
"Action"),
|
|
4056
4056
|
React__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: () => {
|
|
4057
4057
|
dispatch({
|
|
4058
|
-
type: ActionType$
|
|
4058
|
+
type: ActionType$7.ToggleFilterDrawer,
|
|
4059
4059
|
filterDrawer: FilterDrawer.Advanced,
|
|
4060
4060
|
});
|
|
4061
4061
|
} },
|
|
@@ -4084,7 +4084,7 @@ const LogReviewer = (props) => {
|
|
|
4084
4084
|
filtersChanged: true,
|
|
4085
4085
|
});
|
|
4086
4086
|
dispatch({
|
|
4087
|
-
type: ActionType$
|
|
4087
|
+
type: ActionType$7.ResetFilters,
|
|
4088
4088
|
initActionErrorFilterState,
|
|
4089
4089
|
initAdvancedFilterState,
|
|
4090
4090
|
initContextFilterState,
|
|
@@ -4092,7 +4092,7 @@ const LogReviewer = (props) => {
|
|
|
4092
4092
|
initTagFilterState,
|
|
4093
4093
|
});
|
|
4094
4094
|
dispatch({
|
|
4095
|
-
type: ActionType$
|
|
4095
|
+
type: ActionType$7.HideFilterDrawer,
|
|
4096
4096
|
});
|
|
4097
4097
|
} },
|
|
4098
4098
|
React__default.createElement(FontAwesomeIcon, { icon: faTimes }),
|
|
@@ -4100,11 +4100,11 @@ const LogReviewer = (props) => {
|
|
|
4100
4100
|
"Reset"),
|
|
4101
4101
|
userMadeFilterChange && (React__default.createElement("button", { type: "button", id: "LogReviewer-submit-filters-button", className: "btn btn-primary ms-2", "aria-label": "submit filters", onClick: () => {
|
|
4102
4102
|
dispatch({
|
|
4103
|
-
type: ActionType$
|
|
4103
|
+
type: ActionType$7.HideFilterDrawer,
|
|
4104
4104
|
});
|
|
4105
4105
|
// Reset user made filter change indicator
|
|
4106
4106
|
dispatch({
|
|
4107
|
-
type: ActionType$
|
|
4107
|
+
type: ActionType$7.ResetUserMadeFilterChange,
|
|
4108
4108
|
});
|
|
4109
4109
|
// Save active filters
|
|
4110
4110
|
// Deep clone the pending filter states to avoid any reference issues
|
|
@@ -4139,7 +4139,7 @@ const LogReviewer = (props) => {
|
|
|
4139
4139
|
React__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) => {
|
|
4140
4140
|
const newDateFilterState = Object.assign(Object.assign({}, pendingDateFilterState), { startDate: { month, day, year } });
|
|
4141
4141
|
dispatch({
|
|
4142
|
-
type: ActionType$
|
|
4142
|
+
type: ActionType$7.UpdateDateFilterState,
|
|
4143
4143
|
dateFilterState: newDateFilterState,
|
|
4144
4144
|
});
|
|
4145
4145
|
} }),
|
|
@@ -4157,7 +4157,7 @@ const LogReviewer = (props) => {
|
|
|
4157
4157
|
}
|
|
4158
4158
|
const newDateFilterState = Object.assign(Object.assign({}, pendingDateFilterState), { endDate: { month, day, year } });
|
|
4159
4159
|
dispatch({
|
|
4160
|
-
type: ActionType$
|
|
4160
|
+
type: ActionType$7.UpdateDateFilterState,
|
|
4161
4161
|
dateFilterState: newDateFilterState,
|
|
4162
4162
|
});
|
|
4163
4163
|
} })));
|
|
@@ -4250,7 +4250,7 @@ const LogReviewer = (props) => {
|
|
|
4250
4250
|
});
|
|
4251
4251
|
// Update state
|
|
4252
4252
|
dispatch({
|
|
4253
|
-
type: ActionType$
|
|
4253
|
+
type: ActionType$7.UpdateContextFilterState,
|
|
4254
4254
|
contextFilterState: newContextFilterState,
|
|
4255
4255
|
});
|
|
4256
4256
|
} }));
|
|
@@ -4265,7 +4265,7 @@ const LogReviewer = (props) => {
|
|
|
4265
4265
|
return (React__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) => {
|
|
4266
4266
|
const newTagFilterState = Object.assign(Object.assign({}, pendingTagFilterState), { [tag]: checked });
|
|
4267
4267
|
dispatch({
|
|
4268
|
-
type: ActionType$
|
|
4268
|
+
type: ActionType$7.UpdateTagFilterState,
|
|
4269
4269
|
tagFilterState: newTagFilterState,
|
|
4270
4270
|
});
|
|
4271
4271
|
}, checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light }));
|
|
@@ -4278,21 +4278,21 @@ const LogReviewer = (props) => {
|
|
|
4278
4278
|
React__default.createElement(RadioButton, { id: "LogReviewer-type-all", text: "All Logs", onSelected: () => {
|
|
4279
4279
|
const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { type: undefined });
|
|
4280
4280
|
dispatch({
|
|
4281
|
-
type: ActionType$
|
|
4281
|
+
type: ActionType$7.UpdateActionErrorFilterState,
|
|
4282
4282
|
actionErrorFilterState: newActionErrorFilterState,
|
|
4283
4283
|
});
|
|
4284
4284
|
}, ariaLabel: "show logs of all types", selected: pendingActionErrorFilterState.type === undefined, unselectedVariant: Variant$1.Light }),
|
|
4285
4285
|
React__default.createElement(RadioButton, { id: "LogReviewer-type-action-only", text: "Action Logs Only", onSelected: () => {
|
|
4286
4286
|
const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { type: LogType.Action });
|
|
4287
4287
|
dispatch({
|
|
4288
|
-
type: ActionType$
|
|
4288
|
+
type: ActionType$7.UpdateActionErrorFilterState,
|
|
4289
4289
|
actionErrorFilterState: newActionErrorFilterState,
|
|
4290
4290
|
});
|
|
4291
4291
|
}, ariaLabel: "only show action logs", selected: pendingActionErrorFilterState.type === LogType.Action, unselectedVariant: Variant$1.Light }),
|
|
4292
4292
|
React__default.createElement(RadioButton, { id: "LogReviewer-type-error-only", text: "Action Error Only", onSelected: () => {
|
|
4293
4293
|
const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { type: LogType.Error });
|
|
4294
4294
|
dispatch({
|
|
4295
|
-
type: ActionType$
|
|
4295
|
+
type: ActionType$7.UpdateActionErrorFilterState,
|
|
4296
4296
|
actionErrorFilterState: newActionErrorFilterState,
|
|
4297
4297
|
});
|
|
4298
4298
|
}, ariaLabel: "only show error logs", selected: pendingActionErrorFilterState.type === LogType.Error, noMarginOnRight: true, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light })),
|
|
@@ -4304,7 +4304,7 @@ const LogReviewer = (props) => {
|
|
|
4304
4304
|
return (React__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) => {
|
|
4305
4305
|
const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { action: Object.assign(Object.assign({}, pendingActionErrorFilterState.action), { [action]: checked }) });
|
|
4306
4306
|
dispatch({
|
|
4307
|
-
type: ActionType$
|
|
4307
|
+
type: ActionType$7.UpdateActionErrorFilterState,
|
|
4308
4308
|
actionErrorFilterState: newActionErrorFilterState,
|
|
4309
4309
|
});
|
|
4310
4310
|
}, checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light }));
|
|
@@ -4315,7 +4315,7 @@ const LogReviewer = (props) => {
|
|
|
4315
4315
|
return (React__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) => {
|
|
4316
4316
|
const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { target: Object.assign(Object.assign({}, pendingActionErrorFilterState.target), { [target]: checked }) });
|
|
4317
4317
|
dispatch({
|
|
4318
|
-
type: ActionType$
|
|
4318
|
+
type: ActionType$7.UpdateActionErrorFilterState,
|
|
4319
4319
|
actionErrorFilterState: newActionErrorFilterState,
|
|
4320
4320
|
});
|
|
4321
4321
|
}, checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light }));
|
|
@@ -4327,7 +4327,7 @@ const LogReviewer = (props) => {
|
|
|
4327
4327
|
React__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) => {
|
|
4328
4328
|
const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { errorMessage: e.target.value });
|
|
4329
4329
|
dispatch({
|
|
4330
|
-
type: ActionType$
|
|
4330
|
+
type: ActionType$7.UpdateActionErrorFilterState,
|
|
4331
4331
|
actionErrorFilterState: newActionErrorFilterState,
|
|
4332
4332
|
});
|
|
4333
4333
|
} })),
|
|
@@ -4338,7 +4338,7 @@ const LogReviewer = (props) => {
|
|
|
4338
4338
|
.trim()
|
|
4339
4339
|
.toUpperCase()) });
|
|
4340
4340
|
dispatch({
|
|
4341
|
-
type: ActionType$
|
|
4341
|
+
type: ActionType$7.UpdateActionErrorFilterState,
|
|
4342
4342
|
actionErrorFilterState: newActionErrorFilterState,
|
|
4343
4343
|
});
|
|
4344
4344
|
} }))))));
|
|
@@ -4352,7 +4352,7 @@ const LogReviewer = (props) => {
|
|
|
4352
4352
|
React__default.createElement("input", { type: "text", className: "form-control", "aria-label": "query for user first name", value: pendingAdvancedFilterState.userFirstName, placeholder: "e.g. Divardo", onChange: (e) => {
|
|
4353
4353
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { userFirstName: e.target.value });
|
|
4354
4354
|
dispatch({
|
|
4355
|
-
type: ActionType$
|
|
4355
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4356
4356
|
advancedFilterState: newAdvancedFilterState,
|
|
4357
4357
|
});
|
|
4358
4358
|
} })),
|
|
@@ -4361,7 +4361,7 @@ const LogReviewer = (props) => {
|
|
|
4361
4361
|
React__default.createElement("input", { type: "text", className: "form-control", "aria-label": "query for user last name", value: pendingAdvancedFilterState.userLastName, placeholder: "e.g. Calicci", onChange: (e) => {
|
|
4362
4362
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { userLastName: e.target.value });
|
|
4363
4363
|
dispatch({
|
|
4364
|
-
type: ActionType$
|
|
4364
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4365
4365
|
advancedFilterState: newAdvancedFilterState,
|
|
4366
4366
|
});
|
|
4367
4367
|
} })),
|
|
@@ -4371,7 +4371,7 @@ const LogReviewer = (props) => {
|
|
|
4371
4371
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { userEmail: ((e.target.value)
|
|
4372
4372
|
.trim()) });
|
|
4373
4373
|
dispatch({
|
|
4374
|
-
type: ActionType$
|
|
4374
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4375
4375
|
advancedFilterState: newAdvancedFilterState,
|
|
4376
4376
|
});
|
|
4377
4377
|
} })),
|
|
@@ -4384,7 +4384,7 @@ const LogReviewer = (props) => {
|
|
|
4384
4384
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { userId: ((e.target.value)
|
|
4385
4385
|
.trim()) });
|
|
4386
4386
|
dispatch({
|
|
4387
|
-
type: ActionType$
|
|
4387
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4388
4388
|
advancedFilterState: newAdvancedFilterState,
|
|
4389
4389
|
});
|
|
4390
4390
|
}
|
|
@@ -4393,21 +4393,21 @@ const LogReviewer = (props) => {
|
|
|
4393
4393
|
React__default.createElement(CheckboxButton, { text: "Students", onChanged: (checked) => {
|
|
4394
4394
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { includeLearners: checked });
|
|
4395
4395
|
dispatch({
|
|
4396
|
-
type: ActionType$
|
|
4396
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4397
4397
|
advancedFilterState: newAdvancedFilterState,
|
|
4398
4398
|
});
|
|
4399
4399
|
}, checked: pendingAdvancedFilterState.includeLearners, ariaLabel: "show logs from students", checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light }),
|
|
4400
4400
|
React__default.createElement(CheckboxButton, { text: "Teaching Team Members", onChanged: (checked) => {
|
|
4401
4401
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { includeTTMs: checked });
|
|
4402
4402
|
dispatch({
|
|
4403
|
-
type: ActionType$
|
|
4403
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4404
4404
|
advancedFilterState: newAdvancedFilterState,
|
|
4405
4405
|
});
|
|
4406
4406
|
}, checked: pendingAdvancedFilterState.includeTTMs, ariaLabel: "show logs from teaching team members", checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light }),
|
|
4407
4407
|
React__default.createElement(CheckboxButton, { text: "Admins", onChanged: (checked) => {
|
|
4408
4408
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { includeAdmins: checked });
|
|
4409
4409
|
dispatch({
|
|
4410
|
-
type: ActionType$
|
|
4410
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4411
4411
|
advancedFilterState: newAdvancedFilterState,
|
|
4412
4412
|
});
|
|
4413
4413
|
}, checked: pendingAdvancedFilterState.includeAdmins, ariaLabel: "show logs from admins", checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light }))),
|
|
@@ -4417,7 +4417,7 @@ const LogReviewer = (props) => {
|
|
|
4417
4417
|
React__default.createElement("input", { type: "text", className: "form-control", "aria-label": "query for course name", value: pendingAdvancedFilterState.courseName, placeholder: "e.g. GLC 200", onChange: (e) => {
|
|
4418
4418
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { courseName: e.target.value });
|
|
4419
4419
|
dispatch({
|
|
4420
|
-
type: ActionType$
|
|
4420
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4421
4421
|
advancedFilterState: newAdvancedFilterState,
|
|
4422
4422
|
});
|
|
4423
4423
|
} })),
|
|
@@ -4430,7 +4430,7 @@ const LogReviewer = (props) => {
|
|
|
4430
4430
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { courseId: ((e.target.value)
|
|
4431
4431
|
.trim()) });
|
|
4432
4432
|
dispatch({
|
|
4433
|
-
type: ActionType$
|
|
4433
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4434
4434
|
advancedFilterState: newAdvancedFilterState,
|
|
4435
4435
|
});
|
|
4436
4436
|
}
|
|
@@ -4440,21 +4440,21 @@ const LogReviewer = (props) => {
|
|
|
4440
4440
|
React__default.createElement(RadioButton, { text: "All Devices", ariaLabel: "show logs from all devices", selected: pendingAdvancedFilterState.isMobile === undefined, onSelected: () => {
|
|
4441
4441
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { isMobile: undefined });
|
|
4442
4442
|
dispatch({
|
|
4443
|
-
type: ActionType$
|
|
4443
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4444
4444
|
advancedFilterState: newAdvancedFilterState,
|
|
4445
4445
|
});
|
|
4446
4446
|
}, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light }),
|
|
4447
4447
|
React__default.createElement(RadioButton, { text: "Mobile Only", ariaLabel: "show logs from mobile devices", selected: pendingAdvancedFilterState.isMobile === true, onSelected: () => {
|
|
4448
4448
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { isMobile: true });
|
|
4449
4449
|
dispatch({
|
|
4450
|
-
type: ActionType$
|
|
4450
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4451
4451
|
advancedFilterState: newAdvancedFilterState,
|
|
4452
4452
|
});
|
|
4453
4453
|
}, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light }),
|
|
4454
4454
|
React__default.createElement(RadioButton, { text: "Desktop Only", ariaLabel: "show logs from desktop devices", selected: pendingAdvancedFilterState.isMobile === false, onSelected: () => {
|
|
4455
4455
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { isMobile: false });
|
|
4456
4456
|
dispatch({
|
|
4457
|
-
type: ActionType$
|
|
4457
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4458
4458
|
advancedFilterState: newAdvancedFilterState,
|
|
4459
4459
|
});
|
|
4460
4460
|
}, noMarginOnRight: true, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light }))),
|
|
@@ -4463,21 +4463,21 @@ const LogReviewer = (props) => {
|
|
|
4463
4463
|
React__default.createElement(RadioButton, { text: "Both", ariaLabel: "show logs from all sources", selected: pendingAdvancedFilterState.source === undefined, onSelected: () => {
|
|
4464
4464
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { source: undefined });
|
|
4465
4465
|
dispatch({
|
|
4466
|
-
type: ActionType$
|
|
4466
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4467
4467
|
advancedFilterState: newAdvancedFilterState,
|
|
4468
4468
|
});
|
|
4469
4469
|
}, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light }),
|
|
4470
4470
|
React__default.createElement(RadioButton, { text: "Client Only", ariaLabel: "show logs from client source", selected: pendingAdvancedFilterState.source === LogSource.Client, onSelected: () => {
|
|
4471
4471
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { source: LogSource.Client });
|
|
4472
4472
|
dispatch({
|
|
4473
|
-
type: ActionType$
|
|
4473
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4474
4474
|
advancedFilterState: newAdvancedFilterState,
|
|
4475
4475
|
});
|
|
4476
4476
|
}, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light }),
|
|
4477
4477
|
React__default.createElement(RadioButton, { text: "Server Only", ariaLabel: "show logs from server source", selected: pendingAdvancedFilterState.source === LogSource.Server, onSelected: () => {
|
|
4478
4478
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { source: LogSource.Server });
|
|
4479
4479
|
dispatch({
|
|
4480
|
-
type: ActionType$
|
|
4480
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4481
4481
|
advancedFilterState: newAdvancedFilterState,
|
|
4482
4482
|
});
|
|
4483
4483
|
}, noMarginOnRight: true, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light })),
|
|
@@ -4488,7 +4488,7 @@ const LogReviewer = (props) => {
|
|
|
4488
4488
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { routePath: ((e.target.value)
|
|
4489
4489
|
.trim()) });
|
|
4490
4490
|
dispatch({
|
|
4491
|
-
type: ActionType$
|
|
4491
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4492
4492
|
advancedFilterState: newAdvancedFilterState,
|
|
4493
4493
|
});
|
|
4494
4494
|
} })),
|
|
@@ -4498,7 +4498,7 @@ const LogReviewer = (props) => {
|
|
|
4498
4498
|
const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { routeTemplate: ((e.target.value)
|
|
4499
4499
|
.trim()) });
|
|
4500
4500
|
dispatch({
|
|
4501
|
-
type: ActionType$
|
|
4501
|
+
type: ActionType$7.UpdateAdvancedFilterState,
|
|
4502
4502
|
advancedFilterState: newAdvancedFilterState,
|
|
4503
4503
|
});
|
|
4504
4504
|
} })))))));
|
|
@@ -12595,11 +12595,11 @@ var CreatableSelect$1 = CreatableSelect;
|
|
|
12595
12595
|
*/
|
|
12596
12596
|
/* ------------- Actions ------------ */
|
|
12597
12597
|
// Types of actions
|
|
12598
|
-
var ActionType$
|
|
12598
|
+
var ActionType$6;
|
|
12599
12599
|
(function (ActionType) {
|
|
12600
12600
|
// Update the input value
|
|
12601
12601
|
ActionType["SetInputValue"] = "SetInputValue";
|
|
12602
|
-
})(ActionType$
|
|
12602
|
+
})(ActionType$6 || (ActionType$6 = {}));
|
|
12603
12603
|
/**
|
|
12604
12604
|
* Reducer that executes actions
|
|
12605
12605
|
* @author Yuen Ler Chow
|
|
@@ -12607,9 +12607,9 @@ var ActionType$5;
|
|
|
12607
12607
|
* @param action action to execute
|
|
12608
12608
|
* @returns updated state
|
|
12609
12609
|
*/
|
|
12610
|
-
const reducer$
|
|
12610
|
+
const reducer$7 = (state, action) => {
|
|
12611
12611
|
switch (action.type) {
|
|
12612
|
-
case ActionType$
|
|
12612
|
+
case ActionType$6.SetInputValue: {
|
|
12613
12613
|
return Object.assign(Object.assign({}, state), { inputValue: action.value });
|
|
12614
12614
|
}
|
|
12615
12615
|
default: {
|
|
@@ -12629,7 +12629,7 @@ const CreatableMultiselect = (props) => {
|
|
|
12629
12629
|
inputValue: '',
|
|
12630
12630
|
};
|
|
12631
12631
|
// Initialize state
|
|
12632
|
-
const [state, dispatch] = useReducer(reducer$
|
|
12632
|
+
const [state, dispatch] = useReducer(reducer$7, initialState);
|
|
12633
12633
|
// Destructure common state
|
|
12634
12634
|
const { inputValue } = state;
|
|
12635
12635
|
/*------------------------------------------------------------------------*/
|
|
@@ -12706,7 +12706,7 @@ const CreatableMultiselect = (props) => {
|
|
|
12706
12706
|
}
|
|
12707
12707
|
// Reset text field to empty because the values have been added
|
|
12708
12708
|
dispatch({
|
|
12709
|
-
type: ActionType$
|
|
12709
|
+
type: ActionType$6.SetInputValue,
|
|
12710
12710
|
value: '',
|
|
12711
12711
|
});
|
|
12712
12712
|
};
|
|
@@ -12745,7 +12745,7 @@ const CreatableMultiselect = (props) => {
|
|
|
12745
12745
|
else {
|
|
12746
12746
|
// simply update the input value to the new input value
|
|
12747
12747
|
dispatch({
|
|
12748
|
-
type: ActionType$
|
|
12748
|
+
type: ActionType$6.SetInputValue,
|
|
12749
12749
|
value: newValue,
|
|
12750
12750
|
});
|
|
12751
12751
|
}
|
|
@@ -12797,13 +12797,13 @@ const style$2 = `
|
|
|
12797
12797
|
`;
|
|
12798
12798
|
/* ------------- Actions ------------ */
|
|
12799
12799
|
// Types of actions
|
|
12800
|
-
var ActionType$
|
|
12800
|
+
var ActionType$5;
|
|
12801
12801
|
(function (ActionType) {
|
|
12802
12802
|
// Update the DBEntry
|
|
12803
12803
|
ActionType["UpdateDBEntry"] = "UpdateDBEntry";
|
|
12804
12804
|
// Start the save spinner
|
|
12805
12805
|
ActionType["StartSave"] = "StartSave";
|
|
12806
|
-
})(ActionType$
|
|
12806
|
+
})(ActionType$5 || (ActionType$5 = {}));
|
|
12807
12807
|
/**
|
|
12808
12808
|
* Reducer that executes actions
|
|
12809
12809
|
* @author Yuen Ler Chow
|
|
@@ -12811,12 +12811,12 @@ var ActionType$4;
|
|
|
12811
12811
|
* @param action action to execute
|
|
12812
12812
|
* @returns updated state
|
|
12813
12813
|
*/
|
|
12814
|
-
const reducer$
|
|
12814
|
+
const reducer$6 = (state, action) => {
|
|
12815
12815
|
switch (action.type) {
|
|
12816
|
-
case ActionType$
|
|
12816
|
+
case ActionType$5.UpdateDBEntry: {
|
|
12817
12817
|
return Object.assign(Object.assign({}, state), { entry: action.dbEntry });
|
|
12818
12818
|
}
|
|
12819
|
-
case ActionType$
|
|
12819
|
+
case ActionType$5.StartSave: {
|
|
12820
12820
|
return Object.assign(Object.assign({}, state), { saving: true });
|
|
12821
12821
|
}
|
|
12822
12822
|
default: {
|
|
@@ -12841,7 +12841,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12841
12841
|
saving: false,
|
|
12842
12842
|
};
|
|
12843
12843
|
// Initialize state
|
|
12844
|
-
const [state, dispatch] = useReducer(reducer$
|
|
12844
|
+
const [state, dispatch] = useReducer(reducer$6, initialState);
|
|
12845
12845
|
// Destructure common state
|
|
12846
12846
|
const { entry, saving, } = state;
|
|
12847
12847
|
/*------------------------------------------------------------------------*/
|
|
@@ -12853,7 +12853,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
12853
12853
|
*/
|
|
12854
12854
|
const save = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
12855
12855
|
// Start the save loading indicator
|
|
12856
|
-
dispatch({ type: ActionType$
|
|
12856
|
+
dispatch({ type: ActionType$5.StartSave });
|
|
12857
12857
|
// add all default values to the entry
|
|
12858
12858
|
entryFields.forEach((field) => {
|
|
12859
12859
|
if (field.defaultValue && !entry[field.objectKey]) {
|
|
@@ -13036,7 +13036,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
13036
13036
|
return (React__default.createElement(RadioButton, { key: choice.value, text: choice.title, selected: entry[field.objectKey] === choice.value, onSelected: () => {
|
|
13037
13037
|
entry[field.objectKey] = choice.value;
|
|
13038
13038
|
dispatch({
|
|
13039
|
-
type: ActionType$
|
|
13039
|
+
type: ActionType$5.UpdateDBEntry,
|
|
13040
13040
|
dbEntry: entry,
|
|
13041
13041
|
});
|
|
13042
13042
|
}, ariaLabel: choice.title }));
|
|
@@ -13048,7 +13048,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
13048
13048
|
React__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) => {
|
|
13049
13049
|
entry[field.objectKey] = (e.target.value);
|
|
13050
13050
|
dispatch({
|
|
13051
|
-
type: ActionType$
|
|
13051
|
+
type: ActionType$5.UpdateDBEntry,
|
|
13052
13052
|
dbEntry: entry,
|
|
13053
13053
|
});
|
|
13054
13054
|
} }))));
|
|
@@ -13061,7 +13061,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
13061
13061
|
entry[field.objectKey] = (e.target.value
|
|
13062
13062
|
.replace(/[^0-9]/g, ''));
|
|
13063
13063
|
dispatch({
|
|
13064
|
-
type: ActionType$
|
|
13064
|
+
type: ActionType$5.UpdateDBEntry,
|
|
13065
13065
|
dbEntry: entry,
|
|
13066
13066
|
});
|
|
13067
13067
|
} }))));
|
|
@@ -13091,7 +13091,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
13091
13091
|
}
|
|
13092
13092
|
// Save
|
|
13093
13093
|
dispatch({
|
|
13094
|
-
type: ActionType$
|
|
13094
|
+
type: ActionType$5.UpdateDBEntry,
|
|
13095
13095
|
dbEntry: entry,
|
|
13096
13096
|
});
|
|
13097
13097
|
}, ariaLabel: choice.title }));
|
|
@@ -13106,7 +13106,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
13106
13106
|
// Update entry and save
|
|
13107
13107
|
entry[field.objectKey] = values;
|
|
13108
13108
|
dispatch({
|
|
13109
|
-
type: ActionType$
|
|
13109
|
+
type: ActionType$5.UpdateDBEntry,
|
|
13110
13110
|
dbEntry: entry,
|
|
13111
13111
|
});
|
|
13112
13112
|
} })))));
|
|
@@ -13119,7 +13119,7 @@ const AddOrEditDBEntry = (props) => {
|
|
|
13119
13119
|
React__default.createElement(CreatableMultiselect, { disabled: disabled, type: DBEntryFieldType$1.NumberArray, values: entry[field.objectKey] || [], onChange: (values) => {
|
|
13120
13120
|
entry[field.objectKey] = values;
|
|
13121
13121
|
dispatch({
|
|
13122
|
-
type: ActionType$
|
|
13122
|
+
type: ActionType$5.UpdateDBEntry,
|
|
13123
13123
|
dbEntry: entry,
|
|
13124
13124
|
});
|
|
13125
13125
|
} })))));
|
|
@@ -13193,7 +13193,7 @@ const generateEndpointPath = (collectionName, adminsOnly = true) => {
|
|
|
13193
13193
|
*/
|
|
13194
13194
|
/* ------------- Actions ------------ */
|
|
13195
13195
|
// Types of actions
|
|
13196
|
-
var ActionType$
|
|
13196
|
+
var ActionType$4;
|
|
13197
13197
|
(function (ActionType) {
|
|
13198
13198
|
// Show adder
|
|
13199
13199
|
ActionType["ShowAdder"] = "ShowAdder";
|
|
@@ -13207,7 +13207,7 @@ var ActionType$3;
|
|
|
13207
13207
|
ActionType["StartDelete"] = "StartDelete";
|
|
13208
13208
|
// Finish deletion process
|
|
13209
13209
|
ActionType["FinishDelete"] = "FinishDelete";
|
|
13210
|
-
})(ActionType$
|
|
13210
|
+
})(ActionType$4 || (ActionType$4 = {}));
|
|
13211
13211
|
/**
|
|
13212
13212
|
* Reducer that executes actions
|
|
13213
13213
|
* @author Yuen Ler Chow
|
|
@@ -13215,18 +13215,18 @@ var ActionType$3;
|
|
|
13215
13215
|
* @param action action to execute
|
|
13216
13216
|
* @returns updated state
|
|
13217
13217
|
*/
|
|
13218
|
-
const reducer$
|
|
13218
|
+
const reducer$5 = (state, action) => {
|
|
13219
13219
|
switch (action.type) {
|
|
13220
|
-
case ActionType$
|
|
13220
|
+
case ActionType$4.FinishLoading: {
|
|
13221
13221
|
return Object.assign(Object.assign({}, state), { loading: false, dbEntries: action.dbEntries });
|
|
13222
13222
|
}
|
|
13223
|
-
case ActionType$
|
|
13223
|
+
case ActionType$4.ShowAdder: {
|
|
13224
13224
|
return Object.assign(Object.assign({}, state), { adding: true, dbEntryToEdit: undefined });
|
|
13225
13225
|
}
|
|
13226
|
-
case ActionType$
|
|
13226
|
+
case ActionType$4.ShowEditor: {
|
|
13227
13227
|
return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: action.dbEntry });
|
|
13228
13228
|
}
|
|
13229
|
-
case ActionType$
|
|
13229
|
+
case ActionType$4.FinishAdd: {
|
|
13230
13230
|
// Handle cancel
|
|
13231
13231
|
const finishedEntry = action.dbEntry;
|
|
13232
13232
|
if (!finishedEntry) {
|
|
@@ -13250,10 +13250,10 @@ const reducer$4 = (state, action) => {
|
|
|
13250
13250
|
// Update the state
|
|
13251
13251
|
return Object.assign(Object.assign({}, state), { adding: false, dbEntryToEdit: undefined, dbEntries: updatedDbEntries });
|
|
13252
13252
|
}
|
|
13253
|
-
case ActionType$
|
|
13253
|
+
case ActionType$4.StartDelete: {
|
|
13254
13254
|
return Object.assign(Object.assign({}, state), { loading: true });
|
|
13255
13255
|
}
|
|
13256
|
-
case ActionType$
|
|
13256
|
+
case ActionType$4.FinishDelete: {
|
|
13257
13257
|
return Object.assign(Object.assign({}, state), { loading: false,
|
|
13258
13258
|
// Remove the deleted entry from the list
|
|
13259
13259
|
dbEntries: state.dbEntries.filter((entry) => {
|
|
@@ -13279,7 +13279,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
13279
13279
|
loading: true,
|
|
13280
13280
|
};
|
|
13281
13281
|
// Initialize state
|
|
13282
|
-
const [state, dispatch] = useReducer(reducer$
|
|
13282
|
+
const [state, dispatch] = useReducer(reducer$5, initialState);
|
|
13283
13283
|
// Destructure common state
|
|
13284
13284
|
const { adding, dbEntryToEdit, dbEntries, loading, } = state;
|
|
13285
13285
|
/*------------------------------------------------------------------------*/
|
|
@@ -13305,7 +13305,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
13305
13305
|
try {
|
|
13306
13306
|
// Start loader
|
|
13307
13307
|
dispatch({
|
|
13308
|
-
type: ActionType$
|
|
13308
|
+
type: ActionType$4.StartDelete,
|
|
13309
13309
|
});
|
|
13310
13310
|
// Perform deletion
|
|
13311
13311
|
yield visitServerEndpoint({
|
|
@@ -13314,7 +13314,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
13314
13314
|
});
|
|
13315
13315
|
// Finish loader
|
|
13316
13316
|
dispatch({
|
|
13317
|
-
type: ActionType$
|
|
13317
|
+
type: ActionType$4.FinishDelete,
|
|
13318
13318
|
dbEntry: entry,
|
|
13319
13319
|
idPropName,
|
|
13320
13320
|
});
|
|
@@ -13343,7 +13343,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
13343
13343
|
});
|
|
13344
13344
|
// Save loaded data
|
|
13345
13345
|
dispatch({
|
|
13346
|
-
type: ActionType$
|
|
13346
|
+
type: ActionType$4.FinishLoading,
|
|
13347
13347
|
dbEntries: data,
|
|
13348
13348
|
});
|
|
13349
13349
|
}
|
|
@@ -13386,7 +13386,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
13386
13386
|
React__default.createElement("span", { className: "d-none d-md-inline ms-1" }, "Remove")),
|
|
13387
13387
|
!disableEdit && (React__default.createElement("button", { type: "button", id: `DBEntryManagerPanel-edit-with-id-${entry[idPropName]}`, className: "btn btn-primary", "aria-label": `edit db entry: ${entry[titlePropName]}`, onClick: () => {
|
|
13388
13388
|
dispatch({
|
|
13389
|
-
type: ActionType$
|
|
13389
|
+
type: ActionType$4.ShowEditor,
|
|
13390
13390
|
dbEntry: entry,
|
|
13391
13391
|
});
|
|
13392
13392
|
} },
|
|
@@ -13396,7 +13396,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
13396
13396
|
React__default.createElement("div", { className: "d-grid" },
|
|
13397
13397
|
React__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: () => {
|
|
13398
13398
|
dispatch({
|
|
13399
|
-
type: ActionType$
|
|
13399
|
+
type: ActionType$4.ShowAdder,
|
|
13400
13400
|
});
|
|
13401
13401
|
} },
|
|
13402
13402
|
React__default.createElement(FontAwesomeIcon, { icon: faPlus, className: "me-2" }),
|
|
@@ -13408,7 +13408,7 @@ const DBEntryManagerPanel = (props) => {
|
|
|
13408
13408
|
if (!loading && (adding || dbEntryToEdit)) {
|
|
13409
13409
|
body = (React__default.createElement(AddOrEditDBEntry, { saveEndpointPath: endpoint, validateEntry: validateEntry, modifyEntry: modifyEntry, entryFields: entryFields, dbEntryToEdit: dbEntryToEdit, idPropName: idPropName, entries: dbEntries, itemName: itemName, onFinished: (entry) => {
|
|
13410
13410
|
dispatch({
|
|
13411
|
-
type: ActionType$
|
|
13411
|
+
type: ActionType$4.FinishAdd,
|
|
13412
13412
|
dbEntry: entry,
|
|
13413
13413
|
idPropName,
|
|
13414
13414
|
});
|
|
@@ -13584,25 +13584,25 @@ const getItemIds = (items) => {
|
|
|
13584
13584
|
};
|
|
13585
13585
|
/* ------------- Actions ------------ */
|
|
13586
13586
|
// Types of actions
|
|
13587
|
-
var ActionType$
|
|
13587
|
+
var ActionType$3;
|
|
13588
13588
|
(function (ActionType) {
|
|
13589
13589
|
// Hide the "jump to bottom" button
|
|
13590
13590
|
ActionType["HideJumpToBottomButton"] = "HideJumpToBottomButton";
|
|
13591
13591
|
// Show the "jump to bottom" button
|
|
13592
13592
|
ActionType["ShowJumpToBottomButton"] = "ShowJumpToBottomButton";
|
|
13593
|
-
})(ActionType$
|
|
13593
|
+
})(ActionType$3 || (ActionType$3 = {}));
|
|
13594
13594
|
/**
|
|
13595
13595
|
* Reducer that executes actions
|
|
13596
13596
|
* @author Gabe Abrams
|
|
13597
13597
|
* @param state current state
|
|
13598
13598
|
* @param action action to execute
|
|
13599
13599
|
*/
|
|
13600
|
-
const reducer$
|
|
13600
|
+
const reducer$4 = (state, action) => {
|
|
13601
13601
|
switch (action.type) {
|
|
13602
|
-
case ActionType$
|
|
13602
|
+
case ActionType$3.HideJumpToBottomButton: {
|
|
13603
13603
|
return Object.assign(Object.assign({}, state), { jumpToBottomButtonVisible: false });
|
|
13604
13604
|
}
|
|
13605
|
-
case ActionType$
|
|
13605
|
+
case ActionType$3.ShowJumpToBottomButton: {
|
|
13606
13606
|
return Object.assign(Object.assign({}, state), { jumpToBottomButtonVisible: true });
|
|
13607
13607
|
}
|
|
13608
13608
|
default: {
|
|
@@ -13626,7 +13626,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13626
13626
|
jumpToBottomButtonVisible: false,
|
|
13627
13627
|
};
|
|
13628
13628
|
// Initialize state
|
|
13629
|
-
const [state, dispatch] = useReducer(reducer$
|
|
13629
|
+
const [state, dispatch] = useReducer(reducer$4, initialState);
|
|
13630
13630
|
// Destructure common state
|
|
13631
13631
|
const { jumpToBottomButtonVisible, } = state;
|
|
13632
13632
|
/* -------------- Refs -------------- */
|
|
@@ -13672,7 +13672,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13672
13672
|
}
|
|
13673
13673
|
// Update state
|
|
13674
13674
|
dispatch({
|
|
13675
|
-
type: ActionType$
|
|
13675
|
+
type: ActionType$3.HideJumpToBottomButton,
|
|
13676
13676
|
});
|
|
13677
13677
|
// Scroll to bottom
|
|
13678
13678
|
container.current.scrollTop = (container.current.scrollHeight
|
|
@@ -13696,7 +13696,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13696
13696
|
if (isScrolledToBottom()) {
|
|
13697
13697
|
// Hide button
|
|
13698
13698
|
dispatch({
|
|
13699
|
-
type: ActionType$
|
|
13699
|
+
type: ActionType$3.HideJumpToBottomButton,
|
|
13700
13700
|
});
|
|
13701
13701
|
}
|
|
13702
13702
|
};
|
|
@@ -13738,7 +13738,7 @@ const AutoscrollToBottomContainer = (props) => {
|
|
|
13738
13738
|
else {
|
|
13739
13739
|
// Not scrolled to bottom. Show "jump to bottom" button.
|
|
13740
13740
|
dispatch({
|
|
13741
|
-
type: ActionType$
|
|
13741
|
+
type: ActionType$3.ShowJumpToBottomButton,
|
|
13742
13742
|
});
|
|
13743
13743
|
}
|
|
13744
13744
|
}, [items]);
|
|
@@ -13808,25 +13808,25 @@ const combineClassNames = (classNames) => {
|
|
|
13808
13808
|
*/
|
|
13809
13809
|
/* ------------- Actions ------------ */
|
|
13810
13810
|
// Types of actions
|
|
13811
|
-
var ActionType$
|
|
13811
|
+
var ActionType$2;
|
|
13812
13812
|
(function (ActionType) {
|
|
13813
13813
|
// Start hovering on an option
|
|
13814
13814
|
ActionType["StartHover"] = "StartHover";
|
|
13815
13815
|
// Stop hovering on an option
|
|
13816
13816
|
ActionType["StopHover"] = "StopHover";
|
|
13817
|
-
})(ActionType$
|
|
13817
|
+
})(ActionType$2 || (ActionType$2 = {}));
|
|
13818
13818
|
/**
|
|
13819
13819
|
* Reducer that executes actions
|
|
13820
13820
|
* @author Gabe Abrams
|
|
13821
13821
|
* @param state current state
|
|
13822
13822
|
* @param action action to execute
|
|
13823
13823
|
*/
|
|
13824
|
-
const reducer$
|
|
13824
|
+
const reducer$3 = (state, action) => {
|
|
13825
13825
|
switch (action.type) {
|
|
13826
|
-
case ActionType$
|
|
13826
|
+
case ActionType$2.StartHover: {
|
|
13827
13827
|
return Object.assign(Object.assign({}, state), { hoveredOptionId: action.hoveredOptionId });
|
|
13828
13828
|
}
|
|
13829
|
-
case ActionType$
|
|
13829
|
+
case ActionType$2.StopHover: {
|
|
13830
13830
|
return Object.assign(Object.assign({}, state), { hoveredOptionId: undefined });
|
|
13831
13831
|
}
|
|
13832
13832
|
default: {
|
|
@@ -13850,7 +13850,7 @@ const MultiSwitch = (props) => {
|
|
|
13850
13850
|
hoveredOptionId: undefined,
|
|
13851
13851
|
};
|
|
13852
13852
|
// Initialize state
|
|
13853
|
-
const [state, dispatch] = useReducer(reducer$
|
|
13853
|
+
const [state, dispatch] = useReducer(reducer$3, initialState);
|
|
13854
13854
|
// Destructure common state
|
|
13855
13855
|
const { hoveredOptionId, } = state;
|
|
13856
13856
|
/*------------------------------------------------------------------------*/
|
|
@@ -13982,27 +13982,27 @@ const MultiSwitch = (props) => {
|
|
|
13982
13982
|
: `click to select option "${option.label}"`), onClick: () => {
|
|
13983
13983
|
// Remove hover
|
|
13984
13984
|
dispatch({
|
|
13985
|
-
type: ActionType$
|
|
13985
|
+
type: ActionType$2.StopHover,
|
|
13986
13986
|
});
|
|
13987
13987
|
// Notify parent
|
|
13988
13988
|
onChange(option.id);
|
|
13989
13989
|
}, onMouseEnter: () => {
|
|
13990
13990
|
dispatch({
|
|
13991
|
-
type: ActionType$
|
|
13991
|
+
type: ActionType$2.StartHover,
|
|
13992
13992
|
hoveredOptionId: option.id,
|
|
13993
13993
|
});
|
|
13994
13994
|
}, onMouseLeave: () => {
|
|
13995
13995
|
dispatch({
|
|
13996
|
-
type: ActionType$
|
|
13996
|
+
type: ActionType$2.StopHover,
|
|
13997
13997
|
});
|
|
13998
13998
|
}, onFocus: () => {
|
|
13999
13999
|
dispatch({
|
|
14000
|
-
type: ActionType$
|
|
14000
|
+
type: ActionType$2.StartHover,
|
|
14001
14001
|
hoveredOptionId: option.id,
|
|
14002
14002
|
});
|
|
14003
14003
|
}, onBlur: () => {
|
|
14004
14004
|
dispatch({
|
|
14005
|
-
type: ActionType$
|
|
14005
|
+
type: ActionType$2.StopHover,
|
|
14006
14006
|
});
|
|
14007
14007
|
}, style: {
|
|
14008
14008
|
pointerEvents: ((option.id === selectedOptionId)
|
|
@@ -14041,13 +14041,13 @@ var DropdownItemType$1 = DropdownItemType;
|
|
|
14041
14041
|
*/
|
|
14042
14042
|
/* ------------- Actions ------------ */
|
|
14043
14043
|
// Types of actions
|
|
14044
|
-
var ActionType;
|
|
14044
|
+
var ActionType$1;
|
|
14045
14045
|
(function (ActionType) {
|
|
14046
14046
|
// Toggle opening the dropdown menu
|
|
14047
14047
|
ActionType["ToggleDropdown"] = "ToggleDropdown";
|
|
14048
14048
|
// Close the dropdown menu
|
|
14049
14049
|
ActionType["CloseDropdown"] = "CloseDropdown";
|
|
14050
|
-
})(ActionType || (ActionType = {}));
|
|
14050
|
+
})(ActionType$1 || (ActionType$1 = {}));
|
|
14051
14051
|
/**
|
|
14052
14052
|
* Reducer that executes actions
|
|
14053
14053
|
* @author Alessandra De Lucas
|
|
@@ -14055,12 +14055,12 @@ var ActionType;
|
|
|
14055
14055
|
* @param state current state
|
|
14056
14056
|
* @param action action to execute
|
|
14057
14057
|
*/
|
|
14058
|
-
const reducer$
|
|
14058
|
+
const reducer$2 = (state, action) => {
|
|
14059
14059
|
switch (action.type) {
|
|
14060
|
-
case ActionType.ToggleDropdown: {
|
|
14060
|
+
case ActionType$1.ToggleDropdown: {
|
|
14061
14061
|
return Object.assign(Object.assign({}, state), { isDropdownOpen: !state.isDropdownOpen });
|
|
14062
14062
|
}
|
|
14063
|
-
case ActionType.CloseDropdown: {
|
|
14063
|
+
case ActionType$1.CloseDropdown: {
|
|
14064
14064
|
return Object.assign(Object.assign({}, state), { isDropdownOpen: false });
|
|
14065
14065
|
}
|
|
14066
14066
|
default: {
|
|
@@ -14084,7 +14084,7 @@ const Dropdown = (props) => {
|
|
|
14084
14084
|
isDropdownOpen: false,
|
|
14085
14085
|
};
|
|
14086
14086
|
// Initialize state
|
|
14087
|
-
const [state, dispatch] = useReducer(reducer$
|
|
14087
|
+
const [state, dispatch] = useReducer(reducer$2, initialState);
|
|
14088
14088
|
// Destructure common state
|
|
14089
14089
|
const { isDropdownOpen, } = state;
|
|
14090
14090
|
/* -------------- Refs -------------- */
|
|
@@ -14104,7 +14104,7 @@ const Dropdown = (props) => {
|
|
|
14104
14104
|
dropdownRef.current
|
|
14105
14105
|
// Click occurred outside the dropdown
|
|
14106
14106
|
&& !dropdownRef.current.contains(event.target)) {
|
|
14107
|
-
dispatch({ type: ActionType.CloseDropdown });
|
|
14107
|
+
dispatch({ type: ActionType$1.CloseDropdown });
|
|
14108
14108
|
}
|
|
14109
14109
|
};
|
|
14110
14110
|
/*------------------------------------------------------------------------*/
|
|
@@ -14133,7 +14133,7 @@ const Dropdown = (props) => {
|
|
|
14133
14133
|
dropdownButton.variant === Variant$1.Light && 'text-dark',
|
|
14134
14134
|
]), type: "button", id: dropdownButton.id, "aria-expanded": isDropdownOpen, "aria-label": dropdownButton.ariaLabel, onClick: () => {
|
|
14135
14135
|
dispatch({
|
|
14136
|
-
type: ActionType.ToggleDropdown,
|
|
14136
|
+
type: ActionType$1.ToggleDropdown,
|
|
14137
14137
|
});
|
|
14138
14138
|
} }, dropdownButton.content),
|
|
14139
14139
|
React__default.createElement("ul", { className: combineClassNames([
|
|
@@ -14155,7 +14155,7 @@ const Dropdown = (props) => {
|
|
|
14155
14155
|
React__default.createElement("button", { type: "button", "aria-label": item.ariaLabel, className: "dropdown-item", onClick: (e) => {
|
|
14156
14156
|
e.preventDefault();
|
|
14157
14157
|
dispatch({
|
|
14158
|
-
type: ActionType.CloseDropdown,
|
|
14158
|
+
type: ActionType$1.CloseDropdown,
|
|
14159
14159
|
});
|
|
14160
14160
|
item.onClick();
|
|
14161
14161
|
} }, item.content)));
|
|
@@ -14363,6 +14363,150 @@ const ProgressBar = (props) => {
|
|
|
14363
14363
|
"\u00A0"))));
|
|
14364
14364
|
};
|
|
14365
14365
|
|
|
14366
|
+
/**
|
|
14367
|
+
* Fake progress bar that approaches completion but never fully finishes.
|
|
14368
|
+
* Built on top of the existing ProgressBar component.
|
|
14369
|
+
*
|
|
14370
|
+
* Two phases:
|
|
14371
|
+
* 1. Fast phase (0–90%): random jumps of 1–5% at randomized intervals,
|
|
14372
|
+
* paced to reach ~90% in roughly estimatedTimeSec seconds.
|
|
14373
|
+
* 2. Slow phase (90–99%): crawls 1% at a time with longer random delays,
|
|
14374
|
+
* never reaching 100% on its own.
|
|
14375
|
+
*
|
|
14376
|
+
* When isFinished becomes true, the bar immediately jumps to 100%.
|
|
14377
|
+
* @author Yuen Ler Chow
|
|
14378
|
+
*/
|
|
14379
|
+
/*------------------------------------------------------------------------*/
|
|
14380
|
+
/* ------------------------------ Constants ----------------------------- */
|
|
14381
|
+
/*------------------------------------------------------------------------*/
|
|
14382
|
+
// Percent where the bar switches from fast random jumps to a slow crawl
|
|
14383
|
+
const SLOW_PHASE_START_PERCENT = 90;
|
|
14384
|
+
// Highest percent the bar will reach on its own (before isFinished is true)
|
|
14385
|
+
const MAX_UNFINISHED_PERCENT = 99;
|
|
14386
|
+
// Average step size during the fast phase (uniform random from 1–5)
|
|
14387
|
+
const AVG_FAST_PHASE_STEP = 3;
|
|
14388
|
+
// Minimum delay (ms) between steps during the slow phase
|
|
14389
|
+
const SLOW_PHASE_MIN_DELAY_MS = 2000;
|
|
14390
|
+
// Maximum delay (ms) between steps during the slow phase
|
|
14391
|
+
const SLOW_PHASE_MAX_DELAY_MS = 5000;
|
|
14392
|
+
/* ------------- Actions ------------ */
|
|
14393
|
+
// Types of actions
|
|
14394
|
+
var ActionType;
|
|
14395
|
+
(function (ActionType) {
|
|
14396
|
+
// Advance the progress by a given step
|
|
14397
|
+
ActionType["Advance"] = "Advance";
|
|
14398
|
+
// Set progress to 100% (task complete)
|
|
14399
|
+
ActionType["Complete"] = "Complete";
|
|
14400
|
+
})(ActionType || (ActionType = {}));
|
|
14401
|
+
/**
|
|
14402
|
+
* Reducer that executes actions
|
|
14403
|
+
* @author Yuen Ler Chow
|
|
14404
|
+
* @param state current state
|
|
14405
|
+
* @param action action to execute
|
|
14406
|
+
*/
|
|
14407
|
+
const reducer$1 = (state, action) => {
|
|
14408
|
+
switch (action.type) {
|
|
14409
|
+
case ActionType.Advance: {
|
|
14410
|
+
return Object.assign(Object.assign({}, state), { progress: Math.min(100, state.progress + action.step) });
|
|
14411
|
+
}
|
|
14412
|
+
case ActionType.Complete: {
|
|
14413
|
+
return Object.assign(Object.assign({}, state), { progress: 100 });
|
|
14414
|
+
}
|
|
14415
|
+
default: {
|
|
14416
|
+
return state;
|
|
14417
|
+
}
|
|
14418
|
+
}
|
|
14419
|
+
};
|
|
14420
|
+
/*------------------------------------------------------------------------*/
|
|
14421
|
+
/* ------------------------------ Component ----------------------------- */
|
|
14422
|
+
/*------------------------------------------------------------------------*/
|
|
14423
|
+
const FakeProgressBar = (props) => {
|
|
14424
|
+
/*------------------------------------------------------------------------*/
|
|
14425
|
+
/* -------------------------------- Setup ------------------------------- */
|
|
14426
|
+
/*------------------------------------------------------------------------*/
|
|
14427
|
+
/* -------------- Props ------------- */
|
|
14428
|
+
// Destructure props
|
|
14429
|
+
const { isFinished, estimatedTimeSec = 8, striped, variant, bgVariant, showOutline, size, } = props;
|
|
14430
|
+
/* -------------- State ------------- */
|
|
14431
|
+
// Initial state
|
|
14432
|
+
const initialState = {
|
|
14433
|
+
progress: 0,
|
|
14434
|
+
};
|
|
14435
|
+
// Initialize state
|
|
14436
|
+
const [state, dispatch] = useReducer(reducer$1, initialState);
|
|
14437
|
+
// Destructure common state
|
|
14438
|
+
const { progress, } = state;
|
|
14439
|
+
// Convert estimate to milliseconds
|
|
14440
|
+
const estimatedMs = estimatedTimeSec * 1000;
|
|
14441
|
+
// Average interval between updates to reach ~90% in the estimated time
|
|
14442
|
+
const avgIntervalMs = (estimatedMs / SLOW_PHASE_START_PERCENT) * AVG_FAST_PHASE_STEP;
|
|
14443
|
+
/*------------------------------------------------------------------------*/
|
|
14444
|
+
/* ------------------------- Lifecycle Functions ------------------------ */
|
|
14445
|
+
/*------------------------------------------------------------------------*/
|
|
14446
|
+
/**
|
|
14447
|
+
* Animate to 100% when isFinished becomes true
|
|
14448
|
+
* @author Yuen Ler Chow
|
|
14449
|
+
*/
|
|
14450
|
+
useEffect(() => {
|
|
14451
|
+
if (isFinished) {
|
|
14452
|
+
dispatch({
|
|
14453
|
+
type: ActionType.Complete,
|
|
14454
|
+
});
|
|
14455
|
+
}
|
|
14456
|
+
}, [isFinished]);
|
|
14457
|
+
/**
|
|
14458
|
+
* Advance the progress in two phases:
|
|
14459
|
+
* 1) Random jumps up to 90%
|
|
14460
|
+
* 2) Slow crawl from 90% to 99%
|
|
14461
|
+
* @author Yuen Ler Chow
|
|
14462
|
+
*/
|
|
14463
|
+
useEffect(() => {
|
|
14464
|
+
// Stop if already finished or at max
|
|
14465
|
+
if (isFinished || progress >= MAX_UNFINISHED_PERCENT) {
|
|
14466
|
+
return;
|
|
14467
|
+
}
|
|
14468
|
+
// Determine which phase we are in
|
|
14469
|
+
const inFastPhase = progress < SLOW_PHASE_START_PERCENT;
|
|
14470
|
+
// Default values
|
|
14471
|
+
let delay = avgIntervalMs;
|
|
14472
|
+
let step = 1;
|
|
14473
|
+
if (inFastPhase) {
|
|
14474
|
+
// Randomize delay around the average interval for variability
|
|
14475
|
+
const randomnessMultiplier = 0.5 + (Math.random());
|
|
14476
|
+
delay = avgIntervalMs * randomnessMultiplier;
|
|
14477
|
+
// Randomly move forward by 1-5%, capped at 90%
|
|
14478
|
+
step = Math.min(1 + Math.floor(Math.random() * 5), SLOW_PHASE_START_PERCENT - progress);
|
|
14479
|
+
}
|
|
14480
|
+
else {
|
|
14481
|
+
// Crawl slowly 1% at a time, clamped so we don't exceed 99%
|
|
14482
|
+
delay = SLOW_PHASE_MIN_DELAY_MS + (Math.random() * (SLOW_PHASE_MAX_DELAY_MS - SLOW_PHASE_MIN_DELAY_MS));
|
|
14483
|
+
step = Math.min(1, MAX_UNFINISHED_PERCENT - progress);
|
|
14484
|
+
}
|
|
14485
|
+
// Track whether this effect invocation is still current
|
|
14486
|
+
let cancelled = false;
|
|
14487
|
+
// Wait then dispatch the next progress update
|
|
14488
|
+
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
14489
|
+
yield waitMs(delay);
|
|
14490
|
+
if (!cancelled) {
|
|
14491
|
+
dispatch({
|
|
14492
|
+
type: ActionType.Advance,
|
|
14493
|
+
step,
|
|
14494
|
+
});
|
|
14495
|
+
}
|
|
14496
|
+
}))();
|
|
14497
|
+
return () => {
|
|
14498
|
+
cancelled = true;
|
|
14499
|
+
};
|
|
14500
|
+
}, [progress, avgIntervalMs, isFinished]);
|
|
14501
|
+
/*------------------------------------------------------------------------*/
|
|
14502
|
+
/* ------------------------------- Render ------------------------------- */
|
|
14503
|
+
/*------------------------------------------------------------------------*/
|
|
14504
|
+
/*----------------------------------------*/
|
|
14505
|
+
/* --------------- Main UI -------------- */
|
|
14506
|
+
/*----------------------------------------*/
|
|
14507
|
+
return (React__default.createElement(ProgressBar, { percentProgress: progress, striped: striped, variant: variant, bgVariant: bgVariant, showOutline: showOutline, size: size }));
|
|
14508
|
+
};
|
|
14509
|
+
|
|
14366
14510
|
// True if user is on mobile or tablet
|
|
14367
14511
|
let cachedResult;
|
|
14368
14512
|
/**
|
|
@@ -14590,5 +14734,5 @@ const isSelectAdmin = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
14590
14734
|
}
|
|
14591
14735
|
});
|
|
14592
14736
|
|
|
14593
|
-
export { AppWrapper, AutoscrollToBottomContainer, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DBEntryFieldType$1 as DBEntryFieldType, DBEntryManagerPanel, Drawer, Dropdown, DropdownItemType$1 as DropdownItemType, DynamicWord, ErrorBox, IntelliTable, ItemPicker, LoadingSpinner, LogReviewer, Modal, ModalButtonType$1 as ModalButtonType, ModalSize$1 as ModalSize, ModalType$1 as ModalType, MultiSwitch, PopFailureMark, PopPendingMark, PopSuccessMark, ProgressBar, ProgressBarSize$1 as ProgressBarSize, RadioButton, SimpleDateChooser, SimpleTimeChooser, TabBox, ToggleSwitch, Tooltip, Variant$1 as Variant, addFatalErrorHandler, alert, canReviewLogs, combineClassNames, confirm, initClient, isMobileOrTablet, isSelectAdmin, leaveToURL, logClientEvent, makeLinksClickable, prompt, setClientEventMetadataPopulator, showFatalError, stubServerEndpoint, useForceRender, visitServerEndpoint };
|
|
14737
|
+
export { AppWrapper, AutoscrollToBottomContainer, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DBEntryFieldType$1 as DBEntryFieldType, DBEntryManagerPanel, Drawer, Dropdown, DropdownItemType$1 as DropdownItemType, DynamicWord, ErrorBox, FakeProgressBar, IntelliTable, ItemPicker, LoadingSpinner, LogReviewer, Modal, ModalButtonType$1 as ModalButtonType, ModalSize$1 as ModalSize, ModalType$1 as ModalType, MultiSwitch, PopFailureMark, PopPendingMark, PopSuccessMark, ProgressBar, ProgressBarSize$1 as ProgressBarSize, RadioButton, SimpleDateChooser, SimpleTimeChooser, TabBox, ToggleSwitch, Tooltip, Variant$1 as Variant, addFatalErrorHandler, alert, canReviewLogs, combineClassNames, confirm, initClient, isMobileOrTablet, isSelectAdmin, leaveToURL, logClientEvent, makeLinksClickable, prompt, setClientEventMetadataPopulator, showFatalError, stubServerEndpoint, useForceRender, visitServerEndpoint };
|
|
14594
14738
|
//# sourceMappingURL=index.js.map
|