quidproquo-web-admin 0.1.1 → 0.1.2

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.
Files changed (112) hide show
  1. package/lib/commonjs/Auth/Auth.js +1 -1
  2. package/lib/commonjs/Auth/AuthChallengeMfaSetup/AuthChallengeMfaSetup.js +1 -1
  3. package/lib/commonjs/Auth/AuthChallengeNewPasswordRequired/AuthChallengeNewPasswordRequired.js +2 -2
  4. package/lib/commonjs/Auth/AuthChallengeSoftwareTokenMfa/AuthChallengeSoftwareTokenMfa.js +2 -2
  5. package/lib/commonjs/Auth/Login.js +2 -2
  6. package/lib/commonjs/Config/Config.js +3 -3
  7. package/lib/commonjs/LogViewer/ActionHistoryItem.js +1 -1
  8. package/lib/commonjs/LogViewer/ActionRender/ActionRender.js +3 -3
  9. package/lib/commonjs/LogViewer/AdminLogs/AdminLogGrid/AdminLogGrid.js +3 -3
  10. package/lib/commonjs/LogViewer/AdminLogs/AdminLogSearchBar/AdminLogSearchBar.js +4 -4
  11. package/lib/commonjs/LogViewer/AdminLogs/AdminLogs.js +1 -1
  12. package/lib/commonjs/LogViewer/Dashboard.js +8 -4
  13. package/lib/commonjs/LogViewer/EventTimeline.js +4 -4
  14. package/lib/commonjs/LogViewer/HelpChat/HelpChat.js +8 -7
  15. package/lib/commonjs/LogViewer/LogCorrelationTree.js +27 -24
  16. package/lib/commonjs/LogViewer/LogCorrelations.js +1 -1
  17. package/lib/commonjs/LogViewer/LogDetails.js +1 -1
  18. package/lib/commonjs/LogViewer/LogDialog/LogDialog.js +4 -4
  19. package/lib/commonjs/LogViewer/LogDialog/MovedToColdStorage/MovedToColdStorage.js +1 -1
  20. package/lib/commonjs/LogViewer/LogDialog/tabs/LogDetailsTab/LogDetailsTab.js +1 -1
  21. package/lib/commonjs/LogViewer/LogDialog/tabs/TimelineTab/TimelineTab.js +1 -1
  22. package/lib/commonjs/LogViewer/LogDialog/tabs/TreeTab/TreeTab.js +1 -1
  23. package/lib/commonjs/LogViewer/LogMetadataGrid.js +3 -3
  24. package/lib/commonjs/LogViewer/LogRawJson.js +1 -1
  25. package/lib/commonjs/LogViewer/LogSearch.js +1 -1
  26. package/lib/commonjs/LogViewer/LogSummary.js +2 -2
  27. package/lib/commonjs/LogViewer/LogSummaryDetails.js +4 -2
  28. package/lib/commonjs/LogViewer/LogSummaryReturn.js +1 -1
  29. package/lib/commonjs/LogViewer/TopSection.js +7 -7
  30. package/lib/commonjs/LogViewer/actionComponents/custom/CoreContextListCustomAction.js +1 -1
  31. package/lib/commonjs/LogViewer/actionComponents/custom/CoreLogCreateCustomAction.js +1 -1
  32. package/lib/commonjs/LogViewer/actionComponents/custom/CoreLogDisableEventHistoryCustomAction.js +1 -1
  33. package/lib/commonjs/LogViewer/actionComponents/custom/CoreLogTemplateLiteralCustomAction.js +1 -1
  34. package/lib/commonjs/LogViewer/actionComponents/custom/CoreNetworkRequestCustomAction.js +2 -2
  35. package/lib/commonjs/LogViewer/actionComponents/genericActionRenderer/ActionResultDisplay.js +1 -1
  36. package/lib/commonjs/LogViewer/actionComponents/genericActionRenderer/AnyVariableView/AnyVariableView.js +15 -15
  37. package/lib/commonjs/LogViewer/actionComponents/genericActionRenderer/getGenericActionRenderer.js +7 -4
  38. package/lib/commonjs/LogViewer/charts/CostPerService.js +1 -1
  39. package/lib/commonjs/LogViewer/charts/ErrorsByType.js +1 -1
  40. package/lib/commonjs/LogViewer/charts/ErrorsOverTime.js +1 -1
  41. package/lib/commonjs/LogViewer/charts/RequestsByService.js +2 -2
  42. package/lib/commonjs/LogViewer/hooks/useLogManagement.js +1 -1
  43. package/lib/commonjs/LogViewer/hooks/useLogTreeData.js +14 -11
  44. package/lib/commonjs/LogViewer/hooks/useServiceNames.js +6 -5
  45. package/lib/commonjs/components/AdminDialog.js +2 -2
  46. package/lib/commonjs/components/AsyncButton.js +1 -1
  47. package/lib/commonjs/components/AutocompleteInput.js +2 -2
  48. package/lib/commonjs/components/DataGrid.js +1 -1
  49. package/lib/commonjs/components/DataGridPagination/DataGridPagination.js +1 -1
  50. package/lib/commonjs/components/DateCell/DateCell.js +1 -1
  51. package/lib/commonjs/components/DateRangePicker.js +2 -2
  52. package/lib/commonjs/components/MainLayout/MainLayout.js +2 -2
  53. package/lib/commonjs/components/TextInput.js +2 -2
  54. package/lib/commonjs/tmp/RandomView.js +1 -1
  55. package/lib/commonjs/useFederatedAddon.js +7 -6
  56. package/lib/esm/Auth/Auth.js +1 -1
  57. package/lib/esm/Auth/AuthChallengeMfaSetup/AuthChallengeMfaSetup.js +1 -1
  58. package/lib/esm/Auth/AuthChallengeMfaSetup/logic/authActionCreator.js +1 -1
  59. package/lib/esm/Auth/AuthChallengeNewPasswordRequired/AuthChallengeNewPasswordRequired.js +1 -1
  60. package/lib/esm/Auth/AuthChallengeSoftwareTokenMfa/AuthChallengeSoftwareTokenMfa.js +1 -1
  61. package/lib/esm/Auth/Login.js +2 -2
  62. package/lib/esm/Config/Config.js +3 -3
  63. package/lib/esm/LogViewer/ActionHistoryItem.js +1 -1
  64. package/lib/esm/LogViewer/ActionRender/ActionRender.js +3 -3
  65. package/lib/esm/LogViewer/AdminLogs/AdminLogGrid/AdminLogGrid.js +3 -3
  66. package/lib/esm/LogViewer/AdminLogs/AdminLogSearchBar/AdminLogSearchBar.js +4 -4
  67. package/lib/esm/LogViewer/AdminLogs/AdminLogs.js +1 -1
  68. package/lib/esm/LogViewer/Dashboard.js +9 -5
  69. package/lib/esm/LogViewer/EventTimeline.js +4 -4
  70. package/lib/esm/LogViewer/HelpChat/HelpChat.js +9 -8
  71. package/lib/esm/LogViewer/LogCorrelationTree.js +27 -24
  72. package/lib/esm/LogViewer/LogCorrelations.js +1 -1
  73. package/lib/esm/LogViewer/LogDetails.js +1 -1
  74. package/lib/esm/LogViewer/LogDialog/LogDialog.js +4 -4
  75. package/lib/esm/LogViewer/LogDialog/MovedToColdStorage/MovedToColdStorage.js +1 -1
  76. package/lib/esm/LogViewer/LogDialog/tabs/LogDetailsTab/LogDetailsTab.js +1 -1
  77. package/lib/esm/LogViewer/LogDialog/tabs/TimelineTab/TimelineTab.js +1 -1
  78. package/lib/esm/LogViewer/LogDialog/tabs/TreeTab/TreeTab.js +1 -1
  79. package/lib/esm/LogViewer/LogMetadataGrid.js +3 -3
  80. package/lib/esm/LogViewer/LogRawJson.js +1 -1
  81. package/lib/esm/LogViewer/LogSearch.js +1 -1
  82. package/lib/esm/LogViewer/LogSummary.js +2 -2
  83. package/lib/esm/LogViewer/LogSummaryDetails.js +4 -2
  84. package/lib/esm/LogViewer/LogSummaryReturn.js +1 -1
  85. package/lib/esm/LogViewer/TopSection.js +7 -7
  86. package/lib/esm/LogViewer/actionComponents/custom/CoreContextListCustomAction.js +1 -1
  87. package/lib/esm/LogViewer/actionComponents/custom/CoreLogCreateCustomAction.js +1 -1
  88. package/lib/esm/LogViewer/actionComponents/custom/CoreLogDisableEventHistoryCustomAction.js +1 -1
  89. package/lib/esm/LogViewer/actionComponents/custom/CoreLogTemplateLiteralCustomAction.js +1 -1
  90. package/lib/esm/LogViewer/actionComponents/custom/CoreNetworkRequestCustomAction.js +2 -2
  91. package/lib/esm/LogViewer/actionComponents/genericActionRenderer/ActionResultDisplay.js +1 -1
  92. package/lib/esm/LogViewer/actionComponents/genericActionRenderer/AnyVariableView/AnyVariableView.js +15 -15
  93. package/lib/esm/LogViewer/actionComponents/genericActionRenderer/getGenericActionRenderer.js +7 -4
  94. package/lib/esm/LogViewer/charts/CostPerService.js +1 -1
  95. package/lib/esm/LogViewer/charts/ErrorsByType.js +1 -1
  96. package/lib/esm/LogViewer/charts/ErrorsOverTime.js +1 -1
  97. package/lib/esm/LogViewer/charts/RequestsByService.js +2 -2
  98. package/lib/esm/LogViewer/hooks/useLogManagement.js +1 -1
  99. package/lib/esm/LogViewer/hooks/useLogTreeData.js +15 -12
  100. package/lib/esm/LogViewer/hooks/useServiceNames.js +7 -6
  101. package/lib/esm/components/AdminDialog.js +2 -2
  102. package/lib/esm/components/AsyncButton.js +1 -1
  103. package/lib/esm/components/AutocompleteInput.js +2 -2
  104. package/lib/esm/components/DataGrid.js +1 -1
  105. package/lib/esm/components/DataGridPagination/DataGridPagination.js +1 -1
  106. package/lib/esm/components/DateCell/DateCell.js +1 -1
  107. package/lib/esm/components/DateRangePicker.js +2 -2
  108. package/lib/esm/components/MainLayout/MainLayout.js +2 -2
  109. package/lib/esm/components/TextInput.js +2 -2
  110. package/lib/esm/tmp/RandomView.js +1 -1
  111. package/lib/esm/useFederatedAddon.js +8 -7
  112. package/package.json +6 -6
