dce-reactkit 3.2.2-beta.18 → 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.18",
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",
@@ -257,17 +257,6 @@ const style = `
257
257
  }
258
258
  `;
259
259
 
260
- /*------------------------------------------------------------------------*/
261
- /* Constants */
262
- /*------------------------------------------------------------------------*/
263
-
264
- const builtInContextToName = {
265
- [LogBuiltInMetadata.Context.Uncategorized]: 'Uncategorized',
266
- [LogBuiltInMetadata.Context.ServerRenderedErrorPage]: 'Server Rendered Error Page',
267
- [LogBuiltInMetadata.Context.ServerEndpointError]: 'Server Endpoint Error',
268
- [LogBuiltInMetadata.Context.ClientFatalError]: 'Client Fatal Error',
269
- };
270
-
271
260
  /*------------------------------------------------------------------------*/
272
261
  /* Static Functions */
273
262
  /*------------------------------------------------------------------------*/
@@ -564,8 +553,10 @@ const LogReviewer: React.FC<Props> = (props) => {
564
553
  (initContextFilterState[contextValue._] as { [k: string]: boolean })[LogBuiltInMetadata.Context.Uncategorized] = true;
565
554
  }
566
555
  });
567
- // Add uncategorized context
568
- initContextFilterState[LogBuiltInMetadata.Context.Uncategorized] = true;
556
+ // Add built-in contexts
557
+ Object.values(LogBuiltInMetadata.Context).forEach((context) => {
558
+ initContextFilterState[context] = true;
559
+ });
569
560
 
570
561
  // Create initial tag filter state
571
562
  const initTagFilterState: TagFilterState = {};
@@ -604,6 +595,10 @@ const LogReviewer: React.FC<Props> = (props) => {
604
595
  Object.values(LogAction).forEach((action) => {
605
596
  initActionErrorFilterState.action[action] = true;
606
597
  });
598
+ // Add built-in targets
599
+ Object.values(LogBuiltInMetadata.Target).forEach((target) => {
600
+ initActionErrorFilterState.target[target] = true;
601
+ });
607
602
 
608
603
  // Initial state
609
604
  const initialState: State = {
@@ -982,10 +977,7 @@ const LogReviewer: React.FC<Props> = (props) => {
982
977
  );
983
978
  const item: PickableItem = {
984
979
  id: context,
985
- name: (
986
- builtInContextToName[context]
987
- ?? genHumanReadableName(context)
988
- ),
980
+ name: genHumanReadableName(context),
989
981
  isGroup: true,
990
982
  children,
991
983
  };
@@ -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