REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 3.18 KB
Close
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/src/frontend/components/actions/edit.tsx
Text
Base64
import { Box, Button, DrawerContent, DrawerFooter, Icon } from '@adminjs/design-system' import React, { FC, useEffect } from 'react' import { useNavigate } from 'react-router' import allowOverride from '../../hoc/allow-override.js' import useRecord from '../../hooks/use-record/use-record.js' import { useTranslation } from '../../hooks/use-translation.js' import { RecordJSON } from '../../interfaces/index.js' import { getActionElementCss } from '../../utils/index.js' import ActionHeader from '../app/action-header/action-header.js' import BasePropertyComponent from '../property-type/index.js' import { ActionProps } from './action.props.js' import { appendForceRefresh } from './utils/append-force-refresh.js' import LayoutElementRenderer from './utils/layout-element-renderer.js' const Edit: FC<ActionProps> = (props) => { const { record: initialRecord, resource, action } = props const { record, handleChange, submit: handleSubmit, loading, setRecord, } = useRecord(initialRecord, resource.id) const { translateButton } = useTranslation() const navigate = useNavigate() useEffect(() => { if (initialRecord) { setRecord(initialRecord) } }, [initialRecord]) const submit = (event: React.FormEvent<HTMLFormElement>): boolean => { event.preventDefault() handleSubmit().then((response) => { if (response.data.redirectUrl) { navigate(appendForceRefresh(response.data.redirectUrl)) } }) return false } const contentTag = getActionElementCss(resource.id, action.name, 'drawer-content') const formTag = getActionElementCss(resource.id, action.name, 'form') const footerTag = getActionElementCss(resource.id, action.name, 'drawer-footer') const buttonTag = getActionElementCss(resource.id, action.name, 'drawer-submit') return ( <Box as="form" onSubmit={submit} flex flexDirection="column" data-css={formTag} > <DrawerContent data-css={contentTag}> {action?.showInDrawer ? <ActionHeader {...props} /> : null} {action.layout ? action.layout.map((layoutElement, i) => ( <LayoutElementRenderer // eslint-disable-next-line react/no-array-index-key key={i} layoutElement={layoutElement} {...props} where="edit" onChange={handleChange} record={record as RecordJSON} /> )) : resource.editProperties.map((property) => ( <BasePropertyComponent key={property.propertyPath} where="edit" onChange={handleChange} property={property} resource={resource} record={record as RecordJSON} /> ))} </DrawerContent> <DrawerFooter data-css={footerTag}> <Button variant="contained" type="submit" data-css={buttonTag} data-testid="button-save" disabled={loading}> {loading ? (<Icon icon="Loader" spin />) : null} {translateButton('save', resource.id)} </Button> </DrawerFooter> </Box> ) } const OverridableEdit = allowOverride(Edit, 'DefaultEditAction') export { OverridableEdit as default, OverridableEdit as Edit, Edit as OriginalEdit, }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 7
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
utils
DIR
-
drwxr-xr-x
2026-02-28 00:32:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
action.props.ts
782 B
lrw-r--r--
2026-02-28 00:31:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
bulk-delete.tsx
3.95 KB
lrw-r--r--
2026-02-28 00:32:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
edit.tsx
3.18 KB
lrw-r--r--
2026-02-28 00:32:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.ts
488 B
lrw-r--r--
2026-02-28 00:32:28
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
list.tsx
2.55 KB
lrw-r--r--
2026-02-28 00:32:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
new.tsx
4.54 KB
lrw-r--r--
2026-02-28 00:32:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
show.tsx
1.56 KB
lrw-r--r--
2026-02-28 00:32:48
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).