@@ -29,20 +29,20 @@ export function TopSection({ onSearch }) {
29
29
  updateStartAndEndTimeSpan(minutes);
30
30
  handleQuickTimeClose();
31
31
  };
32
- return (_jsxs(LocalizationProvider, { dateAdapter: AdapterDateFns, children: [_jsxs(Grid, { container: true, columns: 12, spacing: 2, children: [_jsx(Grid, { item: true, xs: 2, children: _jsxs(FormControl, { fullWidth: true, children: [_jsx(InputLabel, { id: "runtime-select-label", children: "Runtime Type" }), _jsx(Select, { labelId: "runtime-select-label", id: "demo-simple-select", value: runtimeType, label: "Runtime Type", onChange: handleRuntimeTypeOnChange, children: RuntimeTypes.map((key) => (_jsx(MenuItem, { value: key, children: key }, key))) })] }) }), _jsx(Grid, { item: true, xs: 2, children: _jsx(FormControl, { fullWidth: true, children: _jsx(Autocomplete, { getOptionLabel: (option) => option.label, options: serviceOptions, value: serviceOptions.find((o) => o.value === service) || null, onChange: handleServiceOnChange, renderInput: (params) => (_jsx(TextField, { ...params, label: "Service Name", InputLabelProps: {
32
+ return (_jsxs(LocalizationProvider, { dateAdapter: AdapterDateFns, children: [_jsxs(Grid, { columns: 12, container: true, spacing: 2, children: [_jsx(Grid, { item: true, xs: 2, children: _jsxs(FormControl, { fullWidth: true, children: [_jsx(InputLabel, { id: "runtime-select-label", children: "Runtime Type" }), _jsx(Select, { id: "demo-simple-select", label: "Runtime Type", labelId: "runtime-select-label", onChange: handleRuntimeTypeOnChange, value: runtimeType, children: RuntimeTypes.map((key) => (_jsx(MenuItem, { value: key, children: key }, key))) })] }) }), _jsx(Grid, { item: true, xs: 2, children: _jsx(FormControl, { fullWidth: true, children: _jsx(Autocomplete, { getOptionLabel: (option) => option.label, onChange: handleServiceOnChange, options: serviceOptions, renderInput: (params) => (_jsx(TextField, { ...params, InputLabelProps: {
33
33
  shrink: true,
34
- } })) }) }) }), _jsx(Grid, { item: true, xs: 2, children: _jsxs(Box, { position: "relative", children: [_jsx(FormControl, { fullWidth: true, children: _jsx(DateTimePicker, { label: "Start DateTime", value: startDate, onChange: handleStartDateChange }) }), _jsx(IconButton, { "aria-label": "quick time select", "aria-controls": "quick-time-menu", "aria-haspopup": "true", onClick: handleQuickTimeClick, sx: {
34
+ }, label: "Service Name" })), value: serviceOptions.find((o) => o.value === service) || null }) }) }), _jsx(Grid, { item: true, xs: 2, children: _jsxs(Box, { position: "relative", children: [_jsx(FormControl, { fullWidth: true, children: _jsx(DateTimePicker, { label: "Start DateTime", onChange: handleStartDateChange, value: startDate }) }), _jsx(IconButton, { "aria-controls": "quick-time-menu", "aria-haspopup": "true", "aria-label": "quick time select", onClick: handleQuickTimeClick, sx: {
35
35
  position: 'absolute',
36
36
  right: '-28px',
37
37
  top: '50%',
38
38
  transform: 'translateY(-50%)',
39
- }, children: _jsx(ExpandMoreIcon, {}) })] }) }), _jsx(Grid, { item: true, xs: 2, children: _jsx(FormControl, { fullWidth: true, children: _jsx(DateTimePicker, { label: "End DateTime", value: endDate, onChange: handleEndDateChange }) }) }), _jsx(Grid, { item: true, xs: 4, children: _jsx(FormControl, { fullWidth: true, children: _jsx(TextField, { label: "User", value: user, onChange: handleUserOnChange, InputLabelProps: {
39
+ }, children: _jsx(ExpandMoreIcon, {}) })] }) }), _jsx(Grid, { item: true, xs: 2, children: _jsx(FormControl, { fullWidth: true, children: _jsx(DateTimePicker, { label: "End DateTime", onChange: handleEndDateChange, value: endDate }) }) }), _jsx(Grid, { item: true, xs: 4, children: _jsx(FormControl, { fullWidth: true, children: _jsx(TextField, { InputLabelProps: {
40
40
  shrink: true,
41
- } }) }) }), _jsx(Grid, { item: true, xs: 6, children: _jsx(FormControl, { fullWidth: true, children: _jsx(TextField, { label: "Info", value: info, onChange: handleInfoOnChange, InputLabelProps: {
41
+ }, label: "User", onChange: handleUserOnChange, value: user }) }) }), _jsx(Grid, { item: true, xs: 6, children: _jsx(FormControl, { fullWidth: true, children: _jsx(TextField, { InputLabelProps: {
42
42
  shrink: true,
43
- } }) }) }), _jsx(Grid, { item: true, xs: 6, children: _jsx(FormControl, { fullWidth: true, children: _jsx(TextField, { label: "Error Filter", value: error, onChange: handleErrorOnChange, InputLabelProps: {
43
+ }, label: "Info", onChange: handleInfoOnChange, value: info }) }) }), _jsx(Grid, { item: true, xs: 6, children: _jsx(FormControl, { fullWidth: true, children: _jsx(TextField, { InputLabelProps: {
44
44
  shrink: true,
45
- } }) }) }), _jsx(Grid, { item: true, xs: 10, children: _jsx(FormControl, { fullWidth: true, children: _jsx(TextField, { label: "Deep Search", value: deep, onChange: handleDeepOnChange, placeholder: "Use with caution, reduce results with above fields first, this is a contains search on the log JSON, so it will be slow.", InputLabelProps: {
45
+ }, label: "Error Filter", onChange: handleErrorOnChange, value: error }) }) }), _jsx(Grid, { item: true, xs: 10, children: _jsx(FormControl, { fullWidth: true, children: _jsx(TextField, { InputLabelProps: {
46
46
  shrink: true,
47
- } }) }) }), _jsx(Grid, { item: true, xs: 2, children: _jsx(AsyncButton, { onClick: () => onSearch(), children: "Search" }) })] }), _jsxs(Menu, { id: "quick-time-menu", anchorEl: anchorEl, keepMounted: true, open: Boolean(anchorEl), onClose: handleQuickTimeClose, children: [_jsx(MenuItem, { onClick: () => handleQuickTimeSelect(5), children: "Last 5 minutes" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(30), children: "Last 30 minutes" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(1 * 60), children: "Last hour" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(3 * 60), children: "Last 3 hours" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(8 * 60), children: "Last 8 hours" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(16 * 60), children: "Last 16 hours" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(24 * 60), children: "Last 24 hours" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(7 * 24 * 60), children: "Last 7 days" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(30 * 24 * 60), children: "Last month" })] })] }));
47
+ }, label: "Deep Search", onChange: handleDeepOnChange, placeholder: "Use with caution, reduce results with above fields first, this is a contains search on the log JSON, so it will be slow.", value: deep }) }) }), _jsx(Grid, { item: true, xs: 2, children: _jsx(AsyncButton, { onClick: () => onSearch(), children: "Search" }) })] }), _jsxs(Menu, { anchorEl: anchorEl, id: "quick-time-menu", keepMounted: true, onClose: handleQuickTimeClose, open: Boolean(anchorEl), children: [_jsx(MenuItem, { onClick: () => handleQuickTimeSelect(5), children: "Last 5 minutes" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(30), children: "Last 30 minutes" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(1 * 60), children: "Last hour" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(3 * 60), children: "Last 3 hours" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(8 * 60), children: "Last 8 hours" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(16 * 60), children: "Last 16 hours" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(24 * 60), children: "Last 24 hours" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(7 * 24 * 60), children: "Last 7 days" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(30 * 24 * 60), children: "Last month" })] })] }));
48
48
  }
