Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6676cb3

Browse files
committed
Chase down errors
1 parent 54d5cce commit 6676cb3

File tree

9 files changed

+64
-25829
lines changed

9 files changed

+64
-25829
lines changed

site/package-lock.json

Lines changed: 0 additions & 25786 deletions
This file was deleted.

site/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"cron-parser": "4.5.0",
4040
"cronstrue": "2.11.0",
4141
"dayjs": "1.11.4",
42-
"formik": "2.2.9",
42+
"formik": "^2.2.9",
4343
"front-matter": "4.0.2",
4444
"history": "5.3.0",
4545
"just-debounce-it": "3.0.1",
@@ -49,6 +49,7 @@
4949
"react-markdown": "8.0.3",
5050
"react-router-dom": "6.3.0",
5151
"sourcemapped-stacktrace": "1.1.11",
52+
"swr": "^1.3.0",
5253
"tzdata": "1.0.30",
5354
"uuid": "8.3.2",
5455
"xstate": "4.32.1",

site/src/components/ErrorBoundary/ErrorBoundary.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Component, ReactNode } from "react"
1+
import React, { Component, ReactNode } from "react"
22
import { RuntimeErrorState } from "../RuntimeErrorState/RuntimeErrorState"
33

4-
type ErrorBoundaryProps = Record<string, unknown>
4+
type ErrorBoundaryProps = Record<string, any>
55

