dce-reactkit 3.2.2-beta.52 → 3.2.2-beta.54

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dce-reactkit",
3
- "version": "3.2.2-beta.52",
3
+ "version": "3.2.2-beta.54",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -765,7 +765,7 @@ const LogReviewer: React.FC<Props> = (props) => {
765
765
 
766
766
  // Create initial context filter state
767
767
  const initContextFilterState: ContextFilterState = {};
768
- Object.keys(LogMetadata.Context ?? {}).forEach((context) => {
768
+ Object.keys(contextMap).forEach((context) => {
769
769
  const contextValue = (LogMetadata.Context ?? {})[context];
770
770
  if (typeof contextValue === 'string') {
771
771
  // Case: no subcontexts, init as checked
@@ -816,16 +816,12 @@ const LogReviewer: React.FC<Props> = (props) => {
816
816
  target: {},
817
817
  action: {},
818
818
  };
819
- Object.values(LogMetadata.Target ?? {}).forEach((target) => {
819
+ Object.values(targetMap).forEach((target) => {
820
820
  initActionErrorFilterState.target[target] = true;
821
821
  });
822
822
  Object.values(LogAction).forEach((action) => {
823
823
  initActionErrorFilterState.action[action] = true;
824
824
  });
825
- // Add built-in targets
826
- Object.values(LogBuiltInMetadata.Target).forEach((target) => {
827
- initActionErrorFilterState.target[target] = true;
828
- });
829
825
 
830
826
  // Initial state
831
827
  const initialState: State = {
@@ -1195,7 +1191,7 @@ const LogReviewer: React.FC<Props> = (props) => {
1195
1191
  } else if (expandedFilterDrawer === FilterDrawer.Context) {
1196
1192
  // Create item picker items
1197
1193
  const builtInPickableItem: PickableItem = {
1198
- id: '_',
1194
+ id: 'built-in-contexts',
1199
1195
  name: 'Auto-logged',
1200
1196
  isGroup: true,
1201
1197
  children: [],
@@ -1203,7 +1199,7 @@ const LogReviewer: React.FC<Props> = (props) => {
1203
1199
  const pickableItems: PickableItem[] = [];
1204
1200
  Object.keys(contextMap)
1205
1201
  .forEach((context) => {
1206
- const value = (contextMap)[context];
1202
+ const value = contextMap[context];
1207
1203
  if (typeof value === 'string') {
1208
1204
  // No subcategories
1209
1205
  const item: PickableItem = {
@@ -1222,6 +1218,7 @@ const LogReviewer: React.FC<Props> = (props) => {
1222
1218
  // Add to pickable items list
1223
1219
  pickableItems.push(item);
1224
1220
  }
1221
+ return;
1225
1222
  }
1226
1223
 
1227
1224
  // Has subcategories
@@ -1263,8 +1260,7 @@ const LogReviewer: React.FC<Props> = (props) => {
1263
1260
  if (pickableItem.isGroup) {
1264
1261
  // Has subcontexts
1265
1262
 
1266
-
1267
- if (pickableItem.id === '_') {
1263
+ if (pickableItem.id === 'built-in-contexts') {
1268
1264
  // Built-in
1269
1265
 
1270
1266
  // Treat as if these were top-level contexts
@@ -1305,32 +1301,35 @@ const LogReviewer: React.FC<Props> = (props) => {
1305
1301
  filterDrawer = (
1306
1302
  <TabBox title="Tags">
1307
1303
  <div>
1308
- If any are selected, logs must contain at least one
1309
- but not necessarily all of the
1304
+ If any tags are selected, logs must contain at least one
1305
+ (but not necessarily all) of the
1310
1306
  selected tags.
1311
1307
  </div>
1312
- {
1313
- Object.keys(LogMetadata.Tag ?? {})
1314
- .map((tag, i) => {
1315
- const description = genHumanReadableName(tag);
1316
- return (
1317
- <CheckboxButton
1318
- id={`LogReviewer-tag-${tag}-checkbox`}
1319
- text={description}
1320
- ariaLabel={`require that logs be tagged with "${description}" or any other selected tag`}
1321
- noMarginOnRight={i === Object.keys(tagFilterState).length - 1}
1322
- checked={tagFilterState[tag]}
1323
- onChanged={(checked) => {
1324
- tagFilterState[tag] = checked;
1325
- dispatch({
1326
- type: ActionType.UpdateTagFilterState,
1327
- tagFilterState,
1328
- });
1329
- }}
1330
- />
1331
- );
1332
- })
1333
- }
1308
+ <div className="d-flex gap-1 flex-wrap">
1309
+ {
1310
+ Object.keys(LogMetadata.Tag ?? {})
1311
+ .map((tag) => {
1312
+ const description = genHumanReadableName(tag);
1313
+ return (
1314
+ <CheckboxButton
1315
+ key={tag}
1316
+ id={`LogReviewer-tag-${tag}-checkbox`}
1317
+ text={description}
1318
+ ariaLabel={`require that logs be tagged with "${description}" or any other selected tag`}
1319
+ checked={tagFilterState[tag]}
1320
+ onChanged={(checked) => {
1321
+ tagFilterState[tag] = checked;
1322
+ console.log(tagFilterState);
1323
+ dispatch({
1324
+ type: ActionType.UpdateTagFilterState,
1325
+ tagFilterState,
1326
+ });
1327
+ }}
1328
+ />
1329
+ );
1330
+ })
1331
+ }
1332
+ </div>
1334
1333
  </TabBox>
1335
1334
  );
1336
1335
  } else if (expandedFilterDrawer === FilterDrawer.Action) {
@@ -1407,7 +1406,6 @@ const LogReviewer: React.FC<Props> = (props) => {
1407
1406
  checked={actionErrorFilterState.action[action]}
1408
1407
  onChanged={(checked) => {
1409
1408
  actionErrorFilterState.action[action] = checked;
1410
- console.log(actionErrorFilterState, action, checked);
1411
1409
  dispatch({
1412
1410
  type: ActionType.UpdateActionErrorFilterState,
1413
1411
  actionErrorFilterState,
@@ -1437,7 +1435,6 @@ const LogReviewer: React.FC<Props> = (props) => {
1437
1435
  noMarginOnRight
1438
1436
  onChanged={(checked) => {
1439
1437
  actionErrorFilterState.target[target] = checked;
1440
- console.log(actionErrorFilterState, target, checked);
1441
1438
  dispatch({
1442
1439
  type: ActionType.UpdateActionErrorFilterState,
1443
1440
  actionErrorFilterState,
@@ -1513,7 +1510,7 @@ const LogReviewer: React.FC<Props> = (props) => {
1513
1510
  filterDrawer = (
1514
1511
  <>
1515
1512
  {/* User Info */}
1516
- <TabBox title="User Info">
1513
+ <TabBox title="User">
1517
1514
  {/* First Name */}
1518
1515
  <div className="input-group mb-2">
1519
1516
  <span className="input-group-text">
@@ -1646,7 +1643,7 @@ const LogReviewer: React.FC<Props> = (props) => {
1646
1643
  </TabBox>
1647
1644
 
1648
1645
  {/* Course Info */}
1649
- <TabBox title="Course Info">
1646
+ <TabBox title="Course">
1650
1647
  {/* Name */}
1651
1648
  <div className="input-group mb-2">
1652
1649
  <span className="input-group-text">
@@ -1697,7 +1694,7 @@ const LogReviewer: React.FC<Props> = (props) => {
1697
1694
  </TabBox>
1698
1695
 
1699
1696
  {/* Device Info */}
1700
- <TabBox title="Device Info">
1697
+ <TabBox title="Device">
1701
1698
  <ButtonInputGroup label="Device Type">
1702
1699
  <RadioButton
1703
1700
  text="All Devices"