REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 2.21 KB
Close
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/lib/frontend/interfaces/action/build-action-click-handler.js
Text
Base64
/* eslint-disable no-restricted-globals */ /* eslint-disable no-undef */ /* eslint-disable no-alert */ import { actionHasDisabledComponent } from './action-has-component.js'; import { actionHref } from './action-href.js'; import { buildActionCallApiTrigger } from './build-action-api-call-trigger.js'; import { REFRESH_KEY } from '../../components/actions/utils/append-force-refresh.js'; export const buildActionClickHandler = options => { const { action, params, actionResponseHandler, navigate, modalFunctions, location } = options; const { openModal } = modalFunctions; const handleActionClick = event => { event.preventDefault(); event.stopPropagation(); const href = actionHref(action, params); const callApi = buildActionCallApiTrigger({ params, action, actionResponseHandler }); // Action has "component" option set to "false" explicitly in it's configuration if (actionHasDisabledComponent(action)) { if (action.guard) { const modalData = { modalProps: { variant: 'danger', label: 'confirm', title: action.guard, subTitle: '' }, type: 'confirm', resourceId: params.resourceId, confirmAction: callApi }; // If confirmation is required, action trigger should be handled in modal openModal(modalData); return; } // If no confirmation is required, call API callApi(); return; } // Default behaviour - you're navigated to action URL and logic is performed on it's route if (href) { const url = new URL(`relative:${href}`); const hrefParams = new URLSearchParams(url.search); const currentParams = new URLSearchParams(action.showInDrawer ? location?.search ?? '' : ''); Object.entries(Object.fromEntries(currentParams.entries())).forEach(([key, value]) => { if (!hrefParams.has(key)) hrefParams.set(key, value); }); if (location?.pathname === url.pathname) { hrefParams.set(REFRESH_KEY, 'true'); } navigate({ pathname: url.pathname, search: hrefParams.toString() }); } }; return handleActionClick; };
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 11
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
action-has-component.js
210 B
lrw-r--r--
2026-02-28 00:28:46
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
action-href.js
823 B
lrw-r--r--
2026-02-28 00:28:56
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
action-json.interface.js
10 B
lrw-r--r--
2026-02-28 00:28:58
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
build-action-api-call-trigger.js
444 B
lrw-r--r--
2026-02-28 00:31:22
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
build-action-click-handler.js
2.21 KB
lrw-r--r--
2026-02-28 00:31:22
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
build-action-test-id.js
67 B
lrw-r--r--
2026-02-28 00:31:22
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
call-action-api.js
1.35 KB
lrw-r--r--
2026-02-28 00:31:26
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
419 B
lrw-r--r--
2026-02-28 00:31:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
is-bulk-action.js
102 B
lrw-r--r--
2026-02-28 00:31:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
is-record-action.js
105 B
lrw-r--r--
2026-02-28 00:31:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
is-resource-action.js
110 B
lrw-r--r--
2026-02-28 00:31:44
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).