dce-reactkit 3.2.2-beta.41 → 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 = {};
@@ -3146,14 +3175,24 @@ const LogReviewer = (props) => {
3146
3175
  } },
3147
3176
  React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faHammer, className: "me-2" }),
3148
3177
  "Action"),
3149
- 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: () => {
3150
3179
  dispatch({
3151
3180
  type: ActionType.ToggleFilterDrawer,
3152
3181
  filterDrawer: FilterDrawer.Advanced,
3153
3182
  });
3154
3183
  } },
3155
3184
  React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faList, className: "me-2" }),
3156
- "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"))));
3157
3196
  // Filter drawer
3158
3197
  let filterDrawer;
3159
3198
  if (expandedFilterDrawer) {
@@ -3942,7 +3981,7 @@ const LogReviewer = (props) => {
3942
3981
  React__default["default"].createElement("div", null, "Either your filters are too strict or no matching logs have been created yet.")))
3943
3982
  : undefined);
3944
3983
  // Create intelliTable
3945
- 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 }));
3946
3985
  // Main body
3947
3986
  body = (React__default["default"].createElement(React__default["default"].Fragment, null,
3948
3987
  filters,
@@ -5189,29 +5228,6 @@ const startMinWait = (minWaitMs) => {
5189
5228
  });
5190
5229
  };
5191
5230
 
5192
- // Import shared helpers
5193
- /**
5194
- * Get a human-readable description of a date (all in ET)
5195
- * @author Gabe Abrams
5196
- * @param [dateOrTimestamp=today] the date or timestamp for the date to describe
5197
- * @returns human-readable description of the date
5198
- */
5199
- const getHumanReadableDate = (dateOrTimestamp) => {
5200
- // Get the date info
5201
- const { month, day, year, } = getTimeInfoInET(dateOrTimestamp);
5202
- const currYear = getTimeInfoInET().year;
5203
- // Get the short month description
5204
- const monthName = getMonthName(month).short;
5205
- // Create start of description
5206
- let description = `${monthName} ${day}${getOrdinal(day)}`;
5207
- // Add on year if it's different
5208
- if (year !== currYear) {
5209
- description += ` ${year}`;
5210
- }
5211
- // Return description
5212
- return description;
5213
- };
5214
-
5215
5231
  /**
5216
5232
  * Get the current part of day (morning, evening, etc.)
5217
5233
  * @author Gabe Abrams