@variocube/app-ui 1.15.0 → 1.16.1
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/esm/AppShell/AppShell.js +12 -12
- package/esm/AppShell/AppShell.js.map +1 -1
- package/esm/AppShell/index.js.map +1 -1
- package/esm/Input/ActionsMenu.js +1 -1
- package/esm/Input/ActionsMenu.js.map +1 -1
- package/esm/Input/EmailSenderField.js +3 -3
- package/esm/Input/EmailSenderField.js.map +1 -1
- package/esm/Input/Selector.js +2 -2
- package/esm/Input/Selector.js.map +1 -1
- package/esm/Paging/Paging.d.ts +1 -1
- package/esm/Paging/Paging.js +5 -5
- package/esm/Paging/Paging.js.map +1 -1
- package/esm/Paging/index.d.ts +2 -1
- package/esm/Paging/index.js.map +1 -1
- package/esm/VCThemeProvider/JetbrainsMonoFont.js +8 -8
- package/esm/VCThemeProvider/JetbrainsMonoFont.js.map +1 -1
- package/esm/VCThemeProvider/RobotoFont.js +8 -8
- package/esm/VCThemeProvider/RobotoFont.js.map +1 -1
- package/esm/VCThemeProvider/ThemeModeSwitcher.js +5 -5
- package/esm/VCThemeProvider/ThemeModeSwitcher.js.map +1 -1
- package/esm/VCThemeProvider/VCThemeProvider.d.ts +1 -1
- package/esm/VCThemeProvider/VCThemeProvider.js +21 -21
- package/esm/VCThemeProvider/VCThemeProvider.js.map +1 -1
- package/esm/audit/AuditChanges.js +9 -5
- package/esm/audit/AuditChanges.js.map +1 -1
- package/esm/audit/AuditTimeline.js +1 -1
- package/esm/audit/AuditTimeline.js.map +1 -1
- package/esm/audit/AuditTimelineItem.js +3 -3
- package/esm/audit/AuditTimelineItem.js.map +1 -1
- package/esm/audit/index.d.ts +1 -1
- package/esm/audit/index.js +1 -1
- package/esm/audit/index.js.map +1 -1
- package/esm/breadcrumbs.d.ts +2 -2
- package/esm/breadcrumbs.js +3 -3
- package/esm/breadcrumbs.js.map +1 -1
- package/esm/code/CodeBlock.d.ts +1 -1
- package/esm/code/CodeBlock.js +1 -1
- package/esm/code/CodeBlock.js.map +1 -1
- package/esm/confirm/ConfirmButton.js.map +1 -1
- package/esm/confirm/ConfirmDialog.js +1 -1
- package/esm/confirm/ConfirmDialog.js.map +1 -1
- package/esm/confirm/ConfirmMenuItem.js +1 -1
- package/esm/confirm/ConfirmMenuItem.js.map +1 -1
- package/esm/container/ContainerLayout.d.ts +1 -1
- package/esm/container/ContainerLayout.js +5 -5
- package/esm/container/ContainerLayout.js.map +1 -1
- package/esm/container/ContainerSettingsContext.d.ts +2 -2
- package/esm/container/ContainerSettingsContext.js +6 -6
- package/esm/container/ContainerSettingsContext.js.map +1 -1
- package/esm/container/ContainerWidthControl.js +2 -2
- package/esm/container/ContainerWidthControl.js.map +1 -1
- package/esm/container/index.d.ts +1 -1
- package/esm/container/index.js +1 -1
- package/esm/container/index.js.map +1 -1
- package/esm/content-table/ContentTable.d.ts +1 -1
- package/esm/content-table/ContentTable.js +26 -19
- package/esm/content-table/ContentTable.js.map +1 -1
- package/esm/content-table/UndrawEmpty.js.map +1 -1
- package/esm/content-table/index.js.map +1 -1
- package/esm/country/country-select.js.map +1 -1
- package/esm/country/index.d.ts +3 -3
- package/esm/country/index.js +3 -3
- package/esm/country/index.js.map +1 -1
- package/esm/country/locale-select.js +1 -1
- package/esm/country/locale-select.js.map +1 -1
- package/esm/country/locales.js +1 -1
- package/esm/country/locales.js.map +1 -1
- package/esm/country/phone-prefix-select.js +1 -1
- package/esm/country/phone-prefix-select.js.map +1 -1
- package/esm/cube/accessibility.js +2 -1
- package/esm/cube/accessibility.js.map +1 -1
- package/esm/data-table/DataTableColumnSettings.d.ts +1 -1
- package/esm/data-table/DataTableColumnSettings.js +2 -2
- package/esm/data-table/DataTableColumnSettings.js.map +1 -1
- package/esm/data-table/DataTableHeader.js +1 -1
- package/esm/data-table/DataTableHeader.js.map +1 -1
- package/esm/data-table/DataTableToolbar.js +1 -1
- package/esm/data-table/DataTableToolbar.js.map +1 -1
- package/esm/data-table/index.d.ts +4 -4
- package/esm/data-table/index.js +4 -4
- package/esm/data-table/index.js.map +1 -1
- package/esm/data-table/useDataTableColumnStorage.d.ts +9 -1
- package/esm/data-table/useDataTableColumnStorage.js +12 -5
- package/esm/data-table/useDataTableColumnStorage.js.map +1 -1
- package/esm/data-table/useDataTableStorage.d.ts +31 -6
- package/esm/data-table/useDataTableStorage.js +25 -5
- package/esm/data-table/useDataTableStorage.js.map +1 -1
- package/esm/date-pickers/PlainAdapterCommon.d.ts +1 -1
- package/esm/date-pickers/PlainAdapterCommon.js.map +1 -1
- package/esm/date-pickers/PlainDateAdapter.js.map +1 -1
- package/esm/date-pickers/PlainDatePicker.js +1 -1
- package/esm/date-pickers/PlainDatePicker.js.map +1 -1
- package/esm/date-pickers/PlainDatePicker.spec.js +2 -2
- package/esm/date-pickers/PlainDatePicker.spec.js.map +1 -1
- package/esm/date-pickers/PlainDateTimeAdapter.js.map +1 -1
- package/esm/date-pickers/PlainDateTimePicker.js +2 -2
- package/esm/date-pickers/PlainDateTimePicker.js.map +1 -1
- package/esm/date-pickers/PlainDateTimePicker.spec.js +2 -2
- package/esm/date-pickers/PlainDateTimePicker.spec.js.map +1 -1
- package/esm/date-pickers/PlainTimeAdapter.js.map +1 -1
- package/esm/date-pickers/PlainTimePicker.js +2 -2
- package/esm/date-pickers/PlainTimePicker.js.map +1 -1
- package/esm/date-pickers/PlainTimePicker.spec.js +2 -2
- package/esm/date-pickers/PlainTimePicker.spec.js.map +1 -1
- package/esm/date-pickers/TemporalAdapter.d.ts +1 -1
- package/esm/date-pickers/TemporalAdapter.js +1 -1
- package/esm/date-pickers/TemporalAdapter.js.map +1 -1
- package/esm/date-pickers/TimezoneSelect.js +348 -348
- package/esm/date-pickers/TimezoneSelect.js.map +1 -1
- package/esm/date-pickers/getFormatString.js.map +1 -1
- package/esm/date-pickers/index.d.ts +2 -1
- package/esm/date-pickers/index.js +1 -1
- package/esm/date-pickers/index.js.map +1 -1
- package/esm/date-pickers/parse.js.map +1 -1
- package/esm/date-pickers/timeframe-picker.js +7 -7
- package/esm/date-pickers/timeframe-picker.js.map +1 -1
- package/esm/date-pickers/useLocale.js.map +1 -1
- package/esm/date-pickers/useRenderInput.js +5 -3
- package/esm/date-pickers/useRenderInput.js.map +1 -1
- package/esm/formats/CompactFormat.js +1 -1
- package/esm/formats/CompactFormat.js.map +1 -1
- package/esm/formats/CompactFormat.spec.js +1 -1
- package/esm/formats/CompactFormat.spec.js.map +1 -1
- package/esm/formats/CurrencyFormat.js +1 -1
- package/esm/formats/CurrencyFormat.js.map +1 -1
- package/esm/formats/CurrencyFormat.spec.js +1 -1
- package/esm/formats/CurrencyFormat.spec.js.map +1 -1
- package/esm/formats/DecimalFormat.js +1 -1
- package/esm/formats/DecimalFormat.js.map +1 -1
- package/esm/formats/DecimalFormat.spec.js +1 -1
- package/esm/formats/DecimalFormat.spec.js.map +1 -1
- package/esm/formats/DurationFormat.js +2 -2
- package/esm/formats/DurationFormat.js.map +1 -1
- package/esm/formats/DurationFormat.spec.js +2 -2
- package/esm/formats/DurationFormat.spec.js.map +1 -1
- package/esm/formats/TemporalFormat.spec.js +2 -2
- package/esm/formats/TemporalFormat.spec.js.map +1 -1
- package/esm/formats/TemporalRangeFormat.js +1 -1
- package/esm/formats/TemporalRangeFormat.js.map +1 -1
- package/esm/formats/TemporalRangeFormat.spec.js +2 -2
- package/esm/formats/TemporalRangeFormat.spec.js.map +1 -1
- package/esm/formats/useDateTimeFormat.js +5 -2
- package/esm/formats/useDateTimeFormat.js.map +1 -1
- package/esm/formats/useNumberFormat.js +1 -1
- package/esm/formats/useNumberFormat.js.map +1 -1
- package/esm/formats/useRelativeTimeFormat.js +4 -2
- package/esm/formats/useRelativeTimeFormat.js.map +1 -1
- package/esm/forms/SearchForm.js +1 -1
- package/esm/forms/SearchForm.js.map +1 -1
- package/esm/getNavigatorLanguages.js.map +1 -1
- package/esm/getSupportedFormatLocale.js.map +1 -1
- package/esm/help/HelpDrawer.js +12 -8
- package/esm/help/HelpDrawer.js.map +1 -1
- package/esm/help/index.d.ts +1 -1
- package/esm/help/index.js +1 -1
- package/esm/help/index.js.map +1 -1
- package/esm/icons.d.ts +13 -13
- package/esm/icons.js +13 -13
- package/esm/icons.js.map +1 -1
- package/esm/layout/ErrorBoundary.js +36 -36
- package/esm/layout/ErrorBoundary.js.map +1 -1
- package/esm/layout/NotFound.js +6 -6
- package/esm/layout/NotFound.js.map +1 -1
- package/esm/layout/NotFoundSvg.js.map +1 -1
- package/esm/layout/UserNav.js +18 -18
- package/esm/layout/UserNav.js.map +1 -1
- package/esm/layout/index.d.ts +2 -2
- package/esm/layout/index.js +2 -2
- package/esm/layout/index.js.map +1 -1
- package/esm/logo/Logo.js +2 -2
- package/esm/logo/Logo.js.map +1 -1
- package/esm/logo/VCAppLogo.js +1 -1
- package/esm/logo/VCAppLogo.js.map +1 -1
- package/esm/logo/index.d.ts +3 -3
- package/esm/logo/index.js +3 -3
- package/esm/logo/index.js.map +1 -1
- package/esm/splash/index.js +2 -2
- package/esm/splash/index.js.map +1 -1
- package/esm/storage/MemoryStorage.d.ts +6 -4
- package/esm/storage/MemoryStorage.js +13 -4
- package/esm/storage/MemoryStorage.js.map +1 -1
- package/esm/storage/index.d.ts +2 -1
- package/esm/storage/index.js +1 -1
- package/esm/storage/index.js.map +1 -1
- package/esm/storage/storage.d.ts +6 -4
- package/esm/storage/storage.js +35 -15
- package/esm/storage/storage.js.map +1 -1
- package/esm/storage/types.d.ts +6 -0
- package/esm/storage/types.js +2 -0
- package/esm/storage/types.js.map +1 -0
- package/esm/storage/useStorage.d.ts +10 -1
- package/esm/storage/useStorage.js +30 -7
- package/esm/storage/useStorage.js.map +1 -1
- package/esm/tabs/Tabs.d.ts +2 -2
- package/esm/tabs/Tabs.js +15 -15
- package/esm/tabs/Tabs.js.map +1 -1
- package/esm/tabs/index.js.map +1 -1
- package/esm/temporal/index.d.ts +1 -1
- package/esm/temporal/index.js +1 -1
- package/esm/temporal/index.js.map +1 -1
- package/esm/temporal/parse.js.map +1 -1
- package/esm/temporal/polyfill.d.ts +1 -1
- package/esm/temporal/polyfill.js +3 -3
- package/esm/temporal/polyfill.js.map +1 -1
- package/esm/utils/defined.js.map +1 -1
- package/esm/utils/index.d.ts +1 -1
- package/esm/utils/index.js +1 -1
- package/esm/utils/index.js.map +1 -1
- package/esm/utils/useFlag.js.map +1 -1
- package/esm/utils/useIsMounted.js.map +1 -1
- package/package.json +8 -9
- package/src/AppShell/AppShell.tsx +147 -140
- package/src/AppShell/index.tsx +1 -1
- package/src/Input/ActionsMenu.tsx +70 -73
- package/src/Input/EmailSenderField.tsx +59 -52
- package/src/Input/Selector.tsx +15 -15
- package/src/LanguageSwitcher/index.ts +1 -1
- package/src/Paging/Paging.ts +56 -57
- package/src/Paging/index.ts +2 -1
- package/src/VCThemeProvider/JetbrainsMonoFont.tsx +52 -42
- package/src/VCThemeProvider/RobotoFont.tsx +47 -39
- package/src/VCThemeProvider/ThemeModeSwitcher.tsx +17 -17
- package/src/VCThemeProvider/VCThemeProvider.tsx +149 -145
- package/src/audit/AuditChanges.tsx +18 -12
- package/src/audit/AuditTimeline.tsx +16 -17
- package/src/audit/AuditTimelineItem.tsx +58 -61
- package/src/audit/index.ts +2 -2
- package/src/audit/types.ts +27 -28
- package/src/breadcrumbs.tsx +11 -15
- package/src/code/CodeBlock.tsx +10 -10
- package/src/confirm/ConfirmButton.tsx +56 -56
- package/src/confirm/ConfirmDialog.tsx +54 -54
- package/src/confirm/ConfirmMenuItem.tsx +51 -53
- package/src/container/ContainerLayout.tsx +7 -8
- package/src/container/ContainerSettingsContext.tsx +49 -46
- package/src/container/ContainerWidthControl.tsx +11 -9
- package/src/container/index.ts +8 -3
- package/src/content-table/ContentTable.tsx +235 -197
- package/src/content-table/UndrawEmpty.tsx +281 -281
- package/src/content-table/index.ts +1 -1
- package/src/country/country-select.tsx +0 -1
- package/src/country/index.ts +3 -3
- package/src/country/locale-select.tsx +36 -36
- package/src/country/locales.ts +185 -187
- package/src/country/phone-prefix-select.tsx +4 -5
- package/src/cube/accessibility.tsx +2 -1
- package/src/data-table/DataTableColumnSettings.tsx +181 -181
- package/src/data-table/DataTableHeader.tsx +6 -6
- package/src/data-table/DataTableToolbar.tsx +6 -6
- package/src/data-table/index.tsx +4 -4
- package/src/data-table/useDataTableColumnStorage.ts +30 -19
- package/src/data-table/useDataTableStorage.spec.ts +108 -0
- package/src/data-table/useDataTableStorage.ts +91 -36
- package/src/date-pickers/PlainAdapterCommon.ts +118 -120
- package/src/date-pickers/PlainDateAdapter.spec.ts +44 -46
- package/src/date-pickers/PlainDateAdapter.ts +130 -132
- package/src/date-pickers/PlainDatePicker.spec.tsx +17 -18
- package/src/date-pickers/PlainDatePicker.tsx +33 -36
- package/src/date-pickers/PlainDateTimeAdapter.spec.ts +44 -46
- package/src/date-pickers/PlainDateTimeAdapter.ts +141 -134
- package/src/date-pickers/PlainDateTimePicker.spec.tsx +17 -18
- package/src/date-pickers/PlainDateTimePicker.tsx +35 -36
- package/src/date-pickers/PlainTimeAdapter.ts +219 -221
- package/src/date-pickers/PlainTimePicker.spec.tsx +17 -18
- package/src/date-pickers/PlainTimePicker.tsx +35 -34
- package/src/date-pickers/TemporalAdapter.ts +110 -111
- package/src/date-pickers/TimezoneSelect.tsx +375 -375
- package/src/date-pickers/getFormatString.ts +29 -29
- package/src/date-pickers/index.ts +6 -5
- package/src/date-pickers/parse.spec.ts +37 -40
- package/src/date-pickers/parse.ts +44 -47
- package/src/date-pickers/timeframe-picker.tsx +16 -17
- package/src/date-pickers/useLocale.ts +1 -1
- package/src/date-pickers/useRenderInput.tsx +24 -15
- package/src/formats/CompactFormat.spec.tsx +18 -20
- package/src/formats/CompactFormat.tsx +30 -30
- package/src/formats/CurrencyFormat.spec.tsx +18 -20
- package/src/formats/CurrencyFormat.tsx +52 -52
- package/src/formats/DecimalFormat.spec.tsx +18 -20
- package/src/formats/DecimalFormat.tsx +47 -47
- package/src/formats/DurationFormat.spec.tsx +48 -49
- package/src/formats/DurationFormat.tsx +51 -51
- package/src/formats/TemporalFormat.spec.tsx +93 -95
- package/src/formats/TemporalRangeFormat.spec.tsx +143 -144
- package/src/formats/TemporalRangeFormat.tsx +54 -54
- package/src/formats/types.ts +1 -3
- package/src/formats/useDateTimeFormat.ts +5 -2
- package/src/formats/useNumberFormat.ts +3 -3
- package/src/formats/useRelativeTimeFormat.ts +5 -3
- package/src/forms/SearchForm.tsx +37 -38
- package/src/getNavigatorLanguages.ts +4 -5
- package/src/getSupportedFormatLocale.ts +10 -10
- package/src/help/HelpDrawer.tsx +76 -55
- package/src/help/index.ts +3 -3
- package/src/icons.ts +21 -21
- package/src/layout/ErrorBoundary.tsx +226 -215
- package/src/layout/NotFound.tsx +36 -39
- package/src/layout/NotFoundSvg.tsx +193 -169
- package/src/layout/UserNav.tsx +98 -98
- package/src/layout/index.ts +3 -3
- package/src/logo/Logo.tsx +6 -7
- package/src/logo/VCAppLogo.tsx +22 -20
- package/src/logo/index.tsx +3 -3
- package/src/splash/index.tsx +25 -25
- package/src/storage/MemoryStorage.ts +22 -15
- package/src/storage/index.ts +2 -1
- package/src/storage/storage.spec.ts +184 -0
- package/src/storage/storage.ts +37 -15
- package/src/storage/types.ts +6 -0
- package/src/storage/useStorage.ts +32 -7
- package/src/tabs/Tabs.tsx +172 -170
- package/src/tabs/index.ts +1 -1
- package/src/temporal/index.ts +1 -1
- package/src/temporal/parse.ts +1 -2
- package/src/temporal/polyfill.ts +11 -11
- package/src/utils/defined.ts +2 -3
- package/src/utils/index.ts +1 -1
- package/src/utils/useFlag.ts +5 -5
- package/src/utils/useIsMounted.ts +9 -9
|
@@ -1,232 +1,243 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {ExpandMore} from "@mui/icons-material";
|
|
2
2
|
import {Accordion, AccordionDetails, AccordionSummary, Box, Typography} from "@mui/material";
|
|
3
|
-
import {NotFoundSvg} from "./NotFoundSvg";
|
|
4
3
|
import ErrorStackParser from "error-stack-parser";
|
|
5
|
-
import {
|
|
4
|
+
import React, {Component, ErrorInfo, Fragment} from "react";
|
|
5
|
+
import {NotFoundSvg} from "./NotFoundSvg";
|
|
6
6
|
|
|
7
7
|
type ErrorContext = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
8
|
+
url: string;
|
|
9
|
+
referrer: string;
|
|
10
|
+
userAgent: string;
|
|
11
|
+
error: any;
|
|
12
|
+
};
|
|
13
13
|
|
|
14
14
|
type StackTrace = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
15
|
+
file?: string;
|
|
16
|
+
lineNumber?: number;
|
|
17
|
+
columnNumber?: number;
|
|
18
|
+
method?: string;
|
|
19
|
+
};
|
|
20
20
|
|
|
21
21
|
type BugsnagConfig = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
22
|
+
/**
|
|
23
|
+
* API Key provided by Bugsnag
|
|
24
|
+
*/
|
|
25
|
+
apiKey: string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Method to retrieve user data such as Id, Name or Email
|
|
29
|
+
*/
|
|
30
|
+
getUser: () => { id?: string; name?: string; email?: string };
|
|
31
|
+
};
|
|
32
32
|
|
|
33
33
|
type Props = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
34
|
+
/**
|
|
35
|
+
* List of storage key patterns which values should be anonymized
|
|
36
|
+
*/
|
|
37
|
+
anonymizeStorageKeyPatterns?: string[];
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Bugsnag configuration
|
|
41
|
+
*/
|
|
42
|
+
bugsnagConfig?: BugsnagConfig;
|
|
43
|
+
};
|
|
44
44
|
|
|
45
45
|
type States = {
|
|
46
|
-
|
|
47
|
-
}
|
|
46
|
+
hasError: boolean;
|
|
47
|
+
};
|
|
48
48
|
|
|
49
49
|
const codeSx = {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
background: "#263238",
|
|
51
|
+
color: "#fff",
|
|
52
|
+
fontSize: "0.8rem",
|
|
53
|
+
padding: 1,
|
|
54
|
+
borderRadius: "3px",
|
|
55
|
+
overflowX: "auto",
|
|
56
|
+
width: "100%",
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
export class ErrorBoundary extends Component<Props, States> {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
60
|
+
constructor(props: any) {
|
|
61
|
+
super(props);
|
|
62
|
+
this.state = {
|
|
63
|
+
hasError: false,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
private static errorContext?: ErrorContext;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* This lifecycle is invoked after an error has been thrown by a descendant component.
|
|
71
|
+
* It receives the error that was thrown as a parameter and should return a value to update state.
|
|
72
|
+
* @param error
|
|
73
|
+
* @doc https://reactjs.org/docs/react-component.html#static-getderivedstatefromerror
|
|
74
|
+
*/
|
|
75
|
+
static getDerivedStateFromError(error: any) {
|
|
76
|
+
// Store error context
|
|
77
|
+
ErrorBoundary.errorContext = {
|
|
78
|
+
url: location.href,
|
|
79
|
+
referrer: document.referrer,
|
|
80
|
+
userAgent: navigator.userAgent,
|
|
81
|
+
error,
|
|
82
|
+
};
|
|
83
|
+
// Update state so the next render will show the fallback UI
|
|
84
|
+
return {hasError: true};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
componentDidCatch(error: Error, errorInfo: ErrorInfo) {
|
|
88
|
+
console.error("An error occurred", {error, errorInfo});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async reportBugsnag() {
|
|
92
|
+
if (!this.props.bugsnagConfig) {
|
|
93
|
+
console.warn("Bugsnag not configured. Skip reporting to bugsnag.");
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (!ErrorBoundary.errorContext) {
|
|
97
|
+
console.warn("Error context not specified. Cannot report to bugsnag.");
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const {bugsnagConfig: {apiKey, getUser}} = this.props;
|
|
101
|
+
const {error, url, referrer, userAgent} = ErrorBoundary.errorContext;
|
|
102
|
+
const stackTraces: StackTrace[] = ErrorStackParser.parse(error)
|
|
103
|
+
.map(({fileName: file, lineNumber, columnNumber, functionName: method}) => ({
|
|
104
|
+
file,
|
|
105
|
+
lineNumber,
|
|
106
|
+
columnNumber,
|
|
107
|
+
method,
|
|
108
|
+
}));
|
|
109
|
+
const payload = {
|
|
110
|
+
apiKey,
|
|
111
|
+
payloadVersion: "5",
|
|
112
|
+
notifier: {
|
|
113
|
+
name: "variocube app-ui",
|
|
114
|
+
version: "1.0.11",
|
|
115
|
+
url: "https://github.com",
|
|
116
|
+
},
|
|
117
|
+
events: [
|
|
118
|
+
{
|
|
119
|
+
exceptions: [{
|
|
120
|
+
errorClass: error.message,
|
|
121
|
+
stacktrace: stackTraces,
|
|
122
|
+
type: "browserjs",
|
|
123
|
+
}],
|
|
124
|
+
request: {
|
|
125
|
+
httpMethod: "",
|
|
126
|
+
url,
|
|
127
|
+
referrer,
|
|
128
|
+
},
|
|
129
|
+
user: getUser(),
|
|
130
|
+
metaData: {
|
|
131
|
+
userAgent: {userAgent},
|
|
132
|
+
sessionStorage: sessionStorage,
|
|
133
|
+
localStorage: localStorage,
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
try {
|
|
140
|
+
const response = await fetch("https://notify.bugsnag.com/", {
|
|
141
|
+
method: "POST",
|
|
142
|
+
body: JSON.stringify(payload),
|
|
143
|
+
});
|
|
144
|
+
if (response.ok) {
|
|
145
|
+
console.info("successfully reported error to bugsnag");
|
|
146
|
+
}
|
|
147
|
+
} catch (error) {
|
|
148
|
+
console.log("failed to report error to bugsnag", error);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
renderStorage(storage: Storage) {
|
|
153
|
+
const {anonymizeStorageKeyPatterns = []} = this.props;
|
|
154
|
+
const kv = [];
|
|
155
|
+
for (let i = 0; i < storage.length; i++) {
|
|
156
|
+
const key = storage.key(i);
|
|
157
|
+
if (key) {
|
|
158
|
+
let value = storage.getItem(key);
|
|
159
|
+
if (value && anonymizeStorageKeyPatterns.find(p => key.indexOf(p) > -1)) {
|
|
160
|
+
value = "*****";
|
|
161
|
+
}
|
|
162
|
+
kv.push({key, value});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (kv.length === 0) return <Box component="code" sx={{...codeSx, mb: 2}}>NONE</Box>;
|
|
166
|
+
return kv
|
|
167
|
+
.sort((x, y) => x.key.localeCompare(y.key))
|
|
168
|
+
.map((o, i) => {
|
|
169
|
+
let value = o.value;
|
|
170
|
+
try {
|
|
171
|
+
value = JSON.stringify(JSON.parse(value as any), null, 3);
|
|
172
|
+
} catch (error) {
|
|
173
|
+
console.log("cannot parse value", error);
|
|
174
|
+
}
|
|
175
|
+
return (
|
|
176
|
+
<Fragment key={"kv-" + i}>
|
|
177
|
+
<Typography variant="caption">{o.key}</Typography>
|
|
178
|
+
<Box component="code" sx={{...codeSx, mb: 2}}>
|
|
179
|
+
{value}
|
|
180
|
+
</Box>
|
|
181
|
+
</Fragment>
|
|
182
|
+
);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
render() {
|
|
187
|
+
if (!this.state.hasError) return this.props.children;
|
|
188
|
+
|
|
189
|
+
this.reportBugsnag()
|
|
190
|
+
.catch(err => console.error("failed to report to bugsnag", err));
|
|
191
|
+
|
|
192
|
+
const {errorContext: {error, url, referrer, userAgent} = {}} = ErrorBoundary;
|
|
193
|
+
return (
|
|
194
|
+
<Box p={3}>
|
|
195
|
+
<NotFoundSvg style={{width: "100%", maxHeight: 300}} />
|
|
196
|
+
<Box p={4} />
|
|
197
|
+
<Typography variant="h2" align="center">Oops, something went wrong!</Typography>
|
|
198
|
+
<Box p={2} />
|
|
199
|
+
<Accordion>
|
|
200
|
+
<AccordionSummary expandIcon={<ExpandMore />}>
|
|
201
|
+
<Typography>{error?.message}</Typography>
|
|
202
|
+
</AccordionSummary>
|
|
203
|
+
<AccordionDetails
|
|
204
|
+
sx={{
|
|
205
|
+
display: "flex",
|
|
206
|
+
flexDirection: "column",
|
|
207
|
+
}}
|
|
208
|
+
>
|
|
209
|
+
<Typography variant="overline">
|
|
210
|
+
<strong>URL</strong>
|
|
211
|
+
</Typography>
|
|
212
|
+
<Box component="code" sx={codeSx}>{url}</Box>
|
|
213
|
+
<Box my={1} />
|
|
214
|
+
<Typography variant="overline">
|
|
215
|
+
<strong>Referrer</strong>
|
|
216
|
+
</Typography>
|
|
217
|
+
<Box component="code" sx={codeSx}>{referrer}</Box>
|
|
218
|
+
<Box my={1} />
|
|
219
|
+
<Typography variant="overline">
|
|
220
|
+
<strong>User-Agent</strong>
|
|
221
|
+
</Typography>
|
|
222
|
+
<Box component="code" sx={codeSx}>{userAgent}</Box>
|
|
223
|
+
<Box my={1} />
|
|
224
|
+
<Typography variant="overline">
|
|
225
|
+
<strong>Trace</strong>
|
|
226
|
+
</Typography>
|
|
227
|
+
<Box component="code" sx={codeSx}>{error?.stack}</Box>
|
|
228
|
+
<Box my={1} />
|
|
229
|
+
<Typography variant="overline">
|
|
230
|
+
<strong>Session Storage</strong>
|
|
231
|
+
</Typography>
|
|
232
|
+
{this.renderStorage(sessionStorage)}
|
|
233
|
+
<Box my={1} />
|
|
234
|
+
<Typography variant="overline">
|
|
235
|
+
<strong>Local Storage</strong>
|
|
236
|
+
</Typography>
|
|
237
|
+
{this.renderStorage(localStorage)}
|
|
238
|
+
</AccordionDetails>
|
|
239
|
+
</Accordion>
|
|
240
|
+
</Box>
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
}
|
package/src/layout/NotFound.tsx
CHANGED
|
@@ -1,51 +1,48 @@
|
|
|
1
1
|
import {Button, Grid, Stack, Typography} from "@mui/material";
|
|
2
2
|
import {ReactElement} from "react";
|
|
3
|
-
import {NotFoundSvg} from "./NotFoundSvg";
|
|
4
|
-
import {ContainerLayout} from "../container";
|
|
5
3
|
import React from "react";
|
|
4
|
+
import {ContainerLayout} from "../container";
|
|
5
|
+
import {NotFoundSvg} from "./NotFoundSvg";
|
|
6
6
|
|
|
7
7
|
interface NotFoundProps {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
svg?: ReactElement;
|
|
9
|
+
errorMsg?: string;
|
|
10
|
+
pathMsg?: string;
|
|
11
|
+
backToHomeMsg?: string;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export function NotFound(props: NotFoundProps) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const path = window.location.pathname;
|
|
15
|
+
const {svg, errorMsg, pathMsg, backToHomeMsg} = props;
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
const defaultPathMsg = "We could not find the following path:";
|
|
21
|
-
const defaultBackToHomeMsg = "Back to Home";
|
|
17
|
+
const path = window.location.pathname;
|
|
22
18
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
direction="column"
|
|
27
|
-
alignItems="center"
|
|
28
|
-
>
|
|
29
|
-
{!svg &&
|
|
30
|
-
<NotFoundSvg style={{ width: '100%', maxHeight: 300 }} />
|
|
31
|
-
}
|
|
32
|
-
{svg &&
|
|
33
|
-
svg
|
|
34
|
-
}
|
|
35
|
-
</Stack>
|
|
36
|
-
<Grid container spacing={6}>
|
|
37
|
-
<Grid item xs={12}>
|
|
38
|
-
<Typography variant="h3" align="center">{errorMsg != "" ? errorMsg : defaultErrorMsg}</Typography>
|
|
39
|
-
<Typography variant="body1" align="center">{pathMsg != "" ? pathMsg : defaultPathMsg}</Typography>
|
|
40
|
-
<Typography variant="body1" align="center">{path}</Typography>
|
|
19
|
+
const defaultErrorMsg = "404: Not Found";
|
|
20
|
+
const defaultPathMsg = "We could not find the following path:";
|
|
21
|
+
const defaultBackToHomeMsg = "Back to Home";
|
|
41
22
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
23
|
+
return (
|
|
24
|
+
<ContainerLayout>
|
|
25
|
+
<Stack
|
|
26
|
+
direction="column"
|
|
27
|
+
alignItems="center"
|
|
28
|
+
>
|
|
29
|
+
{!svg
|
|
30
|
+
&& <NotFoundSvg style={{width: "100%", maxHeight: 300}} />}
|
|
31
|
+
{svg
|
|
32
|
+
&& svg}
|
|
33
|
+
</Stack>
|
|
34
|
+
<Grid container spacing={6}>
|
|
35
|
+
<Grid item xs={12}>
|
|
36
|
+
<Typography variant="h3" align="center">{errorMsg != "" ? errorMsg : defaultErrorMsg}</Typography>
|
|
37
|
+
<Typography variant="body1" align="center">{pathMsg != "" ? pathMsg : defaultPathMsg}</Typography>
|
|
38
|
+
<Typography variant="body1" align="center">{path}</Typography>
|
|
39
|
+
</Grid>
|
|
40
|
+
<Grid item xs={12}>
|
|
41
|
+
<Typography variant="body1" align="center">
|
|
42
|
+
<Button href="/">{backToHomeMsg != "" ? backToHomeMsg : defaultBackToHomeMsg}</Button>
|
|
43
|
+
</Typography>
|
|
44
|
+
</Grid>
|
|
45
|
+
</Grid>
|
|
46
|
+
</ContainerLayout>
|
|
47
|
+
);
|
|
51
48
|
}
|