dce-reactkit 3.2.2-beta.17 → 3.2.2-beta.19

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.
@@ -10,7 +10,7 @@ declare const LogBuiltInMetadata: {
10
10
  ClientFatalError: string;
11
11
  };
12
12
  Target: {
13
- NoSpecificTarget: string;
13
+ NoTarget: string;
14
14
  };
15
15
  };
16
16
  export default LogBuiltInMetadata;
package/dist/index.d.ts CHANGED
@@ -1028,7 +1028,7 @@ declare const LogBuiltInMetadata: {
1028
1028
  ClientFatalError: string;
1029
1029
  };
1030
1030
  Target: {
1031
- NoSpecificTarget: string;
1031
+ NoTarget: string;
1032
1032
  };
1033
1033
  };
1034
1034
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dce-reactkit",
3
- "version": "3.2.2-beta.17",
3
+ "version": "3.2.2-beta.19",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -553,8 +553,10 @@ const LogReviewer: React.FC<Props> = (props) => {
553
553
  (initContextFilterState[contextValue._] as { [k: string]: boolean })[LogBuiltInMetadata.Context.Uncategorized] = true;
554
554
  }
555
555
  });
556
- // Add uncategorized context
557
- initContextFilterState[LogBuiltInMetadata.Context.Uncategorized] = true;
556
+ // Add built-in contexts
557
+ Object.values(LogBuiltInMetadata.Context).forEach((context) => {
558
+ initContextFilterState[context] = true;
559
+ });
558
560
 
559
561
  // Create initial tag filter state
560
562
  const initTagFilterState: TagFilterState = {};
@@ -593,6 +595,10 @@ const LogReviewer: React.FC<Props> = (props) => {
593
595
  Object.values(LogAction).forEach((action) => {
594
596
  initActionErrorFilterState.action[action] = true;
595
597
  });
598
+ // Add built-in targets
599
+ Object.values(LogBuiltInMetadata.Target).forEach((target) => {
600
+ initActionErrorFilterState.target[target] = true;
601
+ });
596
602
 
597
603
  // Initial state
598
604
  const initialState: State = {
@@ -971,11 +977,7 @@ const LogReviewer: React.FC<Props> = (props) => {
971
977
  );
972
978
  const item: PickableItem = {
973
979
  id: context,
974
- name: (
975
- (context === LogBuiltInMetadata.Context.Uncategorized)
976
- ? 'Uncategorized'
977
- : context
978
- ),
980
+ name: genHumanReadableName(context),
979
981
  isGroup: true,
980
982
  children,
981
983
  };
@@ -989,6 +991,8 @@ const LogReviewer: React.FC<Props> = (props) => {
989
991
  title="Context"
990
992
  items={pickableItems}
991
993
  onChanged={(updatedItems) => {
994
+ console.log('Items before:', pickableItems);
995
+ console.log('Updated Items:', updatedItems);
992
996
  // Update our state
993
997
  updatedItems.forEach((pickableItem) => {
994
998
  if (pickableItem.isGroup) {
@@ -539,7 +539,7 @@ const genRouteHandler = (
539
539
  type: LogType.Action,
540
540
  target: (
541
541
  (opts as any).target
542
- ?? LogBuiltInMetadata.Target.NoSpecificTarget
542
+ ?? LogBuiltInMetadata.Target.NoTarget
543
543
  ),
544
544
  action: (
545
545
  (opts as any).action
@@ -53,7 +53,7 @@ const logClientEvent: LogFunction = async (opts) => {
53
53
  (opts as any).action
54
54
  ? (
55
55
  (opts as any).target
56
- ?? LogBuiltInMetadata.Target.NoSpecificTarget
56
+ ?? LogBuiltInMetadata.Target.NoTarget
57
57
  )
58
58
  : undefined
59
59
  ),
@@ -5,14 +5,14 @@
5
5
  const LogBuiltInMetadata = {
6
6
  // Contexts
7
7
  Context: {
8
- Uncategorized: 'n/a',
9
- ServerRenderedErrorPage: '_server-rendered-error-page',
10
- ServerEndpointError: '_server-endpoint-error',
11
- ClientFatalError: '_client-fatal-error',
8
+ Uncategorized: 'Uncategorized',
9
+ ServerRenderedErrorPage: 'ServerRenderedErrorPage',
10
+ ServerEndpointError: 'ServerEndpointError',
11
+ ClientFatalError: 'ClientFatalError',
12
12
  },
13
13
  // Targets
14
14
  Target: {
15
- NoSpecificTarget: 'n/a',
15
+ NoTarget: 'NoTarget',
16
16
  },
17
17
  };
18
18