@@ -2,5 +2,5 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Box } from '@mui/material';
3
3
  import { AnyVariableView, genericFunctionRendererStyles } from '../genericActionRenderer';
4
4
  export const CoreContextListCustomAction = ({ result, expanded, }) => {
5
- return (_jsx(Box, { sx: { width: '100%', my: 1 }, children: _jsx("pre", { style: genericFunctionRendererStyles.pre, children: _jsx(AnyVariableView, { value: result, expanded: expanded }) }) }));
5
+ return (_jsx(Box, { sx: { width: '100%', my: 1 }, children: _jsx("pre", { style: genericFunctionRendererStyles.pre, children: _jsx(AnyVariableView, { expanded: expanded, value: result }) }) }));
6
6
  };
@@ -24,5 +24,5 @@ export const CoreLogCreateCustomAction = ({ action, expanded }) => {
24
24
  return null;
25
25
  }
26
26
  const { logLevel, msg, data } = action.payload;
27
- return (_jsx(Box, { sx: { width: '100%', my: 1 }, children: _jsxs(Alert, { severity: getSeverity(logLevel), children: [_jsx(Typography, { variant: "body1", fontWeight: "bold", children: resolveLookupText(logLevel, LogLevelEnum) }), _jsx(Typography, { variant: "body1", children: msg }), data && (_jsx(Typography, { variant: "body2", sx: { mt: 1, whiteSpace: 'pre-wrap' }, children: _jsx("pre", { style: genericFunctionRendererStyles.pre, children: _jsx(AnyVariableView, { value: data, expanded: expanded }) }) }))] }) }));
27
+ return (_jsx(Box, { sx: { width: '100%', my: 1 }, children: _jsxs(Alert, { severity: getSeverity(logLevel), children: [_jsx(Typography, { fontWeight: "bold", variant: "body1", children: resolveLookupText(logLevel, LogLevelEnum) }), _jsx(Typography, { variant: "body1", children: msg }), data && (_jsx(Typography, { sx: { mt: 1, whiteSpace: 'pre-wrap' }, variant: "body2", children: _jsx("pre", { style: genericFunctionRendererStyles.pre, children: _jsx(AnyVariableView, { expanded: expanded, value: data }) }) }))] }) }));
28
28
  };
@@ -6,5 +6,5 @@ export const CoreLogDisableEventHistoryCustomAction = ({ action }) => {
6
6
  return null;
7
7
  }
8
8
  const { reason } = action.payload;
9
- return (_jsx(Box, { sx: { width: '100%', my: 1 }, children: _jsx(Alert, { severity: 'warning', children: _jsx(Typography, { variant: "body1", fontWeight: "bold", children: reason }) }) }));
9
+ return (_jsx(Box, { sx: { width: '100%', my: 1 }, children: _jsx(Alert, { severity: 'warning', children: _jsx(Typography, { fontWeight: "bold", variant: "body1", children: reason }) }) }));
10
10
  };
@@ -7,5 +7,5 @@ export const CoreLogTemplateLiteralCustomAction = ({ action, expanded }) => {
7
7
  return null;
8
8
  }
9
9
  const { messageParts: [strings, values], } = action.payload;
10
- return (_jsx(Box, { sx: { width: '100%', my: 1 }, children: _jsx(Alert, { severity: 'info', children: _jsx(Typography, { variant: "body1", children: values.reduce((preComp, value, index) => (_jsxs(_Fragment, { children: [preComp, _jsx(AnyVariableView, { value: value, expanded: expanded, hideStringQuotes: true }), _jsx("span", { children: strings[index + 1] })] })), _jsx("span", { children: strings[0] })) }) }) }));
10
+ return (_jsx(Box, { sx: { width: '100%', my: 1 }, children: _jsx(Alert, { severity: 'info', children: _jsx(Typography, { variant: "body1", children: values.reduce((preComp, value, index) => (_jsxs(_Fragment, { children: [preComp, _jsx(AnyVariableView, { expanded: expanded, hideStringQuotes: true, value: value }), _jsx("span", { children: strings[index + 1] })] })), _jsx("span", { children: strings[0] })) }) }) }));
11
11
  };
@@ -5,7 +5,7 @@ export const CoreNetworkRequestCustomAction = ({ action, result, expanded }) =>
5
5
  if (!action.payload) {
6
6
  return null;
7
7
  }
8
- return (_jsxs(_Fragment, { children: [_jsx("pre", { style: genericFunctionRendererStyles.pre, children: _jsx(GenericFunctionRenderer, { functionName: 'askNetworkRequest', args: [
8
+ return (_jsxs(_Fragment, { children: [_jsx("pre", { style: genericFunctionRendererStyles.pre, children: _jsx(GenericFunctionRenderer, { args: [
9
9
  action.payload.method,
10
10
  action.payload.url,
11
11
  {
@@ -15,5 +15,5 @@ export const CoreNetworkRequestCustomAction = ({ action, result, expanded }) =>
15
15
  params: action.payload.params,
16
16
  responseType: action.payload.responseType,
17
17
  },
18
- ], tooltipMap: ['method', 'url', 'httpRequestOptions'], expanded: expanded }) }), _jsx(ActionResultDisplay, { action: action, result: result, expanded: expanded })] }));
18
+ ], expanded: expanded, functionName: 'askNetworkRequest', tooltipMap: ['method', 'url', 'httpRequestOptions'] }) }), _jsx(ActionResultDisplay, { action: action, expanded: expanded, result: result })] }));
19
19
  };
@@ -3,7 +3,7 @@ import { genericFunctionRendererStyles } from './AnyVariableView';
3
3
  import { AnyVariableView } from './AnyVariableView';
