-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Close enso-org/cloud-v2#1590 - Add source maps to built bundle for sentry to pick up - Close enso-org/cloud-v2#1589 - Add global Sentry filter to avoid sending 400 responses from backend - Wrap settings user and organization profile picture inputs in form - Upgrade from deprecated sentry APIs # Important Notes None
- Loading branch information
1 parent
42cfa69
commit 20c066a
Showing
17 changed files
with
525 additions
and
448 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,6 @@ src/project-view/util/iconName.ts | |
|
||
*storybook.log | ||
storybook-static | ||
|
||
# Sentry Config File | ||
.env.sentry-build-plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
app/gui/src/dashboard/components/AriaComponents/Inputs/HiddenFile/HiddenFile.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** @file A hidden file input. */ | ||
import { | ||
Form, | ||
type FieldPath, | ||
type FieldProps, | ||
type FieldStateProps, | ||
type FieldValues, | ||
type FieldVariantProps, | ||
type TSchema, | ||
} from '#/components/AriaComponents' | ||
import { Input, type InputProps } from '#/components/aria' | ||
|
||
/** Props for {@link HiddenFile}. */ | ||
export interface HiddenFileProps<Schema extends TSchema, TFieldName extends FieldPath<Schema>> | ||
extends FieldStateProps< | ||
Omit<InputProps, 'children' | 'value'> & { value: FieldValues<Schema>[TFieldName] }, | ||
Schema, | ||
TFieldName | ||
>, | ||
FieldProps, | ||
FieldVariantProps { | ||
/** When true, triggers `form.submit()` on input. */ | ||
readonly autoSubmit?: boolean | undefined | ||
readonly accept?: string | undefined | ||
} | ||
|
||
/** A hidden file input. */ | ||
export function HiddenFile<Schema extends TSchema, TFieldName extends FieldPath<Schema>>( | ||
props: HiddenFileProps<Schema, TFieldName>, | ||
) { | ||
const { | ||
form, | ||
autoSubmit = false, | ||
accept, | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
defaultValue: _defaultValue, | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
disabled: _disabled, | ||
...inputProps | ||
} = props | ||
const formInstance = Form.useFormContext(form) | ||
|
||
return ( | ||
<Form.Controller | ||
{...inputProps} | ||
control={formInstance.control} | ||
render={({ field }) => ( | ||
<Input | ||
type="file" | ||
className="focus-child w-0" | ||
accept={accept} | ||
onChange={(event) => { | ||
field.onChange(event.target.files?.[0]) | ||
if (autoSubmit) { | ||
void formInstance.submit() | ||
} | ||
}} | ||
/> | ||
)} | ||
/> | ||
) | ||
} |
2 changes: 2 additions & 0 deletions
2
app/gui/src/dashboard/components/AriaComponents/Inputs/HiddenFile/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/** @file Barrel file for HiddenFile component. */ | ||
export * from './HiddenFile' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.