dce-reactkit 3.2.4 → 3.2.6
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 +65 -28
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/ButtonInputGroup.d.ts +1 -0
- package/dist/esm/index.js +65 -28
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/ButtonInputGroup.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/ButtonInputGroup.tsx +12 -1
- package/src/components/LogReviewer.tsx +94 -54
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -20,6 +20,8 @@ type Props = {
|
|
|
20
20
|
children: React.ReactNode,
|
|
21
21
|
// Additional class names to add to the outer container
|
|
22
22
|
className?: string,
|
|
23
|
+
// If true, wrap buttons and create gaps
|
|
24
|
+
wrapButtonsAndAddGaps?: boolean,
|
|
23
25
|
};
|
|
24
26
|
|
|
25
27
|
/*------------------------------------------------------------------------*/
|
|
@@ -39,6 +41,7 @@ const ButtonInputGroup: React.FC<Props> = (props) => {
|
|
|
39
41
|
minLabelWidth,
|
|
40
42
|
children,
|
|
41
43
|
className,
|
|
44
|
+
wrapButtonsAndAddGaps,
|
|
42
45
|
} = props;
|
|
43
46
|
|
|
44
47
|
/*------------------------------------------------------------------------*/
|
|
@@ -77,7 +80,15 @@ const ButtonInputGroup: React.FC<Props> = (props) => {
|
|
|
77
80
|
borderLeftWidth: 0,
|
|
78
81
|
}}
|
|
79
82
|
>
|
|
80
|
-
{
|
|
83
|
+
{
|
|
84
|
+
wrapButtonsAndAddGaps
|
|
85
|
+
? (
|
|
86
|
+
<div className="d-flex gap-1 flex-wrap">
|
|
87
|
+
{children}
|
|
88
|
+
</div>
|
|
89
|
+
)
|
|
90
|
+
: children
|
|
91
|
+
}
|
|
81
92
|
</span>
|
|
82
93
|
</div>
|
|
83
94
|
</div>
|
|
@@ -467,7 +467,7 @@ const columns: IntelliTableColumn[] = [
|
|
|
467
467
|
*/
|
|
468
468
|
const genHumanReadableName = (machineReadableName: string) => {
|
|
469
469
|
let humanReadableName = '';
|
|
470
|
-
|
|
470
|
+
|
|
471
471
|
// Add chars and spaces
|
|
472
472
|
const chars = machineReadableName.split('');
|
|
473
473
|
chars.forEach((char) => {
|
|
@@ -477,9 +477,49 @@ const genHumanReadableName = (machineReadableName: string) => {
|
|
|
477
477
|
}
|
|
478
478
|
humanReadableName += char;
|
|
479
479
|
});
|
|
480
|
+
const words = (
|
|
481
|
+
humanReadableName
|
|
482
|
+
.trim()
|
|
483
|
+
// Split into words
|
|
484
|
+
.split(' ')
|
|
485
|
+
// Filter out whitespace
|
|
486
|
+
.filter((word) => {
|
|
487
|
+
return (word.length > 0);
|
|
488
|
+
})
|
|
489
|
+
// Capitalize first letter
|
|
490
|
+
.map((word) => {
|
|
491
|
+
if (word.length <= 1) {
|
|
492
|
+
return word;
|
|
493
|
+
}
|
|
494
|
+
return `${word.substring(0, 1).toUpperCase()}${word.substring(1)}`;
|
|
495
|
+
})
|
|
496
|
+
);
|
|
480
497
|
|
|
481
|
-
//
|
|
482
|
-
|
|
498
|
+
// Handle acronyms by piling words together
|
|
499
|
+
const consolidatedWords: string[] = [];
|
|
500
|
+
let acronym = '';
|
|
501
|
+
words.forEach((word) => {
|
|
502
|
+
if (word.length === 1) {
|
|
503
|
+
// Add on to acronym
|
|
504
|
+
acronym += word;
|
|
505
|
+
} else {
|
|
506
|
+
// Wrap up acronym
|
|
507
|
+
if (acronym.length > 0) {
|
|
508
|
+
consolidatedWords.push(acronym);
|
|
509
|
+
acronym = '';
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
// Full word. Just add it
|
|
513
|
+
consolidatedWords.push(word);
|
|
514
|
+
}
|
|
515
|
+
});
|
|
516
|
+
// Add trailing acronym
|
|
517
|
+
if (acronym.length > 0) {
|
|
518
|
+
consolidatedWords.push(acronym);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
// Return
|
|
522
|
+
return consolidatedWords.join(' ');
|
|
483
523
|
};
|
|
484
524
|
|
|
485
525
|
/*------------------------------------------------------------------------*/
|
|
@@ -1373,61 +1413,61 @@ const LogReviewer: React.FC<Props> = (props) => {
|
|
|
1373
1413
|
<ButtonInputGroup
|
|
1374
1414
|
label="Action"
|
|
1375
1415
|
className="mb-2"
|
|
1416
|
+
wrapButtonsAndAddGaps
|
|
1376
1417
|
>
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
}
|
|
1401
|
-
</div>
|
|
1418
|
+
{
|
|
1419
|
+
Object.keys(LogAction)
|
|
1420
|
+
.map((action) => {
|
|
1421
|
+
const description = genHumanReadableName(action);
|
|
1422
|
+
return (
|
|
1423
|
+
<CheckboxButton
|
|
1424
|
+
key={action}
|
|
1425
|
+
id={`LogReviewer-action-${action}-checkbox`}
|
|
1426
|
+
text={description}
|
|
1427
|
+
ariaLabel={`include logs with action type "${description}" in results`}
|
|
1428
|
+
noMarginOnRight
|
|
1429
|
+
checked={actionErrorFilterState.action[action]}
|
|
1430
|
+
onChanged={(checked) => {
|
|
1431
|
+
actionErrorFilterState.action[action] = checked;
|
|
1432
|
+
dispatch({
|
|
1433
|
+
type: ActionType.UpdateActionErrorFilterState,
|
|
1434
|
+
actionErrorFilterState,
|
|
1435
|
+
});
|
|
1436
|
+
}}
|
|
1437
|
+
/>
|
|
1438
|
+
);
|
|
1439
|
+
})
|
|
1440
|
+
}
|
|
1402
1441
|
</ButtonInputGroup>
|
|
1403
1442
|
{/* Target */}
|
|
1404
|
-
<ButtonInputGroup
|
|
1443
|
+
<ButtonInputGroup
|
|
1444
|
+
label="Target"
|
|
1445
|
+
wrapButtonsAndAddGaps
|
|
1446
|
+
>
|
|
1405
1447
|
{/* List of targets */}
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
}
|
|
1430
|
-
</div>
|
|
1448
|
+
{
|
|
1449
|
+
Object.keys(targetMap)
|
|
1450
|
+
.map((target) => {
|
|
1451
|
+
const description = genHumanReadableName(target);
|
|
1452
|
+
return (
|
|
1453
|
+
<CheckboxButton
|
|
1454
|
+
key={target}
|
|
1455
|
+
id={`LogReviewer-target-${target}-checkbox`}
|
|
1456
|
+
text={description}
|
|
1457
|
+
ariaLabel={`include logs with target "${description}" in results`}
|
|
1458
|
+
checked={actionErrorFilterState.target[target]}
|
|
1459
|
+
noMarginOnRight
|
|
1460
|
+
onChanged={(checked) => {
|
|
1461
|
+
actionErrorFilterState.target[target] = checked;
|
|
1462
|
+
dispatch({
|
|
1463
|
+
type: ActionType.UpdateActionErrorFilterState,
|
|
1464
|
+
actionErrorFilterState,
|
|
1465
|
+
});
|
|
1466
|
+
}}
|
|
1467
|
+
/>
|
|
1468
|
+
);
|
|
1469
|
+
})
|
|
1470
|
+
}
|
|
1431
1471
|
</ButtonInputGroup>
|
|
1432
1472
|
</TabBox>
|
|
1433
1473
|
)
|