4
4
  const ActionResultDisplay = ({ result, expanded }) => {
5
5
  const [successResult, errorResult] = result || [];
6
- return (_jsxs(_Fragment, { children: [successResult !== undefined && !errorResult && (_jsxs("pre", { style: genericFunctionRendererStyles.pre, children: [_jsx("span", { children: "Result: " }), _jsx(AnyVariableView, { value: successResult, expanded: expanded })] })), errorResult !== undefined && (_jsx("pre", { style: genericFunctionRendererStyles.pre, children: _jsx(AnyVariableView, { value: errorResult, expanded: expanded }) }))] }));
6
+ return (_jsxs(_Fragment, { children: [successResult !== undefined && !errorResult && (_jsxs("pre", { style: genericFunctionRendererStyles.pre, children: [_jsx("span", { children: "Result: " }), _jsx(AnyVariableView, { expanded: expanded, value: successResult })] })), errorResult !== undefined && (_jsx("pre", { style: genericFunctionRendererStyles.pre, children: _jsx(AnyVariableView, { expanded: expanded, value: errorResult }) }))] }));
7
7
  };
8
8
  // Make sure to export ActionResultDisplay if it's defined in a separate file
9
9
  export default ActionResultDisplay;
@@ -60,13 +60,13 @@ const tryDecodeBase64 = (text) => {
60
60
  export const StringVariableView = ({ value, expanded, hideStringQuotes }) => {
61
61
  const asJson = tryParseJson(value);
62
62
  if (asJson.ok) {
63
- return (_jsxs(_Fragment, { children: [_jsxs("span", { style: genericFunctionRendererStyles.jsonComment, children: ['<', "json", '>'] }), _jsx(AnyVariableView, { value: asJson.value, expanded: expanded })] }));
63
+ return (_jsxs(_Fragment, { children: [_jsxs("span", { style: genericFunctionRendererStyles.jsonComment, children: ['<', "json", '>'] }), _jsx(AnyVariableView, { expanded: expanded, value: asJson.value })] }));
64
64
  }
65
65
  const decoded = tryDecodeBase64(value);
66
66
  if (decoded !== undefined) {
67
67
  const asBase64Json = tryParseJson(decoded);
68
68
  if (asBase64Json.ok) {
69
- return (_jsxs(_Fragment, { children: [_jsxs("span", { style: genericFunctionRendererStyles.jsonComment, children: ['<', "base64-json", '>'] }), _jsx(AnyVariableView, { value: asBase64Json.value, expanded: expanded })] }));
69
+ return (_jsxs(_Fragment, { children: [_jsxs("span", { style: genericFunctionRendererStyles.jsonComment, children: ['<', "base64-json", '>'] }), _jsx(AnyVariableView, { expanded: expanded, value: asBase64Json.value })] }));
70
70
  }
71
71
  }
72
72
  const trimmedValue = value.length > 25 && !expanded ? `${value.slice(0, 25)}...` : value;
@@ -80,42 +80,42 @@ export const ArrayVariableView = ({ value, expanded }) => {
80
80
  return !expanded ? (_jsxs(_Fragment, { children: [_jsx("span", { children: "[" }), _jsx("span", { style: genericFunctionRendererStyles.emptyObject, children: "Empty Array" }), _jsx("span", { children: "]" })] })) : (_jsx(_Fragment, { children: "[]" }));
81
81
  }
82
82
  if (expanded) {
83
- return (_jsxs(_Fragment, { children: [_jsx("span", { children: "[" }), _jsx("div", { style: { paddingLeft: 10 }, children: value.map((item, index) => (_jsxs("div", { children: [_jsx(AnyVariableView, { value: item, expanded: expanded }), ","] }, index))) }), _jsx("span", { children: "]" })] }));
83
+ return (_jsxs(_Fragment, { children: [_jsx("span", { children: "[" }), _jsx("div", { style: { paddingLeft: 10 }, children: value.map((item, index) => (_jsxs("div", { children: [_jsx(AnyVariableView, { expanded: expanded, value: item }), ","] }, index))) }), _jsx("span", { children: "]" })] }));
84
84
  }
85
85
  return (_jsxs(_Fragment, { children: [_jsx("span", { children: "[ " }), _jsxs("span", { style: genericFunctionRendererStyles.arrayItems, children: [value.length, " items"] }), _jsx("span", { children: " ]" })] }));
86
86
  };
87
87
  export const KvsQueryConditionVariableView = ({ value, expanded }) => {
88
- return _jsx(GenericFunctionRenderer, { functionName: `kvs${value.operation}`, args: [value.key, value.valueA], expanded: expanded });
88
+ return _jsx(GenericFunctionRenderer, { args: [value.key, value.valueA], expanded: expanded, functionName: `kvs${value.operation}` });
89
89
  };
90
90
  export const KvsLogicalOperatorVariableView = ({ value, expanded }) => {
91
- return _jsx(GenericFunctionRenderer, { functionName: `kvs${value.operation}`, args: [value.conditions], expanded: expanded });
91
+ return _jsx(GenericFunctionRenderer, { args: [value.conditions], expanded: expanded, functionName: `kvs${value.operation}` });
92
92
  };
93
93
  export const EmptyObjectVariableView = ({ value, expanded }) => {
94
94
  return !expanded ? (_jsxs(_Fragment, { children: [_jsx("span", { children: '{ ' }), _jsx("span", { style: genericFunctionRendererStyles.emptyObject, children: "Empty Object" }), _jsx("span", { children: ' }' })] })) : (_jsx(_Fragment, { children: `{ }` }));
95
95
  };
96
96
  export const QpqBinaryDataVariableView = ({ value, expanded }) => {
97
- return (_jsx("img", { src: `data:${value.mimeType || 'image/jpeg'};base64,${value.base64Data}`, alt: "Binary Data", style: { width: '100px', height: 'auto' } }));
97
+ return (_jsx("img", { alt: "Binary Data", src: `data:${value.mimeType || 'image/jpeg'};base64,${value.base64Data}`, style: { width: '100px', height: 'auto' } }));
98
98
  };
99
99
  export const ObjectVariableView = ({ value, expanded }) => {
100
100
  if (Array.isArray(value)) {
101
- return _jsx(ArrayVariableView, { value: value, expanded: expanded });
101
+ return _jsx(ArrayVariableView, { expanded: expanded, value: value });
102
102
  }
103
103
  const objectKeys = Object.keys(value);
104
104
  if (value.operation && value.key && objectKeys.length <= 4) {
105
- return _jsx(KvsQueryConditionVariableView, { value: value, expanded: expanded });
105
+ return _jsx(KvsQueryConditionVariableView, { expanded: expanded, value: value });
106
106
  }
107
107
  else if (value.operation && value.conditions && objectKeys.length == 2) {
108
- return _jsx(KvsLogicalOperatorVariableView, { value: value, expanded: expanded });
108
+ return _jsx(KvsLogicalOperatorVariableView, { expanded: expanded, value: value });
109
109
  }
110
110
  else if (objectKeys.length == 0) {
111
- return _jsx(EmptyObjectVariableView, { value: value, expanded: expanded });
111
+ return _jsx(EmptyObjectVariableView, { expanded: expanded, value: value });
112
112
  }
113
113
  else if (value.base64Data && value.filename) {
114
- return _jsx(QpqBinaryDataVariableView, { value: value, expanded: expanded });
114
+ return _jsx(QpqBinaryDataVariableView, { expanded: expanded, value: value });
115
115
  }
116
116
  const cleanObject = JSON.parse(JSON.stringify(value));
117
117
  const cleanObjectKeys = Object.keys(cleanObject);
118
- return !expanded ? (_jsxs(_Fragment, { children: [_jsx("span", { children: '{ ' }), cleanObjectKeys.map((key, index) => (_jsxs("span", { children: [key, Array.isArray(cleanObject[key]) && !expanded && (_jsxs(_Fragment, { children: [_jsx("span", { children: ":" }), " ", _jsx(ArrayVariableView, { value: cleanObject[key], expanded: false })] })), index < cleanObjectKeys.length - 1 && ', '] }, key))), _jsx("span", { children: ' }' })] })) : (_jsxs(_Fragment, { children: [_jsx("span", { children: '{ ' }), _jsx("div", { style: { paddingLeft: 10 }, children: cleanObjectKeys.map((key, index) => (_jsxs("div", { children: [key, ": ", _jsx(AnyVariableView, { value: cleanObject[key], expanded: expanded }), ","] }, key))) }), _jsx("span", { children: '}' })] }));
118
+ return !expanded ? (_jsxs(_Fragment, { children: [_jsx("span", { children: '{ ' }), cleanObjectKeys.map((key, index) => (_jsxs("span", { children: [key, Array.isArray(cleanObject[key]) && !expanded && (_jsxs(_Fragment, { children: [_jsx("span", { children: ":" }), " ", _jsx(ArrayVariableView, { expanded: false, value: cleanObject[key] })] })), index < cleanObjectKeys.length - 1 && ', '] }, key))), _jsx("span", { children: ' }' })] })) : (_jsxs(_Fragment, { children: [_jsx("span", { children: '{ ' }), _jsx("div", { style: { paddingLeft: 10 }, children: cleanObjectKeys.map((key, index) => (_jsxs("div", { children: [key, ": ", _jsx(AnyVariableView, { expanded: expanded, value: cleanObject[key] }), ","] }, key))) }), _jsx("span", { children: '}' })] }));
119
119
  };
120
120
  // Helper function to style values based on their type
121
121
  export const AnyVariableView = ({ value, expanded, hideStringQuotes }) => {
@@ -132,17 +132,17 @@ export const AnyVariableView = ({ value, expanded, hideStringQuotes }) => {
132
132
  return _jsx("span", { style: genericFunctionRendererStyles.numberValue, children: value });
133
133
  }
134
134
  else if (typeof value === 'string') {
135
- return _jsx(StringVariableView, { value: value, expanded: expanded, hideStringQuotes: hideStringQuotes });
135
+ return _jsx(StringVariableView, { expanded: expanded, hideStringQuotes: hideStringQuotes, value: value });
136
136
  }
137
137
  else if (typeof value === 'object') {
138
- return _jsx(ObjectVariableView, { value: value, expanded: expanded });
138
+ return _jsx(ObjectVariableView, { expanded: expanded, value: value });
139
139
  }
140
140
  // Fallback for other types, using normal text color
141
141
  return _jsx("span", { children: value.toString() });
142
142
  };
143
143
  const renderBasicArg = (arg, value, index, expanded, tooltip) => {
144
144
  const tooltipText = `${tooltip || arg}\n\nvalue: ${JSON.stringify(value, null, 2)}`;
145
- return (_jsx(React.Fragment, { children: _jsx("span", { title: tooltipText, children: _jsx(AnyVariableView, { value: value, expanded: expanded }) }) }, arg));
145
+ return (_jsx(React.Fragment, { children: _jsx("span", { title: tooltipText, children: _jsx(AnyVariableView, { expanded: expanded, value: value }) }) }, arg));
146
146
  };
147
147
  export const GenericFunctionRenderer = ({ functionName, args, expanded, tooltipMap = [], argRenderer = renderBasicArg, }) => {
148
148
  // Convert args object to an array of key-value pairs and map each to a span element with dynamic styling and optional tooltip
@@ -1,8 +1,11 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import ActionResultDisplay from './ActionResultDisplay';
3
3
  import { GenericFunctionRenderer, genericFunctionRendererStyles } from './AnyVariableView'; // Assuming this is the correct path
4
- export const getGenericActionRenderer = (functionName, argMap, tooltipMap = argMap) => ({ action, expanded, result }) => {
5
- const anyPayload = action.payload;
6
- const args = argMap.reduce((acc, arg) => ({ ...acc, [arg]: anyPayload[arg] }), {});
7
- return (_jsxs(_Fragment, { children: [_jsx("pre", { style: genericFunctionRendererStyles.pre, children: _jsx(GenericFunctionRenderer, { functionName: functionName, args: args, tooltipMap: tooltipMap, expanded: expanded }) }), _jsx(ActionResultDisplay, { action: action, result: result, expanded: expanded })] }));
4
+ export const getGenericActionRenderer = (functionName, argMap, tooltipMap = argMap) => {
5
+ const GenericActionRenderer = ({ action, expanded, result }) => {
6
+ const anyPayload = action.payload;
7
+ const args = argMap.reduce((acc, arg) => ({ ...acc, [arg]: anyPayload[arg] }), {});
8
+ return (_jsxs(_Fragment, { children: [_jsx("pre", { style: genericFunctionRendererStyles.pre, children: _jsx(GenericFunctionRenderer, { args: args, expanded: expanded, functionName: functionName, tooltipMap: tooltipMap }) }), _jsx(ActionResultDisplay, { action: action, expanded: expanded, result: result })] }));
9
+ };
10
+ return GenericActionRenderer;
8
11
  };
@@ -25,5 +25,5 @@ export const CostPerService = ({ logs }) => {
25
25
  }))
26
26
  .sort((a, b) => b.cost - a.cost);
27
27
  }, [logs]);
