dce-reactkit 3.2.2-beta.40 → 3.2.2-beta.42

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 CHANGED
@@ -2107,6 +2107,29 @@ const ItemPicker = (props) => {
2107
2107
  React__default["default"].createElement(NestableItemList, { items: items, onChanged: onChanged }))));
2108
2108
  };
2109
2109
 
2110
+ // Import shared helpers
2111
+ /**
2112
+ * Get a human-readable description of a date (all in ET)
2113
+ * @author Gabe Abrams
2114
+ * @param [dateOrTimestamp=today] the date or timestamp for the date to describe
2115
+ * @returns human-readable description of the date
2116
+ */
2117
+ const getHumanReadableDate = (dateOrTimestamp) => {
2118
+ // Get the date info
2119
+ const { month, day, year, } = getTimeInfoInET(dateOrTimestamp);
2120
+ const currYear = getTimeInfoInET().year;
2121
+ // Get the short month description
2122
+ const monthName = getMonthName(month).short;
2123
+ // Create start of description
2124
+ let description = `${monthName} ${day}${getOrdinal(day)}`;
2125
+ // Add on year if it's different
2126
+ if (year !== currYear) {
2127
+ description += ` ${year}`;
2128
+ }
2129
+ // Return description
2130
+ return description;
2131
+ };
2132
+
2110
2133
  /**
2111
2134
  * Path of the route for storing client-side logs
2112
2135
  * @author Gabe Abrams
@@ -2242,6 +2265,7 @@ const genCSV = (data, columns) => {
2242
2265
  .join(','));
2243
2266
  // Add each row
2244
2267
  data.forEach((datum) => {
2268
+ csv += '\n';
2245
2269
  csv += (columns
2246
2270
  .map((column) => {
2247
2271
  let contents;
@@ -2370,6 +2394,11 @@ const IntelliTable = (props) => {
2370
2394
  const data = ((props.data && props.data.length > 0)
2371
2395
  ? props.data
2372
2396
  : [{ id: 'empty-row' }]);
2397
+ if (props.csvName) {
2398
+ (props.csvName.endsWith('.csv')
2399
+ ? props.csvName
2400
+ : `${props.csvName}.csv`);
2401
+ }
2373
2402
  /* -------------- State ------------- */
2374
2403
  // Initial state
2375
2404
  const initColumnVisibilityMap = {};
@@ -2562,9 +2591,12 @@ const IntelliTable = (props) => {
2562
2591
  const noValue = (value === undefined
2563
2592
  || value === null);
2564
2593
  visibleValue = (noValue
2565
- ? (React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCheckCircle }))
2566
- : (React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faXmarkCircle })));
2594
+ ? (React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faMinus }))
2595
+ : (React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: fullValue ? freeSolidSvgIcons.faCheckCircle : freeSolidSvgIcons.faXmarkCircle })));
2567
2596
  title = (fullValue ? 'True' : 'False');
2597
+ if (noValue) {
2598
+ title = 'Empty Cell';
2599
+ }
2568
2600
  }
2569
2601
  else if (column.type === ParamType$1.Int) {
2570
2602
  fullValue = Number.parseInt(value, 10);
@@ -2573,6 +2605,9 @@ const IntelliTable = (props) => {
2573
2605
  ? (React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faMinus }))
2574
2606
  : fullValue);
2575
2607
  title = String(fullValue);
2608
+ if (noValue) {
2609
+ title = 'Empty Cell';
2610
+ }
2576
2611
  }
2577
2612
  else if (column.type === ParamType$1.Float) {
2578
2613
  fullValue = Number.parseFloat(value);
@@ -2581,6 +2616,9 @@ const IntelliTable = (props) => {
2581
2616
  ? (React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faMinus }))
2582
2617
  : roundToNumDecimals(fullValue, 2));
2583
2618
  title = String(fullValue);
2619
+ if (noValue) {
2620
+ title = 'Empty Cell';
2621
+ }
2584
2622
  }
2585
2623
  else if (column.type === ParamType$1.String) {
2586
2624
  fullValue = String(value).trim();
@@ -2591,6 +2629,9 @@ const IntelliTable = (props) => {
2591
2629
  ? (React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faMinus }))
2592
2630
  : fullValue);
2593
2631
  title = `"${value}"`;
2632
+ if (noValue) {
2633
+ title = 'Empty Cell';
2634
+ }
2594
2635
  }
