REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 3.47 KB
Close
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/src/frontend/components/routes/resource-action.tsx
Text
Base64
import { Box } from '@adminjs/design-system' import React, { useState } from 'react' import { connect } from 'react-redux' import { useParams } from 'react-router' import { ResourceActionParams } from '../../../backend/utils/view-helpers/view-helpers.js' import allowOverride from '../../hoc/allow-override.js' import { ResourceJSON, actionHasDisabledComponent } from '../../interfaces/index.js' import { ReduxState } from '../../store/store.js' import BaseActionComponent from '../app/base-action-component.js' import DrawerPortal from '../app/drawer-portal.js' import { NoActionError, NoResourceError } from '../app/error-message.js' import FilterDrawer from '../app/filter-drawer.js' import { ActionHeader } from '../app/index.js' import Wrapper from './utils/wrapper.js' import { getDataCss, getResourceElementCss } from '../../utils/data-css-name.js' type PropsFromState = { resources: Array<ResourceJSON> } type Props = PropsFromState const ResourceAction: React.FC<Props> = (props) => { const params = useParams<ResourceActionParams>() const { resources } = props const { resourceId, actionName } = params const [tag, setTag] = useState('') const [filterVisible, setFilterVisible] = useState(false) const resource = resources.find((r) => r.id === resourceId) if (!resource) { return <NoResourceError resourceId={resourceId!} /> } const action = resource.resourceActions.find((r) => r.name === actionName) if (!action || actionHasDisabledComponent(action)) { return <NoActionError resourceId={resourceId!} actionName={actionName!} /> } const listActionName = 'list' const listAction = resource.resourceActions.find((r) => r.name === listActionName) const contentTag = getResourceElementCss(resource.id, action.name) const routeActionCss = getDataCss(resource.id, action.actionType, action.name, 'route') if (action.showInDrawer) { if (!listAction) { return ( <DrawerPortal width={action.containerWidth} data-css={routeActionCss}> <BaseActionComponent action={action} resource={resource} /> </DrawerPortal> ) } const toggleFilter = listAction.showFilter ? (): void => setFilterVisible(!filterVisible) : undefined return ( <> <DrawerPortal width={action.containerWidth} data-css={routeActionCss}> <BaseActionComponent action={action} resource={resource} setTag={setTag} /> </DrawerPortal> <Wrapper width={listAction.containerWidth} data-css={contentTag}> <ActionHeader resource={resource} action={listAction} tag={tag} toggleFilter={toggleFilter} /> <BaseActionComponent action={listAction} resource={resource} setTag={setTag} /> </Wrapper> </> ) } return ( <Wrapper width={action.containerWidth} showFilter={action.showFilter} data-css={contentTag}> <Box flex flexDirection="column" flexGrow={1}> <ActionHeader resource={resource} action={action} toggleFilter={action.showFilter} tag={tag} /> <BaseActionComponent action={action} resource={resource} setTag={setTag} /> </Box> {action.showFilter && <FilterDrawer resource={resource} />} </Wrapper> ) } const mapStateToProps = (state: ReduxState): PropsFromState => ({ resources: state.resources, }) export default allowOverride(connect(mapStateToProps)(ResourceAction), 'ResourceActionRoute')
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 8
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:50
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
bulk-action.tsx
4.63 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
dashboard.tsx
1.37 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
363 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
page.tsx
1.60 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
record-action.spec.tsx
2.12 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
record-action.tsx
5.85 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
resource-action.tsx
3.47 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
resource.tsx
3.26 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).