Skip to content

Commit c74615b

Browse files
fix: missing actions
1 parent 9a45510 commit c74615b

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

bin/watch-dev.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
const runtime = require('@babel/plugin-transform-runtime')
99
const styled = require('babel-plugin-styled-components')
10-
const bundler = require('../lib/backend/bundler/bundler')
11-
const env = require('../lib/backend/bundler/bundler-env')
10+
const bundler = require('../src/backend/bundler/bundler')
11+
const env = require('../src/backend/bundler/bundler-env')
1212

1313
const once = !!process.env.ONCE
1414

src/backend/actions/action.interface.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,15 @@ export type After<T> = (
235235
context: ActionContext,
236236
) => Promise<T>
237237

238+
export type BuildInActions =
239+
'show' |
240+
'edit' |
241+
'list' |
242+
'delete' |
243+
'bulkDelete' |
244+
'new' |
245+
'search'
246+
238247
/**
239248
* @classdesc
240249
* Interface representing an Action in AdminBro.
@@ -305,7 +314,7 @@ export interface Action <T extends ActionResponse> {
305314
* _bulkDelete_ you override existing actions.
306315
* For all other keys you create a new action.
307316
*/
308-
name: string;
317+
name: BuildInActions | string;
309318
/**
310319
* indicates if action should be visible for given invocation context.
311320
* It also can be a simple boolean value.
+14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
1+
import { New } from './new'
2+
import { Edit } from './edit'
3+
import { Show } from './show'
4+
import { List } from './list'
5+
import { BulkDelete } from './bulk-delete'
6+
17
export * from './new'
28
export * from './edit'
39
export * from './show'
410
export * from './list'
511
export * from './bulk-delete'
612
export * from './utils'
13+
14+
export const actions = {
15+
new: New,
16+
edit: Edit,
17+
show: Show,
18+
list: List,
19+
bulkDelete: BulkDelete,
20+
}

src/frontend/components/app/base-action-component.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Trans } from 'react-i18next'
33
import { MessageBox, Link } from '@admin-bro/design-system'
44

55
import ErrorBoundary from './error-boundary'
6-
import * as actions from '../actions'
6+
import { actions } from '../actions'
77
import { DOCS } from '../../../constants'
88
import { ActionProps } from '../actions/action.props'
99
import { useTranslation } from '../../hooks'

0 commit comments

Comments
 (0)