28
- return (_jsxs(_Fragment, { children: [_jsx(Typography, { variant: "h5", gutterBottom: true, children: "Cost per Service" }), _jsx(TableContainer, { component: Paper, children: _jsxs(Table, { children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableCell, { children: "Service" }), _jsx(TableCell, { align: "right", children: "Executions" }), _jsx(TableCell, { align: "right", children: "Runtime (ms)" }), _jsx(TableCell, { align: "right", children: "Cost ($)" })] }) }), _jsx(TableBody, { children: data.map((row) => (_jsxs(TableRow, { children: [_jsx(TableCell, { component: "th", scope: "row", children: row.service }), _jsx(TableCell, { align: "right", children: row.executions }), _jsx(TableCell, { align: "right", children: row.runtime }), _jsx(TableCell, { align: "right", children: row.cost.toFixed(8) })] }, row.service))) })] }) })] }));
28
+ return (_jsxs(_Fragment, { children: [_jsx(Typography, { gutterBottom: true, variant: "h5", children: "Cost per Service" }), _jsx(TableContainer, { component: Paper, children: _jsxs(Table, { children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableCell, { children: "Service" }), _jsx(TableCell, { align: "right", children: "Executions" }), _jsx(TableCell, { align: "right", children: "Runtime (ms)" }), _jsx(TableCell, { align: "right", children: "Cost ($)" })] }) }), _jsx(TableBody, { children: data.map((row) => (_jsxs(TableRow, { children: [_jsx(TableCell, { component: "th", scope: "row", children: row.service }), _jsx(TableCell, { align: "right", children: row.executions }), _jsx(TableCell, { align: "right", children: row.runtime }), _jsx(TableCell, { align: "right", children: row.cost.toFixed(8) })] }, row.service))) })] }) })] }));
29
29
  };
@@ -4,5 +4,5 @@ import { Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow
4
4
  import { useErrorsByType } from '../hooks/useErrorsByType';
5
5
  export const ErrorsByType = ({ logs }) => {
6
6
  const data = useErrorsByType(logs);
7
- return (_jsxs(_Fragment, { children: [_jsx(Typography, { variant: "h5", gutterBottom: true, children: "Errors by Type" }), _jsxs(BarChart, { width: 1200, height: 300, data: data, children: [_jsx(CartesianGrid, { strokeDasharray: "3 3" }), _jsx(XAxis, { dataKey: "errorText" }), _jsx(YAxis, {}), _jsx(Tooltip, {}), _jsx(Legend, {}), _jsx(Bar, { dataKey: "count", fill: "#8884d8" })] }), _jsx(TableContainer, { component: Paper, children: _jsxs(Table, { children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableCell, { children: "Error Type" }), _jsx(TableCell, { align: "right", children: "Count" })] }) }), _jsx(TableBody, { children: data.map((row) => (_jsxs(TableRow, { children: [_jsx(TableCell, { component: "th", scope: "row", children: row.errorText }), _jsx(TableCell, { align: "right", children: row.count })] }, row.errorText))) })] }) })] }));
7
+ return (_jsxs(_Fragment, { children: [_jsx(Typography, { gutterBottom: true, variant: "h5", children: "Errors by Type" }), _jsxs(BarChart, { data: data, height: 300, width: 1200, children: [_jsx(CartesianGrid, { strokeDasharray: "3 3" }), _jsx(XAxis, { dataKey: "errorText" }), _jsx(YAxis, {}), _jsx(Tooltip, {}), _jsx(Legend, {}), _jsx(Bar, { dataKey: "count", fill: "#8884d8" })] }), _jsx(TableContainer, { component: Paper, children: _jsxs(Table, { children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableCell, { children: "Error Type" }), _jsx(TableCell, { align: "right", children: "Count" })] }) }), _jsx(TableBody, { children: data.map((row) => (_jsxs(TableRow, { children: [_jsx(TableCell, { component: "th", scope: "row", children: row.errorText }), _jsx(TableCell, { align: "right", children: row.count })] }, row.errorText))) })] }) })] }));
8
8
  };