66
interface ErrorBoundaryState {
77
error: Error | null

site/src/components/FormTextField/FormTextField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export const FormTextField = <T,>({
134134
variant={variant}
135135
disabled={disabled || form.isSubmitting}
136136
error={isError}
137-
helperText={isError ? form.errors[formFieldName] : helperText}
137+
helperText={isError ? form.errors[formFieldName]?.toString() : helperText}
138138
id={fieldId}
139139
InputProps={isPassword ? undefined : InputProps}
140140
name={fieldId}

site/src/components/SettingsAccountForm/SettingsAccountForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const AccountForm: FC<React.PropsWithChildren<AccountFormProps>> = ({
5151
<>
5252
<form onSubmit={form.handleSubmit}>
5353
<Stack>
54-
{updateProfileError && <ErrorSummary error={updateProfileError} />}
54+
{updateProfileError ? <ErrorSummary error={updateProfileError} /> : <></>}
5555
<TextField
5656
disabled
5757
fullWidth

site/src/components/SettingsSecurityForm/SettingsSecurityForm.tsx

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -68,40 +68,42 @@ export const SecurityForm: React.FC<React.PropsWithChildren<SecurityFormProps>>
6868
<>
6969
<form onSubmit={form.handleSubmit}>
7070
<Stack>
71-
{updateSecurityError && <ErrorSummary error={updateSecurityError} />}
72-
<TextField
73-
{...getFieldHelpers("old_password")}
74-
onChange={onChangeTrimmed(form)}
75-
autoComplete="old_password"
76-
fullWidth
77-
label={Language.oldPasswordLabel}
78-
variant="outlined"
79-
type="password"
80-
/>
81-
<TextField
82-
{...getFieldHelpers("password")}
83-
onChange={onChangeTrimmed(form)}
84-
autoComplete="password"
85-
fullWidth
86-
label={Language.newPasswordLabel}
87-
variant="outlined"
88-
type="password"
89-
/>
90-
<TextField
91-
{...getFieldHelpers("confirm_password")}
92-
onChange={onChangeTrimmed(form)}
93-
autoComplete="confirm_password"
94-
fullWidth
95-
label={Language.confirmPasswordLabel}
96-
variant="outlined"
97-
type="password"
98-
/>
71+
<>
72+
{updateSecurityError && <ErrorSummary error={updateSecurityError} />}
73+
<TextField
74+
{...getFieldHelpers("old_password")}
75+
onChange={onChangeTrimmed(form)}
76+
autoComplete="old_password"
77+
fullWidth
78+
label={Language.oldPasswordLabel}
79+
variant="outlined"
80+
type="password"
81+
/>
82+
<TextField
83+
{...getFieldHelpers("password")}
84+
onChange={onChangeTrimmed(form)}
85+
autoComplete="password"
86+
fullWidth
87+
label={Language.newPasswordLabel}
88+
variant="outlined"
89+
type="password"
90+
/>
91+
<TextField
92+
{...getFieldHelpers("confirm_password")}
93+
onChange={onChangeTrimmed(form)}
94+
autoComplete="confirm_password"
95+
fullWidth
96+
label={Language.confirmPasswordLabel}
97+
variant="outlined"
98+
type="password"
99+
/>
99100

100-
<div>
101-
<LoadingButton loading={isLoading} type="submit" variant="contained">
102-
{isLoading ? "" : Language.updatePassword}
103-
</LoadingButton>
104-
</div>
101+
<div>
102+
<LoadingButton loading={isLoading} type="submit" variant="contained">
103+
{isLoading ? "" : Language.updatePassword}
104+
</LoadingButton>
105+
</div>
106+
</>
105107
</Stack>
106108
</form>
107109
</>

site/src/components/Stack/Stack.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { makeStyles } from "@material-ui/core/styles"
22
import { CSSProperties } from "@material-ui/core/styles/withStyles"
3-
import { FC, PropsWithChildren } from "react"
3+
import { FC } from "react"
44
import { combineClasses } from "../../util/combineClasses"
55

66
type Direction = "column" | "row"
@@ -11,6 +11,7 @@ export interface StackProps {
1111
spacing?: number
1212
alignItems?: CSSProperties["alignItems"]
1313
justifyContent?: CSSProperties["justifyContent"]
14+
children: ReactNode
1415
}
1516

1617
type StyleProps = Omit<StackProps, "className">
@@ -29,7 +30,7 @@ const useStyles = makeStyles((theme) => ({
2930
},
3031
}))
3132

32-
export const Stack: FC<PropsWithChildren<StackProps>> = ({
33+
export const Stack: FC<StackProps> = ({
3334
children,
3435
className,
3536
direction = "column",

site/src/pages/UserSettingsPage/SSHKeysPage/SSHKeysPageView.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,16 @@ export const SSHKeysPageView: FC<React.PropsWithChildren<SSHKeysPageViewProps>>
4141
<Stack>
4242
{/* Regenerating the key is not an option if getSSHKey fails.
4343
Only one of the error messages will exist at a single time */}
44-
{getSSHKeyError && <ErrorSummary error={getSSHKeyError} />}
45-
{regenerateSSHKeyError && (
44+
45+
{getSSHKeyError ? <ErrorSummary error={getSSHKeyError} /> : <></>}
46+
{regenerateSSHKeyError ? (
4647
<ErrorSummary
4748
error={regenerateSSHKeyError}
4849
defaultMessage={Language.errorRegenerateSSHKey}
4950
dismissible
5051
/>
52+
) : (
53+
<></>
5154
)}
5255
{hasLoaded && sshKey && (
5356
<>

site/yarn.lock

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7150,7 +7150,7 @@ format@^0.2.0:
71507150
resolved "https://registry.yarnpkg.com/format/-/format-0.2.2.tgz#d6170107e9efdc4ed30c9dc39016df942b5cb58b"
71517151
integrity sha1-1hcBB+nv3E7TDJ3DkBbflCtctYs=
71527152

7153-
7153+
formik@^2.2.9:
71547154
version "2.2.9"
71557155
resolved "https://registry.yarnpkg.com/formik/-/formik-2.2.9.tgz#8594ba9c5e2e5cf1f42c5704128e119fc46232d0"
71567156
integrity sha512-LQLcISMmf1r5at4/gyJigGn0gOwFbeEAlji+N9InZF6LIMXnFNkO42sCI8Jt84YZggpD4cPWObAZaxpEFtSzNA==
@@ -13122,6 +13122,20 @@ svgo@^2.7.0:
1312213122
picocolors "^1.0.0"
1312313123
stable "^0.1.8"
1312413124

13125+
<<<<<<< HEAD
13126+
||||||| parent of 76f66ca8... Chase down errors
13127+
13128+
version "1.2.2"
13129+
resolved "https://registry.yarnpkg.com/swr/-/swr-1.2.2.tgz#6cae09928d30593a7980d80f85823e57468fac5d"
13130+
integrity sha512-ky0BskS/V47GpW8d6RU7CPsr6J8cr7mQD6+do5eky3bM0IyJaoi3vO8UhvrzJaObuTlGhPl2szodeB2dUd76Xw==
13131+
13132+
=======
13133+
swr@^1.3.0:
13134+
version "1.3.0"
13135+
resolved "https://registry.yarnpkg.com/swr/-/swr-1.3.0.tgz#c6531866a35b4db37b38b72c45a63171faf9f4e8"
13136+
integrity sha512-dkghQrOl2ORX9HYrMDtPa7LTVHJjCTeZoB1dqTbnnEDlSvN8JEKpYIYurDfvbQFUUS8Cg8PceFVZNkW0KNNYPw==
13137+
13138+
>>>>>>> 76f66ca8... Chase down errors
1312513139
symbol-tree@^3.2.4:
1312613140
version "3.2.4"
1312713141
resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2"

0 commit comments

Comments
 (0)