2595
2636
  else if (column.type === ParamType$1.JSON) {
2596
2637
  fullValue = JSON.stringify(value);
@@ -2600,6 +2641,7 @@ const IntelliTable = (props) => {
2600
2641
  visibleValue = (noValue
2601
2642
  ? (React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faMinus }))
2602
2643
  : fullValue);
2644
+ title = "JSON Object";
2603
2645
  }
2604
2646
  // Create UI
2605
2647
  return (React__default["default"].createElement("td", { key: `${datum.id}-${column.param}`, title: title, style: {
@@ -3133,14 +3175,24 @@ const LogReviewer = (props) => {
3133
3175
  } },
3134
3176
  React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faHammer, className: "me-2" }),
3135
3177
  "Action"),
3136
- React__default["default"].createElement("button", { type: "button", id: "LogReviewer-toggle-advanced-filter-drawer", className: `btn btn-${FilterDrawer.Advanced === expandedFilterDrawer ? 'warning' : 'light'}`, "aria-label": "toggle advanced filter drawer", onClick: () => {
3178
+ 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: () => {
3137
3179
  dispatch({
3138
3180
  type: ActionType.ToggleFilterDrawer,
3139
3181
  filterDrawer: FilterDrawer.Advanced,
3140
3182
  });
3141
3183
  } },
3142
3184
  React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faList, className: "me-2" }),
3143
- "Advanced"))));
3185
+ "Advanced"),
3186
+ React__default["default"].createElement("button", { type: "button", id: "LogReviewer-reset-filters-button", className: "btn btn-light", "aria-label": "reset filters", onClick: () => {
3187
+ dispatch({
3188
+ type: ActionType.ResetFilters,
3189
+ initActionErrorFilterState,
3190
+ initAdvancedFilterState,
3191
+ initContextFilterState,
3192
+ initDateFilterState,
3193
+ initTagFilterState,
3194
+ });
3195
+ } }, "Reset All"))));
3144
3196
  // Filter drawer
3145
3197
  let filterDrawer;
3146
3198
  if (expandedFilterDrawer) {
@@ -3481,7 +3533,7 @@ const LogReviewer = (props) => {
3481
3533
  // Filters UI
3482
3534
  const filters = (React__default["default"].createElement(React__default["default"].Fragment, null,
3483
3535
  filterToggles,
3484
- filterDrawer && (React__default["default"].createElement(Drawer, null, filterDrawer))));
3536
+ filterDrawer && (React__default["default"].createElement(Drawer, { customBackgroundColor: "#eee" }, filterDrawer))));
3485
3537
  // Actually filter the logs
3486
3538
  // > Perform filters
3487
3539
  const logs = [];
@@ -3929,7 +3981,7 @@ const LogReviewer = (props) => {
3929
3981
  React__default["default"].createElement("div", null, "Either your filters are too strict or no matching logs have been created yet.")))
3930
3982
  : undefined);
3931
3983
  // Create intelliTable
3932
- const dataTable = (React__default["default"].createElement(IntelliTable, { title: "Matching Logs:", id: "logs", data: logs, columns: columns }));
3984
+ const dataTable = (React__default["default"].createElement(IntelliTable, { title: "Matching Logs:", csvName: `Logs from ${getHumanReadableDate()}`, id: "logs", data: logs, columns: columns }));
3933
3985
  // Main body
3934
3986
  body = (React__default["default"].createElement(React__default["default"].Fragment, null,
3935
3987
  filters,
@@ -5176,29 +5228,6 @@ const startMinWait = (minWaitMs) => {
5176
5228
  });
5177
5229
  };
5178
5230
 
5179
- // Import shared helpers
5180
- /**
5181
- * Get a human-readable description of a date (all in ET)
5182
- * @author Gabe Abrams
5183
- * @param [dateOrTimestamp=today] the date or timestamp for the date to describe
5184
- * @returns human-readable description of the date
5185
- */
5186
- const getHumanReadableDate = (dateOrTimestamp) => {
5187
- // Get the date info
5188
- const { month, day, year, } = getTimeInfoInET(dateOrTimestamp);
5189
- const currYear = getTimeInfoInET().year;
5190
- // Get the short month description
5191
- const monthName = getMonthName(month).short;
5192
- // Create start of description
5193
- let description = `${monthName} ${day}${getOrdinal(day)}`;
5194
- // Add on year if it's different
5195
- if (year !== currYear) {
5196
- description += ` ${year}`;
5197
- }
5198
- // Return description
5199
- return description;
5200
- };
5201
-
5202
5231
  /**
5203
5232
  * Get the current part of day (morning, evening, etc.)
5204
5233
  * @author Gabe Abrams