@@ -4,5 +4,5 @@ import { Typography } from '@mui/material';
4
4
  import { useErrorsOverTime } from '../hooks/useErrorsOverTime';
5
5
  export const ErrorsOverTime = ({ logs, searchParams }) => {
6
6
  const data = useErrorsOverTime(logs, searchParams);
7
- return (_jsxs(_Fragment, { children: [_jsx(Typography, { variant: "h5", gutterBottom: true, children: "Errors Over Time" }), _jsxs(LineChart, { width: 1200, height: 300, data: data, children: [_jsx(CartesianGrid, { strokeDasharray: "3 3" }), _jsx(XAxis, { dataKey: "time" }), _jsx(YAxis, {}), _jsx(Tooltip, {}), _jsx(Legend, {}), _jsx(Line, { type: "monotone", dataKey: "errors", stroke: "#8884d8", activeDot: { r: 8 } })] })] }));
7
+ return (_jsxs(_Fragment, { children: [_jsx(Typography, { gutterBottom: true, variant: "h5", children: "Errors Over Time" }), _jsxs(LineChart, { data: data, height: 300, width: 1200, children: [_jsx(CartesianGrid, { strokeDasharray: "3 3" }), _jsx(XAxis, { dataKey: "time" }), _jsx(YAxis, {}), _jsx(Tooltip, {}), _jsx(Legend, {}), _jsx(Line, { activeDot: { r: 8 }, dataKey: "errors", stroke: "#8884d8", type: "monotone" })] })] }));
8
8
  };
@@ -4,7 +4,7 @@ import { Typography } from '@mui/material';
4
4
  import { useRequestsByService } from '../hooks/useRequestsByService';
5
5
  export const RequestsByService = ({ logs, searchParams }) => {
6
6
  const data = useRequestsByService(logs, searchParams);
7
- return (_jsxs(_Fragment, { children: [_jsx(Typography, { variant: "h5", gutterBottom: true, children: "Requests by Service" }), _jsxs(LineChart, { width: 1200, height: 300, data: data, children: [_jsx(CartesianGrid, { strokeDasharray: "3 3" }), _jsx(XAxis, { dataKey: "time" }), _jsx(YAxis, {}), _jsx(Tooltip, {}), _jsx(Legend, {}), Object.keys(data[0] || {})
7
+ return (_jsxs(_Fragment, { children: [_jsx(Typography, { gutterBottom: true, variant: "h5", children: "Requests by Service" }), _jsxs(LineChart, { data: data, height: 300, width: 1200, children: [_jsx(CartesianGrid, { strokeDasharray: "3 3" }), _jsx(XAxis, { dataKey: "time" }), _jsx(YAxis, {}), _jsx(Tooltip, {}), _jsx(Legend, {}), Object.keys(data[0] || {})
8
8
  .filter((key) => key !== 'time')
9
- .map((service) => (_jsx(Line, { type: "monotone", dataKey: service, stroke: `#${Math.floor(Math.random() * 16777215).toString(16)}` }, service)))] })] }));
9
+ .map((service) => (_jsx(Line, { dataKey: service, stroke: `#${Math.floor(Math.random() * 16777215).toString(16)}`, type: "monotone" }, service)))] })] }));
10
10
  };
@@ -10,7 +10,7 @@ export const useLogManagement = () => {
10
10
  window.viewLog = (log) => {
11
11
  setCorrelation(log.correlation);
12
12
  };
13
- }, [logs]);
13
+ }, [logs, setCorrelation]);
14
14
  useEffect(() => {
15
15
  console.log('logs attached to window, try: viewLog(logs[0])');
16
16
  }, []);
@@ -1,4 +1,4 @@
1
- import { useAuthAccessToken, useBaseUrlResolvers } from 'quidproquo-web-react';
1
+ import { useAuthAccessToken, useBaseUrlResolvers, useEffectCallback } from 'quidproquo-web-react';
2
2
  import { useEffect, useState } from 'react';
3
3
  import { getLogHierarchy } from '../logic';
4
4
  const filterQpqActions = (logs) => {
@@ -33,20 +33,23 @@ export const useLogTreeData = (correlationId, hideQpqActions = false) => {
33
33
  }
34
34
  setIsLoading(false);
35
35
  };
