dce-reactkit 3.2.2-beta.29 → 3.2.2-beta.30

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.29",
3
+ "version": "3.2.2-beta.30",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -122,7 +122,7 @@ type ContextFilterState = {
122
122
 
123
123
  // Tag filter state
124
124
  type TagFilterState = {
125
- [k: string]: boolean
125
+ [k: string]: boolean // tag => true if in the list of tags to show
126
126
  };
127
127
 
128
128
  // Action filter state (only relevant for action logs)
@@ -593,7 +593,7 @@ const LogReviewer: React.FC<Props> = (props) => {
593
593
  // Create initial tag filter state
594
594
  const initTagFilterState: TagFilterState = {};
595
595
  Object.values(LogMetadata.Tag ?? {}).forEach((tagValue) => {
596
- initTagFilterState[tagValue] = true;
596
+ initTagFilterState[tagValue] = false;
597
597
  });
598
598
 
599
599
  // Create advanced filter state
@@ -1043,7 +1043,6 @@ const LogReviewer: React.FC<Props> = (props) => {
1043
1043
  );
1044
1044
  }
1045
1045
  });
1046
- console.log('New context filter state:', contextFilterState);
1047
1046
  dispatch({
1048
1047
  type: ActionType.UpdateContextFilterState,
1049
1048
  contextFilterState,
@@ -1063,8 +1062,9 @@ const LogReviewer: React.FC<Props> = (props) => {
1063
1062
  <CheckboxButton
1064
1063
  id={`LogReviewer-tag-${tag}-checkbox`}
1065
1064
  text={description}
1066
- ariaLabel={`include logs tagged with "${description}" in results`}
1065
+ ariaLabel={`require that logs be tagged with "${description}" or any other selected tag`}
1067
1066
  noMarginOnRight={i === Object.keys(tagFilterState).length - 1}
1067
+ checked={tagFilterState[tag]}
1068
1068
  onChanged={(checked) => {
1069
1069
  tagFilterState[tag] = checked;
1070
1070
  }}
@@ -1675,7 +1675,14 @@ const LogReviewer: React.FC<Props> = (props) => {
1675
1675
 
1676
1676
  // No tags match
1677
1677
  if (
1678
- log.tags.every((tag) => {
1678
+ // At least one tag is required
1679
+ Object.values(tagFilterState)
1680
+ .filter((isSelected) => {
1681
+ return isSelected;
1682
+ })
1683
+ .length > 0
1684
+ // No tags match
1685
+ && log.tags.every((tag) => {
1679
1686
  return !tagFilterState[tag];
1680
1687
  })
1681
1688
  ) {