@gadmin2n/schematics 0.0.140 → 0.0.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/application/files/gadmin2-game-angle-demo/config/ui/Event.ts +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/package.json +1 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/scripts/gen-jwt.ts +8 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/seed/workflow-node-types.ts +32 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/seed/workflow.seed.ts +39 -33
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/temporal.service.spec.ts +34 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/temporal.service.ts +26 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow-compiler.service.spec.ts +149 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow-compiler.service.ts +20 -6
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow-http-response.spec.ts +85 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow-http-response.ts +157 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow.controller.spec.ts +59 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow.controller.ts +15 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow.service.spec.ts +125 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/server/src/modules/workflow/workflow.service.ts +109 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/PageHeader.tsx +46 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/components/index.ts +1 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/config/routeRegistry.test.ts +10 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/config/routeRegistry.tsx +6 -4
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/constants/layout.ts +30 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/locales/en/workflow.json +20 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/locales/zh_CN/workflow.json +20 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/agenda/index.tsx +9 -20
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/audit/list.tsx +141 -138
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/canvas/CanvasListPage.tsx +8 -19
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/human-approval/inbox.tsx +12 -19
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/page/list.tsx +47 -150
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/permissionReadme/index.tsx +13 -12
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/resource/list.tsx +110 -113
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/role/list.tsx +61 -64
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/user/list.tsx +187 -200
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/approval-channels/index.tsx +46 -44
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/components/NewNodeDefaults.test.tsx +6 -2
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/connections/index.tsx +50 -41
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/index.tsx +9 -22
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/instances.tsx +4 -8
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/node-instances/index.tsx +9 -22
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/node-instances/widgets/ExternalRequestConfigEditor.test.tsx +42 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/node-instances/widgets/ExternalRequestConfigEditor.tsx +77 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/node-instances/widgets/ReturnResultConfigEditor.test.tsx +29 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/node-instances/widgets/ReturnResultConfigEditor.tsx +245 -55
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/temporal-tenant/index.test.tsx +152 -0
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/temporal-tenant/index.tsx +417 -161
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/routes/workflow/utils/newNodeConfig.ts +5 -1
- package/dist/lib/application/files/gadmin2-game-angle-demo/web/src/styles/index.css +20 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
2
2
|
import { useTable } from '@refinedev/antd';
|
|
3
3
|
import { useGetLocale, useGetIdentity } from '@refinedev/core';
|
|
4
|
-
import { Table, Button, Space, Tooltip, message
|
|
4
|
+
import { Table, Button, Card, Space, Tooltip, message } from 'antd';
|
|
5
5
|
|
|
6
6
|
import { EditModal } from './Components/EditModal';
|
|
7
7
|
import { CreateModal } from './Components/CreateModal';
|
|
@@ -12,6 +12,8 @@ import { RoleDetailDrawer } from './Components/RoleDetailDrawer';
|
|
|
12
12
|
import { SqlModal, generateRoleSql } from '../../components/SqlModal';
|
|
13
13
|
import { customRequest } from '@/helpers/http';
|
|
14
14
|
import { buildPageTree } from '@/helpers/page-tree';
|
|
15
|
+
import { PageHeader } from 'components';
|
|
16
|
+
import { PAGE_WRAPPER_STYLE } from 'constants/layout';
|
|
15
17
|
|
|
16
18
|
type RolePageInfo = {
|
|
17
19
|
id: number;
|
|
@@ -27,8 +29,6 @@ type RolePermissionSummary = {
|
|
|
27
29
|
actions: string[];
|
|
28
30
|
};
|
|
29
31
|
|
|
30
|
-
const PAGE_NAME_DISPLAY_LIMIT = 40;
|
|
31
|
-
|
|
32
32
|
const normalizeToNumber = (value: unknown): number | null => {
|
|
33
33
|
if (typeof value === 'number' && !Number.isNaN(value)) {
|
|
34
34
|
return value;
|
|
@@ -302,7 +302,7 @@ export const RoleManagementListPage: React.FC = () => {
|
|
|
302
302
|
});
|
|
303
303
|
setSqlModal({ open: true, title: `SQL — Role: ${record.name}`, sql });
|
|
304
304
|
},
|
|
305
|
-
[rolePermissionSummary],
|
|
305
|
+
[rolePermissionSummary, identity],
|
|
306
306
|
);
|
|
307
307
|
|
|
308
308
|
const refreshRoleRelatedData = useCallback(() => {
|
|
@@ -320,66 +320,63 @@ export const RoleManagementListPage: React.FC = () => {
|
|
|
320
320
|
}, [refreshRoleRelatedData, handleModalClose]);
|
|
321
321
|
|
|
322
322
|
return (
|
|
323
|
-
<div>
|
|
324
|
-
<
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
)}
|
|
381
|
-
/>
|
|
382
|
-
</Table>
|
|
323
|
+
<div style={PAGE_WRAPPER_STYLE}>
|
|
324
|
+
<PageHeader
|
|
325
|
+
title="Role mgnts"
|
|
326
|
+
extra={
|
|
327
|
+
<Button
|
|
328
|
+
type="primary"
|
|
329
|
+
onClick={() =>
|
|
330
|
+
setShowModal({
|
|
331
|
+
type: 'create',
|
|
332
|
+
id: null,
|
|
333
|
+
})
|
|
334
|
+
}
|
|
335
|
+
>
|
|
336
|
+
Create Role
|
|
337
|
+
</Button>
|
|
338
|
+
}
|
|
339
|
+
/>
|
|
340
|
+
<Card className="card-table">
|
|
341
|
+
<Table {...tableProps} rowKey="id">
|
|
342
|
+
<Table.Column dataIndex="name" title="Name" />
|
|
343
|
+
<Table.Column dataIndex="description" title="Description" />
|
|
344
|
+
<Table.Column dataIndex="creator" title="Creator" />
|
|
345
|
+
<Table.Column
|
|
346
|
+
title="Actions"
|
|
347
|
+
render={(_, record: any) => (
|
|
348
|
+
<Space>
|
|
349
|
+
<Tooltip title="View details">
|
|
350
|
+
<Button
|
|
351
|
+
type="default"
|
|
352
|
+
size="small"
|
|
353
|
+
icon={<EyeOutlined />}
|
|
354
|
+
onClick={() => setDrawerRole(record)}
|
|
355
|
+
/>
|
|
356
|
+
</Tooltip>
|
|
357
|
+
<Tooltip title="Edit">
|
|
358
|
+
<Button
|
|
359
|
+
type="default"
|
|
360
|
+
size="small"
|
|
361
|
+
icon={<EditOutlined />}
|
|
362
|
+
onClick={() =>
|
|
363
|
+
setShowModal({ type: 'edit', id: record.id })
|
|
364
|
+
}
|
|
365
|
+
/>
|
|
366
|
+
</Tooltip>
|
|
367
|
+
<Tooltip title="Generate SQL">
|
|
368
|
+
<Button
|
|
369
|
+
type="default"
|
|
370
|
+
size="small"
|
|
371
|
+
icon={<CodeOutlined />}
|
|
372
|
+
onClick={() => handleShowSql(record)}
|
|
373
|
+
/>
|
|
374
|
+
</Tooltip>
|
|
375
|
+
</Space>
|
|
376
|
+
)}
|
|
377
|
+
/>
|
|
378
|
+
</Table>
|
|
379
|
+
</Card>
|
|
383
380
|
{drawerRole && (
|
|
384
381
|
<RoleDetailDrawer
|
|
385
382
|
role={drawerRole}
|
|
@@ -15,8 +15,7 @@ import {
|
|
|
15
15
|
} from '@refinedev/core';
|
|
16
16
|
|
|
17
17
|
import { PlusOutlined, CodeOutlined } from '@ant-design/icons';
|
|
18
|
-
import { Button,
|
|
19
|
-
import debounce from 'lodash/debounce';
|
|
18
|
+
import { Button, Card, Input, Select, Space, Table, Tag, Tooltip } from 'antd';
|
|
20
19
|
|
|
21
20
|
import {
|
|
22
21
|
CustomAvatar,
|
|
@@ -34,7 +33,6 @@ import { LIST_CONTENT_PROPS } from '@/constants/layout';
|
|
|
34
33
|
import { SqlModal, generateUserSql } from '../../components/SqlModal';
|
|
35
34
|
|
|
36
35
|
export const UserListPage: React.FC<PropsWithChildren> = ({ children }) => {
|
|
37
|
-
const [form] = Form.useForm();
|
|
38
36
|
const { data: identity } = useGetIdentity<any>();
|
|
39
37
|
|
|
40
38
|
// Fetch roles from backend using custom hook
|
|
@@ -61,13 +59,7 @@ export const UserListPage: React.FC<PropsWithChildren> = ({ children }) => {
|
|
|
61
59
|
});
|
|
62
60
|
};
|
|
63
61
|
|
|
64
|
-
const {
|
|
65
|
-
tableProps,
|
|
66
|
-
searchFormProps,
|
|
67
|
-
filters,
|
|
68
|
-
sorters,
|
|
69
|
-
tableQuery: tableQueryResult,
|
|
70
|
-
} = useTable<User, HttpError, Partial<User>>({
|
|
62
|
+
const { tableProps, filters } = useTable<User, HttpError, Partial<User>>({
|
|
71
63
|
resource: 'user',
|
|
72
64
|
pagination: {
|
|
73
65
|
pageSize: 20,
|
|
@@ -97,15 +89,6 @@ export const UserListPage: React.FC<PropsWithChildren> = ({ children }) => {
|
|
|
97
89
|
},
|
|
98
90
|
});
|
|
99
91
|
|
|
100
|
-
const onSearch = () => {
|
|
101
|
-
const values = form.getFieldsValue();
|
|
102
|
-
searchFormProps?.onFinish?.({
|
|
103
|
-
...values,
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
const debouncedOnChange = debounce(onSearch, 500);
|
|
108
|
-
|
|
109
92
|
// fix for ant design filter dropdown contains operator
|
|
110
93
|
filters.map((filter) => {
|
|
111
94
|
if (filter.operator === 'contains' && Array.isArray(filter.value)) {
|
|
@@ -159,193 +142,197 @@ export const UserListPage: React.FC<PropsWithChildren> = ({ children }) => {
|
|
|
159
142
|
);
|
|
160
143
|
}}
|
|
161
144
|
>
|
|
162
|
-
<
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
rowKey="id"
|
|
171
|
-
>
|
|
172
|
-
<Table.Column
|
|
173
|
-
dataIndex="userid"
|
|
174
|
-
title="User ID"
|
|
175
|
-
render={(_, record) => {
|
|
176
|
-
return (
|
|
177
|
-
<Space>
|
|
178
|
-
<CustomAvatar
|
|
179
|
-
shape="square"
|
|
180
|
-
name={record.userid || ''}
|
|
181
|
-
src={`https://rhrc.woa.com/photo/150/${record.userid}.png`}
|
|
182
|
-
/>
|
|
183
|
-
<Text style={{ whiteSpace: 'nowrap' }}>{record.userid}</Text>
|
|
184
|
-
</Space>
|
|
185
|
-
);
|
|
186
|
-
}}
|
|
187
|
-
/>
|
|
188
|
-
<Table.Column
|
|
189
|
-
dataIndex="username"
|
|
190
|
-
title="User Name"
|
|
191
|
-
filterDropdown={(props) => (
|
|
192
|
-
<FilterDropdown
|
|
193
|
-
{...props}
|
|
194
|
-
clearFilters={() => {
|
|
195
|
-
props.setSelectedKeys([]);
|
|
196
|
-
props.confirm?.();
|
|
197
|
-
}}
|
|
198
|
-
>
|
|
199
|
-
<Input />
|
|
200
|
-
</FilterDropdown>
|
|
201
|
-
)}
|
|
202
|
-
defaultFilteredValue={getDefaultFilter(
|
|
203
|
-
'username',
|
|
204
|
-
filters,
|
|
205
|
-
'contains',
|
|
206
|
-
)}
|
|
207
|
-
/*filterIcon={<SearchOutlined />}*/
|
|
208
|
-
/>
|
|
209
|
-
<Table.Column
|
|
210
|
-
dataIndex="roles"
|
|
211
|
-
title="Roles"
|
|
212
|
-
defaultFilteredValue={getDefaultFilter(
|
|
213
|
-
'roles',
|
|
214
|
-
filters,
|
|
215
|
-
'contains',
|
|
216
|
-
)}
|
|
217
|
-
filterDropdown={(props) => (
|
|
218
|
-
<FilterDropdown
|
|
219
|
-
{...props}
|
|
220
|
-
clearFilters={() => {
|
|
221
|
-
props.setSelectedKeys([]);
|
|
222
|
-
props.confirm?.();
|
|
223
|
-
}}
|
|
224
|
-
>
|
|
225
|
-
<Select
|
|
226
|
-
options={roleOptions}
|
|
227
|
-
style={{ width: '150px' }}
|
|
228
|
-
placeholder="Select Role"
|
|
229
|
-
loading={rolesLoading}
|
|
230
|
-
/>
|
|
231
|
-
</FilterDropdown>
|
|
232
|
-
)}
|
|
233
|
-
render={(value) => {
|
|
234
|
-
return JSON.parse(value || '[]').map((role: string) => (
|
|
235
|
-
<RoleStatusTag key={role} role={role} />
|
|
236
|
-
));
|
|
145
|
+
<Card className="card-table">
|
|
146
|
+
<Table
|
|
147
|
+
{...tableProps}
|
|
148
|
+
pagination={{
|
|
149
|
+
...tableProps.pagination,
|
|
150
|
+
showTotal: (total) => (
|
|
151
|
+
<PaginationTotal total={total} entityName="user" />
|
|
152
|
+
),
|
|
237
153
|
}}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
{
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
154
|
+
rowKey="id"
|
|
155
|
+
>
|
|
156
|
+
<Table.Column
|
|
157
|
+
dataIndex="userid"
|
|
158
|
+
title="User ID"
|
|
159
|
+
render={(_, record) => {
|
|
160
|
+
return (
|
|
161
|
+
<Space>
|
|
162
|
+
<CustomAvatar
|
|
163
|
+
shape="square"
|
|
164
|
+
name={record.userid || ''}
|
|
165
|
+
src={`https://rhrc.woa.com/photo/150/${record.userid}.png`}
|
|
166
|
+
/>
|
|
167
|
+
<Text style={{ whiteSpace: 'nowrap' }}>
|
|
168
|
+
{record.userid}
|
|
169
|
+
</Text>
|
|
170
|
+
</Space>
|
|
171
|
+
);
|
|
172
|
+
}}
|
|
173
|
+
/>
|
|
174
|
+
<Table.Column
|
|
175
|
+
dataIndex="username"
|
|
176
|
+
title="User Name"
|
|
177
|
+
filterDropdown={(props) => (
|
|
178
|
+
<FilterDropdown
|
|
179
|
+
{...props}
|
|
180
|
+
clearFilters={() => {
|
|
181
|
+
props.setSelectedKeys([]);
|
|
182
|
+
props.confirm?.();
|
|
183
|
+
}}
|
|
184
|
+
>
|
|
185
|
+
<Input />
|
|
186
|
+
</FilterDropdown>
|
|
187
|
+
)}
|
|
188
|
+
defaultFilteredValue={getDefaultFilter(
|
|
189
|
+
'username',
|
|
190
|
+
filters,
|
|
191
|
+
'contains',
|
|
192
|
+
)}
|
|
193
|
+
/*filterIcon={<SearchOutlined />}*/
|
|
194
|
+
/>
|
|
195
|
+
<Table.Column
|
|
196
|
+
dataIndex="roles"
|
|
197
|
+
title="Roles"
|
|
198
|
+
defaultFilteredValue={getDefaultFilter(
|
|
199
|
+
'roles',
|
|
200
|
+
filters,
|
|
201
|
+
'contains',
|
|
202
|
+
)}
|
|
203
|
+
filterDropdown={(props) => (
|
|
204
|
+
<FilterDropdown
|
|
205
|
+
{...props}
|
|
206
|
+
clearFilters={() => {
|
|
207
|
+
props.setSelectedKeys([]);
|
|
208
|
+
props.confirm?.();
|
|
209
|
+
}}
|
|
210
|
+
>
|
|
211
|
+
<Select
|
|
212
|
+
options={roleOptions}
|
|
213
|
+
style={{ width: '150px' }}
|
|
214
|
+
placeholder="Select Role"
|
|
215
|
+
loading={rolesLoading}
|
|
216
|
+
/>
|
|
217
|
+
</FilterDropdown>
|
|
218
|
+
)}
|
|
219
|
+
render={(value) => {
|
|
220
|
+
return JSON.parse(value || '[]').map((role: string) => (
|
|
221
|
+
<RoleStatusTag key={role} role={role} />
|
|
222
|
+
));
|
|
223
|
+
}}
|
|
224
|
+
/>
|
|
225
|
+
<Table.Column
|
|
226
|
+
dataIndex="isApiKey"
|
|
227
|
+
title="API Key"
|
|
228
|
+
defaultFilteredValue={getDefaultFilter('isApiKey', filters, 'eq')}
|
|
229
|
+
filterDropdown={(props) => (
|
|
230
|
+
<FilterDropdown
|
|
231
|
+
{...props}
|
|
232
|
+
mapValue={(selectedKeys) => {
|
|
233
|
+
if (selectedKeys?.[0] === 'Yes') return true;
|
|
234
|
+
if (selectedKeys?.[0] === 'No') return false;
|
|
235
|
+
return selectedKeys;
|
|
236
|
+
}}
|
|
237
|
+
clearFilters={() => {
|
|
238
|
+
props.setSelectedKeys([]);
|
|
239
|
+
props.confirm?.();
|
|
240
|
+
}}
|
|
241
|
+
>
|
|
242
|
+
<Select
|
|
243
|
+
style={{ width: '120px' }}
|
|
244
|
+
placeholder="Select"
|
|
245
|
+
allowClear
|
|
246
|
+
options={[
|
|
247
|
+
{ label: 'Yes', value: 'Yes' },
|
|
248
|
+
{ label: 'No', value: 'No' },
|
|
249
|
+
]}
|
|
321
250
|
/>
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
251
|
+
</FilterDropdown>
|
|
252
|
+
)}
|
|
253
|
+
render={(value) => (
|
|
254
|
+
<Tag color={value ? 'blue' : 'default'}>
|
|
255
|
+
{value ? 'Yes' : 'No'}
|
|
256
|
+
</Tag>
|
|
257
|
+
)}
|
|
258
|
+
/>
|
|
259
|
+
<Table.Column
|
|
260
|
+
dataIndex="isActive"
|
|
261
|
+
title="Active"
|
|
262
|
+
defaultFilteredValue={getDefaultFilter('isActive', filters, 'eq')}
|
|
263
|
+
filterDropdown={(props) => (
|
|
264
|
+
<FilterDropdown
|
|
265
|
+
{...props}
|
|
266
|
+
mapValue={(selectedKeys) => {
|
|
267
|
+
if (selectedKeys?.[0] === 'Active') return true;
|
|
268
|
+
if (selectedKeys?.[0] === 'Inactive') return false;
|
|
269
|
+
return selectedKeys;
|
|
270
|
+
}}
|
|
271
|
+
clearFilters={() => {
|
|
272
|
+
props.setSelectedKeys([]);
|
|
273
|
+
props.confirm?.();
|
|
274
|
+
}}
|
|
275
|
+
>
|
|
276
|
+
<Select
|
|
277
|
+
style={{ width: '120px' }}
|
|
278
|
+
placeholder="Select"
|
|
279
|
+
allowClear
|
|
280
|
+
options={[
|
|
281
|
+
{ label: 'Active', value: 'Active' },
|
|
282
|
+
{ label: 'Inactive', value: 'Inactive' },
|
|
283
|
+
]}
|
|
329
284
|
/>
|
|
330
|
-
|
|
331
|
-
|
|
285
|
+
</FilterDropdown>
|
|
286
|
+
)}
|
|
287
|
+
render={(value) => (
|
|
288
|
+
<Tag color={value ? 'green' : 'red'}>
|
|
289
|
+
{value ? 'Active' : 'Inactive'}
|
|
290
|
+
</Tag>
|
|
291
|
+
)}
|
|
292
|
+
/>
|
|
293
|
+
<Table.Column
|
|
294
|
+
fixed="right"
|
|
295
|
+
title="Actions"
|
|
296
|
+
dataIndex="actions"
|
|
297
|
+
render={(_, record) => {
|
|
298
|
+
return (
|
|
299
|
+
<Space>
|
|
300
|
+
<ShowButton
|
|
301
|
+
hideText
|
|
332
302
|
size="small"
|
|
333
|
-
icon={<CodeOutlined />}
|
|
334
303
|
style={{ backgroundColor: 'transparent' }}
|
|
335
|
-
onClick={() =>
|
|
304
|
+
onClick={() =>
|
|
305
|
+
setShowModal({ type: 'show', id: record.id })
|
|
306
|
+
}
|
|
336
307
|
/>
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
308
|
+
<EditButton
|
|
309
|
+
hideText
|
|
310
|
+
size="small"
|
|
311
|
+
style={{ backgroundColor: 'transparent' }}
|
|
312
|
+
onClick={() =>
|
|
313
|
+
setShowModal({ type: 'edit', id: record.id })
|
|
314
|
+
}
|
|
315
|
+
/>
|
|
316
|
+
<Tooltip title="Generate SQL">
|
|
317
|
+
<Button
|
|
318
|
+
size="small"
|
|
319
|
+
icon={<CodeOutlined />}
|
|
320
|
+
style={{ backgroundColor: 'transparent' }}
|
|
321
|
+
onClick={() => handleShowSql(record)}
|
|
322
|
+
/>
|
|
323
|
+
</Tooltip>
|
|
324
|
+
<DeleteButton
|
|
325
|
+
hideText
|
|
326
|
+
size="small"
|
|
327
|
+
recordItemId={record.id}
|
|
328
|
+
style={{ backgroundColor: 'transparent' }}
|
|
329
|
+
/>
|
|
330
|
+
</Space>
|
|
331
|
+
);
|
|
332
|
+
}}
|
|
333
|
+
/>
|
|
334
|
+
</Table>
|
|
335
|
+
</Card>
|
|
349
336
|
</List>
|
|
350
337
|
|
|
351
338
|
{/* Show Drawer */}
|