36
+ // Stable identity so the effect below can list it as a dependency while
37
+ // still only re-running when a correlation id appears or disappears.
38
+ const fetchTreeData = useEffectCallback(async () => {
39
+ setIsLoading(true);
40
+ console.log('correlationId: ', correlationId);
41
+ const logHierarchy = await getLogHierarchy(baseUrlResolvers.getApiUrl(), correlationId, false, accessToken);
42
+ if (logHierarchy) {
43
+ setTreeData([logHierarchy]);
44
+ }
45
+ setIsLoading(false);
46
+ });
47
+ const hasCorrelationId = !!correlationId;
36
48
  useEffect(() => {
37
- const fetchTreeData = async () => {
38
- setIsLoading(true);
39
- console.log('correlationId: ', correlationId);
40
- const logHierarchy = await getLogHierarchy(baseUrlResolvers.getApiUrl(), correlationId, false, accessToken);
41
- if (logHierarchy) {
42
- setTreeData([logHierarchy]);
43
- }
44
- setIsLoading(false);
45
- };
46
- if (correlationId) {
49
+ if (hasCorrelationId) {
47
50
  fetchTreeData();
48
51
  }
49
- }, [!!correlationId]);
52
+ }, [hasCorrelationId, fetchTreeData]);
50
53
  const result = {
51
54
  isLoading,
52
55
  refreshTreeData: refreshTreeData,
@@ -1,17 +1,18 @@
1
- import { useAuthAccessToken, useBaseUrlResolvers } from 'quidproquo-web-react';
1
+ import { useAuthAccessToken, useBaseUrlResolvers, useEffectCallback } from 'quidproquo-web-react';
2
2
  import { useEffect, useMemo, useState } from 'react';
3
3
  import { getServiceNames } from '../logic';
4
4
  export const useServiceNames = () => {
5
5
  const [serviceNames, setServiceNames] = useState(['All']);
6
6
  const accessToken = useAuthAccessToken();
7
7
  const baseUrlResolvers = useBaseUrlResolvers();
8
+ // Stable identity so the mount-only effect below can list it as a dependency.
9
+ const fetchData = useEffectCallback(async () => {
10
+ const updatedServiceNames = await getServiceNames(baseUrlResolvers.getApiUrl(), accessToken);
11
+ setServiceNames(updatedServiceNames);
12
+ });
8
13
  useEffect(() => {
9
- const fetchData = async () => {
10
- const updatedServiceNames = await getServiceNames(baseUrlResolvers.getApiUrl(), accessToken);
11
- setServiceNames(updatedServiceNames);
12
- };
13
14
  fetchData();
14
- }, []);
15
+ }, [fetchData]);
15
16
  const serviceOptions = useMemo(() => serviceNames.map((s) => ({
16
17
  label: s
17
18
  .split('-')
@@ -20,14 +20,14 @@ export const AdminDialog = ({ open, handleClose, title, selectedTab, onSelectTab
20
20
  const handleTabChange = (event, newValue) => {
21
21
  onSelectTab(tabs[newValue]);
22
22
  };
23
- return (_jsxs(Dialog, { open: open, scroll: 'paper', "aria-labelledby": "scroll-dialog-title", "aria-describedby": "scroll-dialog-description", onClose: handleClose, maxWidth: false, fullWidth: true, PaperProps: {
23
+ return (_jsxs(Dialog, { "aria-describedby": "scroll-dialog-description", "aria-labelledby": "scroll-dialog-title", fullWidth: true, maxWidth: false, onClose: handleClose, open: open, PaperProps: {
24
24
  style: {
25
25
  width: '90%',
26
26
  height: '90%',
27
27
  maxHeight: '90%',
28
28
  maxWidth: '90%',
29
29
  },
30
- }, children: [_jsx(DialogTitle, { id: "scroll-dialog-title", children: title }), tabs.length > 0 && (_jsx(AppBar, { position: "sticky", color: "primary", children: _jsx(Tabs, { value: selectedTabIndex, onChange: handleTabChange, textColor: "inherit", indicatorColor: "secondary", children: tabs.map((t) => (_jsx(Tab, { label: t }, t))) }) })), _jsx(DialogContent, { dividers: true, sx: {
30
+ }, scroll: 'paper', children: [_jsx(DialogTitle, { id: "scroll-dialog-title", children: title }), tabs.length > 0 && (_jsx(AppBar, { color: "primary", position: "sticky", children: _jsx(Tabs, { indicatorColor: "secondary", onChange: handleTabChange, textColor: "inherit", value: selectedTabIndex, children: tabs.map((t) => (_jsx(Tab, { label: t }, t))) }) })), _jsx(DialogContent, { dividers: true, sx: {
31
31
  minHeight: '150px',
32
32
  overflowY: 'scroll',
33
33
  }, children: children }), buttons.length > 0 && (_jsx(DialogActions, { children: buttons.map((b) => (_jsx(Button, { disabled: b.disabled, onClick: b.onClick, children: b.text }, b.text))) }))] }));
@@ -17,5 +17,5 @@ export function AsyncButton({ onClick, children, disabled, type }) {
17
17
  setLoading(false);
18
18
  }
19
19
  };
20
- return (_jsx(Button, { onClick: handleLogin, fullWidth: true, variant: "contained", color: "primary", disabled: loading || disabled, style: { maxHeight: '100%', height: '4em' }, type: type, children: loading ? _jsx(CircularProgress, { size: 24 }) : children }));
20
+ return (_jsx(Button, { color: "primary", disabled: loading || disabled, fullWidth: true, onClick: handleLogin, style: { maxHeight: '100%', height: '4em' }, type: type, variant: "contained", children: loading ? _jsx(CircularProgress, { size: 24 }) : children }));
21
21
  }
@@ -5,7 +5,7 @@ export const AutocompleteInput = ({ label, value, options, onChange }) => {
5
5
  onChange(newValue ? newValue.value : '');
6
6
  };
7
7
  const selectedValue = options.find((option) => option.value === value) || null;
8
- return (_jsx(FormControl, { fullWidth: true, children: _jsx(Autocomplete, { options: options, getOptionLabel: (option) => option.label, value: selectedValue, onChange: handleChange, renderInput: (params) => (_jsx(TextField, { ...params, label: label, InputLabelProps: {
8
+ return (_jsx(FormControl, { fullWidth: true, children: _jsx(Autocomplete, { getOptionLabel: (option) => option.label, onChange: handleChange, options: options, renderInput: (params) => (_jsx(TextField, { ...params, InputLabelProps: {
9
9
  shrink: true,
10
- } })) }) }));
10
+ }, label: label })), value: selectedValue }) }));
11
11
  };
@@ -13,5 +13,5 @@ export const DataGrid = ({ items, columns, onRowClick }) => {
13
13
  valueGetter: 'valueGetter' in col ? (params) => col.valueGetter(params.row, params) : undefined,
14
14
  renderCell: (params) => col.renderCell?.(params.row, params),
15
15
  }));
16
- return (_jsx(Box, { sx: { height: '100%', width: '100%' }, children: _jsx(MuiDataGrid, { rows: items, columns: muiColumns, onRowClick: handleRowClick }) }));
16
+ return (_jsx(Box, { sx: { height: '100%', width: '100%' }, children: _jsx(MuiDataGrid, { columns: muiColumns, onRowClick: handleRowClick, rows: items }) }));
17
17
  };
@@ -5,5 +5,5 @@ export function DataGridPagination() {
5
5
  const apiRef = useGridApiContext();
6
6
  const page = useGridSelector(apiRef, gridPageSelector);
7
7
  const pageCount = useGridSelector(apiRef, gridPageCountSelector);
8
- return _jsx(Pagination, { color: "primary", count: pageCount, page: page + 1, onChange: (event, value) => apiRef.current.setPage(value - 1) });
8
+ return _jsx(Pagination, { color: "primary", count: pageCount, onChange: (event, value) => apiRef.current.setPage(value - 1), page: page + 1 });
9
9
  }
@@ -12,5 +12,5 @@ export const DateCell = (props) => {
12
12
  month: '2-digit',
13
13
  year: '2-digit',
14
14
  });
15
- return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsxs(Typography, { variant: "body2", component: "span", children: [formattedDate, " ", formattedTime] }), _jsx(LastSeen, { isoTime: date.toISOString(), timeStyle: "twitter" })] }));
15
+ return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsxs(Typography, { component: "span", variant: "body2", children: [formattedDate, " ", formattedTime] }), _jsx(LastSeen, { isoTime: date.toISOString(), timeStyle: "twitter" })] }));
16
16
  };
