dce-reactkit 3.2.2-beta.41 → 3.2.2-beta.44
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 +46 -28
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/IntelliTable.d.ts +1 -0
- package/dist/esm/index.js +46 -28
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/IntelliTable.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/CSVDownloadButton.tsx +1 -1
- package/src/components/IntelliTable.tsx +13 -1
- package/src/components/LogReviewer.tsx +22 -1
- package/src/helpers/genCSV.ts +1 -0
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -70,7 +70,7 @@ const CSVDownloadButton: React.FC<Props> = (props) => {
|
|
|
70
70
|
<a
|
|
71
71
|
id={id}
|
|
72
72
|
download={filename}
|
|
73
|
-
href={`data:application/octet-stream,${csv}`}
|
|
73
|
+
href={`data:application/octet-stream,${encodeURIComponent(csv)}`}
|
|
74
74
|
className={`CSVDownloadButton-button ${className ?? 'btn btn-secondary'}`}
|
|
75
75
|
aria-label={(
|
|
76
76
|
ariaLabel
|
|
@@ -51,6 +51,8 @@ type Props = {
|
|
|
51
51
|
}[],
|
|
52
52
|
// Column information
|
|
53
53
|
columns: IntelliTableColumn[],
|
|
54
|
+
// Name of the CSV file. If excluded, title is used
|
|
55
|
+
csvName?: string,
|
|
54
56
|
};
|
|
55
57
|
|
|
56
58
|
// Sort types
|
|
@@ -192,6 +194,16 @@ const IntelliTable: React.FC<Props> = (props) => {
|
|
|
192
194
|
: [{ id: 'empty-row' }]
|
|
193
195
|
);
|
|
194
196
|
|
|
197
|
+
// Get CSV filename
|
|
198
|
+
let filename = `${title}.csv`;
|
|
199
|
+
if (props.csvName) {
|
|
200
|
+
filename = (
|
|
201
|
+
props.csvName.endsWith('.csv')
|
|
202
|
+
? props.csvName
|
|
203
|
+
: `${props.csvName}.csv`
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
195
207
|
/* -------------- State ------------- */
|
|
196
208
|
|
|
197
209
|
// Initial state
|
|
@@ -633,7 +645,7 @@ const IntelliTable: React.FC<Props> = (props) => {
|
|
|
633
645
|
<CSVDownloadButton
|
|
634
646
|
aria-label={`download data as csv for ${title}`}
|
|
635
647
|
id={`IntelliTable-${id}-download-as-csv`}
|
|
636
|
-
filename={
|
|
648
|
+
filename={filename}
|
|
637
649
|
csv={csv}
|
|
638
650
|
/>
|
|
639
651
|
{/* Show/Hide Columns */}
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
import visitServerEndpoint from '../helpers/visitServerEndpoint';
|
|
23
23
|
import getTimeInfoInET from '../helpers/getTimeInfoInET';
|
|
24
24
|
import { alert, showFatalError } from './AppWrapper';
|
|
25
|
+
import getHumanReadableDate from '../helpers/getHumanReadableDate';
|
|
25
26
|
|
|
26
27
|
// Import shared constants
|
|
27
28
|
import LOG_REVIEW_ROUTE_PATH_PREFIX from '../constants/LOG_REVIEW_ROUTE_PATH_PREFIX';
|
|
@@ -901,7 +902,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
901
902
|
<button
|
|
902
903
|
type="button"
|
|
903
904
|
id="LogReviewer-toggle-advanced-filter-drawer"
|
|
904
|
-
className={`btn btn-${FilterDrawer.Advanced === expandedFilterDrawer ? 'warning' : 'light'}`}
|
|
905
|
+
className={`btn btn-${FilterDrawer.Advanced === expandedFilterDrawer ? 'warning' : 'light'} me-2`}
|
|
905
906
|
aria-label="toggle advanced filter drawer"
|
|
906
907
|
onClick={() => {
|
|
907
908
|
dispatch({
|
|
@@ -916,6 +917,25 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
916
917
|
/>
|
|
917
918
|
Advanced
|
|
918
919
|
</button>
|
|
920
|
+
{/* Reset */}
|
|
921
|
+
<button
|
|
922
|
+
type="button"
|
|
923
|
+
id="LogReviewer-reset-filters-button"
|
|
924
|
+
className="btn btn-light"
|
|
925
|
+
aria-label="reset filters"
|
|
926
|
+
onClick={() => {
|
|
927
|
+
dispatch({
|
|
928
|
+
type: ActionType.ResetFilters,
|
|
929
|
+
initActionErrorFilterState,
|
|
930
|
+
initAdvancedFilterState,
|
|
931
|
+
initContextFilterState,
|
|
932
|
+
initDateFilterState,
|
|
933
|
+
initTagFilterState,
|
|
934
|
+
});
|
|
935
|
+
}}
|
|
936
|
+
>
|
|
937
|
+
Reset All
|
|
938
|
+
</button>
|
|
919
939
|
</div>
|
|
920
940
|
</div>
|
|
921
941
|
);
|
|
@@ -2131,6 +2151,7 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
2131
2151
|
const dataTable = (
|
|
2132
2152
|
<IntelliTable
|
|
2133
2153
|
title="Matching Logs:"
|
|
2154
|
+
csvName={`Logs from ${getHumanReadableDate()}`}
|
|
2134
2155
|
id="logs"
|
|
2135
2156
|
data={logs}
|
|
2136
2157
|
columns={columns}
|