dce-reactkit 3.2.2-beta.23 → 3.2.2-beta.24

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.23",
3
+ "version": "3.2.2-beta.24",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -524,6 +524,7 @@ const LogReviewer: React.FC<Props> = (props) => {
524
524
  // > Add "uncategorized" subcontext to each context
525
525
  Object.keys(LogMetadata.Context ?? {}).forEach((context) => {
526
526
  if (
527
+ // Context exists
527
528
  LogMetadata.Context
528
529
  // Context has children already
529
530
  && typeof LogMetadata.Context[context] !== 'string'
@@ -578,8 +579,10 @@ const LogReviewer: React.FC<Props> = (props) => {
578
579
  // Case: subcontexts exist
579
580
  initContextFilterState[contextValue._] = {};
580
581
  Object.values((LogMetadata.Context ?? {})[context]).forEach((subcontext) => {
581
- const subcontextValue = contextValue[subcontext];
582
- (initContextFilterState[contextValue._] as { [k: string]: boolean })[subcontextValue] = true;
582
+ if (subcontext) {
583
+ const subcontextValue = contextValue[subcontext];
584
+ (initContextFilterState[contextValue._] as { [k: string]: boolean })[subcontextValue] = true;
585
+ }
583
586
  });
584
587
  }
585
588
  });
@@ -1017,22 +1020,17 @@ const LogReviewer: React.FC<Props> = (props) => {
1017
1020
  title="Context"
1018
1021
  items={pickableItems}
1019
1022
  onChanged={(updatedItems) => {
1020
- console.log('Items before:', pickableItems);
1021
- console.log('Updated Items:', updatedItems);
1022
1023
  // Update our state
1023
1024
  updatedItems.forEach((pickableItem) => {
1024
1025
  if (pickableItem.isGroup) {
1025
1026
  // Has subcontexts
1026
1027
  pickableItem.children.forEach((subcontextItem) => {
1027
1028
  if (!subcontextItem.isGroup) {
1028
- console.log('Update child:', pickableItem.id, subcontextItem.id, subcontextItem.checked);
1029
- console.log(contextFilterState);
1030
1029
  (
1031
1030
  contextFilterState[pickableItem.id] as { [k: string]: boolean }
1032
1031
  )[subcontextItem.id] = (
1033
1032
  subcontextItem.checked
1034
1033
  );
1035
- console.log(contextFilterState);
1036
1034
  }
1037
1035
  });
1038
1036
  } else {
@@ -1042,6 +1040,7 @@ const LogReviewer: React.FC<Props> = (props) => {
1042
1040
  );
1043
1041
  }
1044
1042
  });
1043
+ console.log('New context filter state:', contextFilterState);
1045
1044
  dispatch({
1046
1045
  type: ActionType.UpdateContextFilterState,
1047
1046
  contextFilterState,