@@ -30,10 +30,10 @@ export const DateRangePicker = ({ startIsoDateTime, endIsoDateTime, setStartIsoD
30
30
  const handleQuickTimeClose = () => {
31
31
  setAnchorEl(null);
32
32
  };
33
- return (_jsxs(LocalizationProvider, { dateAdapter: AdapterDateFns, children: [_jsxs(Grid, { container: true, spacing: 2, children: [_jsx(Grid, { item: true, xs: 6, children: _jsx(Box, { position: "relative", children: _jsx(FormControl, { fullWidth: true, children: _jsx(DateTimePicker, { label: "Start DateTime", value: new Date(startIsoDateTime), onChange: handleStartDateChange }) }) }) }), _jsx(Grid, { item: true, xs: 6, children: _jsxs(Box, { position: "relative", children: [_jsx(FormControl, { fullWidth: true, children: _jsx(DateTimePicker, { label: "End DateTime", value: new Date(endIsoDateTime), onChange: handleEndDateChange }) }), _jsx(IconButton, { "aria-label": "quick time select", "aria-controls": "quick-time-menu", "aria-haspopup": "true", onClick: handleQuickTimeClick, sx: {
33
+ return (_jsxs(LocalizationProvider, { dateAdapter: AdapterDateFns, children: [_jsxs(Grid, { container: true, spacing: 2, children: [_jsx(Grid, { item: true, xs: 6, children: _jsx(Box, { position: "relative", children: _jsx(FormControl, { fullWidth: true, children: _jsx(DateTimePicker, { label: "Start DateTime", onChange: handleStartDateChange, value: new Date(startIsoDateTime) }) }) }) }), _jsx(Grid, { item: true, xs: 6, children: _jsxs(Box, { position: "relative", children: [_jsx(FormControl, { fullWidth: true, children: _jsx(DateTimePicker, { label: "End DateTime", onChange: handleEndDateChange, value: new Date(endIsoDateTime) }) }), _jsx(IconButton, { "aria-controls": "quick-time-menu", "aria-haspopup": "true", "aria-label": "quick time select", onClick: handleQuickTimeClick, sx: {
34
34
  position: 'absolute',
35
35
  right: '-28px',
36
36
  top: '50%',
37
37
  transform: 'translateY(-50%)',
38
- }, children: _jsx(ExpandMoreIcon, {}) })] }) })] }), _jsxs(Menu, { id: "quick-time-menu", anchorEl: anchorEl, keepMounted: true, open: Boolean(anchorEl), onClose: handleQuickTimeClose, children: [_jsx(MenuItem, { onClick: () => handleQuickTimeSelect(5), children: "Last 5 minutes" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(30), children: "Last 30 minutes" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(1 * 60), children: "Last hour" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(3 * 60), children: "Last 3 hours" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(8 * 60), children: "Last 8 hours" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(16 * 60), children: "Last 16 hours" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(24 * 60), children: "Last 24 hours" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(7 * 24 * 60), children: "Last 7 days" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(30 * 24 * 60), children: "Last month" })] })] }));
38
+ }, children: _jsx(ExpandMoreIcon, {}) })] }) })] }), _jsxs(Menu, { anchorEl: anchorEl, id: "quick-time-menu", keepMounted: true, onClose: handleQuickTimeClose, open: Boolean(anchorEl), children: [_jsx(MenuItem, { onClick: () => handleQuickTimeSelect(5), children: "Last 5 minutes" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(30), children: "Last 30 minutes" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(1 * 60), children: "Last hour" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(3 * 60), children: "Last 3 hours" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(8 * 60), children: "Last 8 hours" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(16 * 60), children: "Last 16 hours" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(24 * 60), children: "Last 24 hours" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(7 * 24 * 60), children: "Last 7 days" }), _jsx(MenuItem, { onClick: () => handleQuickTimeSelect(30 * 24 * 60), children: "Last month" })] })] }));
39
39
  };
@@ -21,7 +21,7 @@ export function MainLayout() {
21
21
  pb: '56px', // <— prevent content from being hidden behind bottom nav
22
22
  }, children: tabs
23
23
  .filter((t, index) => index === tab)
24
- .map((tab) => (_jsx(tab.View, {}, tab.name))) }), _jsxs(BottomNavigation, { value: tab, onChange: (event, newValue) => {
24
+ .map((tab) => (_jsx(tab.View, {}, tab.name))) }), _jsxs(BottomNavigation, { onChange: (event, newValue) => {
25
25
  // The trailing Logout / Loading actions are not tabs
26
26
  if (newValue < tabs.length) {
27
27
  handleTabOnChange(event, newValue);
@@ -35,5 +35,5 @@ export function MainLayout() {
35
35
  borderTop: 1,
36
36
  borderColor: 'divider',
37
37
  bgcolor: 'background.paper',
38
- }, children: [tabs.map((t) => (_jsx(BottomNavigationAction, { label: t.name, icon: t.icon }, t.name))), loading && _jsx(BottomNavigationAction, { label: "Loading", icon: _jsx(CircularProgress, { size: 18 }), disabled: true }), _jsx(BottomNavigationAction, { label: "Logout", icon: _jsx(LogoutIcon, {}), onClick: () => authApi.authLogout() })] })] }));
38
+ }, value: tab, children: [tabs.map((t) => (_jsx(BottomNavigationAction, { icon: t.icon, label: t.name }, t.name))), loading && _jsx(BottomNavigationAction, { disabled: true, icon: _jsx(CircularProgress, { size: 18 }), label: "Loading" }), _jsx(BottomNavigationAction, { icon: _jsx(LogoutIcon, {}), label: "Logout", onClick: () => authApi.authLogout() })] })] }));
39
39
  }
@@ -4,7 +4,7 @@ export const TextInput = ({ label, value, onChange }) => {
4
4
  const handleChange = (event) => {
5
5
  onChange(event.target.value);
6
6
  };
7
- return (_jsx(FormControl, { fullWidth: true, children: _jsx(TextField, { label: label, value: value || '', onChange: handleChange, InputLabelProps: {
7
+ return (_jsx(FormControl, { fullWidth: true, children: _jsx(TextField, { InputLabelProps: {
8
8
  shrink: true,
9
- } }) }));
9
+ }, label: label, onChange: handleChange, value: value || '' }) }));
10
10
  };
@@ -36,6 +36,6 @@ const columns = [
36
36
  ];
37
37
  const AdminView = () => {
38
38
  const accessToken = useAuthAccessToken();
39
- return (_jsx(TabViewBox, { header: () => (_jsxs(GridContainer, { spacing: 2, xs: 12, children: [_jsx(GridItem, { xs: 6, children: _jsx(DateRangePicker, { startIsoDateTime: new Date().toISOString(), endIsoDateTime: new Date().toISOString(), setStartIsoDateTime: () => { }, setEndIsoDateTime: () => { } }) }), _jsx(GridItem, { xs: 4, children: _jsx(TextInput, { label: "Email", onChange: () => { }, value: "" }) }), _jsx(GridItem, { xs: 2, children: _jsx(AsyncButton, { onClick: async () => { }, children: "Search" }) })] })), body: () => _jsx(DataGrid, { items: [], columns: columns }) }));
39
+ return (_jsx(TabViewBox, { body: () => _jsx(DataGrid, { columns: columns, items: [] }), header: () => (_jsxs(GridContainer, { spacing: 2, xs: 12, children: [_jsx(GridItem, { xs: 6, children: _jsx(DateRangePicker, { endIsoDateTime: new Date().toISOString(), setEndIsoDateTime: () => { }, setStartIsoDateTime: () => { }, startIsoDateTime: new Date().toISOString() }) }), _jsx(GridItem, { xs: 4, children: _jsx(TextInput, { label: "Email", onChange: () => { }, value: "" }) }), _jsx(GridItem, { xs: 2, children: _jsx(AsyncButton, { onClick: async () => { }, children: "Search" }) })] })) }));
40
40
  };
41
41
  export default memo(AdminView);
@@ -1,4 +1,4 @@
1
- import { useAuthAccessToken, useBaseUrlResolvers } from 'quidproquo-web-react';
1
+ import { useAuthAccessToken, useBaseUrlResolvers, useEffectCallback } from 'quidproquo-web-react';
2
2
  import { useEffect, useState } from 'react';
3
3
  import { useLoadFederatedAddons } from './FederatedAddonProvider';
4
4
  export function useFederatedAddon() {
@@ -7,12 +7,13 @@ export function useFederatedAddon() {
7
7
  const accessToken = useAuthAccessToken();
8
8
  const baseUrlResolvers = useBaseUrlResolvers();
9
9
  const loadAddons = useLoadFederatedAddons();
10
+ // Stable identity so the mount-only effect below can list it as a dependency.
11
+ const doAsyncWork = useEffectCallback(async () => {
12
+ setLoading(true);
13
+ const addons = await loadAddons({ baseUrlResolvers, accessToken });
14
+ setFederatedAddons(addons);
15
+ });
10
16
  useEffect(() => {
11
- const doAsyncWork = async () => {
12
- setLoading(true);
13
- const addons = await loadAddons({ baseUrlResolvers, accessToken });
14
- setFederatedAddons(addons);
15
- };
16
17
  doAsyncWork()
17
18
  .catch((e) => {
18
19
  console.log(e);
@@ -21,7 +22,7 @@ export function useFederatedAddon() {
21
22
  .finally(() => {
22
23
  setLoading(false);
23
24
  });
24
- }, []);
25
+ }, [doAsyncWork]);
25
26
  return {
26
27
  addons: federatedAddons,
27
28
  loading,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-web-admin",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "",
5
5
  "main": "./lib/commonjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -44,11 +44,11 @@
44
44
  "date-fns": "^2.30.0",
45
45
  "dayjs": "^1.11.7",
46
46
  "javascript-time-ago": "^2.5.9",
47
- "quidproquo-core": "0.1.1",
48
- "quidproquo-tsconfig": "0.1.1",
49
- "quidproquo-web": "0.1.1",
50
- "quidproquo-web-react": "0.1.1",
51
- "quidproquo-webserver": "0.1.1",
47
+ "quidproquo-core": "0.1.2",
48
+ "quidproquo-tsconfig": "0.1.2",
49
+ "quidproquo-web": "0.1.2",
50
+ "quidproquo-web-react": "0.1.2",
51
+ "quidproquo-webserver": "0.1.2",
52
52
  "react": ">=18.3.1",
53
53
  "react-d3-tree": "^3.6.6",
54
54
  "react-dom": "18.3.1",