ui-soxo-bootstrap-core 2.4.24 → 2.4.25-dev.11
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/.github/workflows/npm-publish.yml +37 -15
- package/core/components/extra-info/extra-info-details.js +109 -126
- package/core/components/landing-api/landing-api.js +22 -30
- package/core/lib/Store.js +20 -18
- package/core/lib/components/index.js +4 -1
- package/core/lib/components/sidemenu/sidemenu.js +153 -256
- package/core/lib/components/sidemenu/sidemenu.scss +39 -26
- package/core/lib/elements/basic/dragabble-wrapper/draggable-wrapper.js +119 -42
- package/core/lib/elements/basic/rangepicker/rangepicker.js +118 -29
- package/core/lib/elements/basic/switch/switch.js +35 -25
- package/core/lib/hooks/index.js +2 -12
- package/core/lib/hooks/use-otp-timer.js +99 -0
- package/core/lib/pages/login/login.js +255 -139
- package/core/lib/pages/login/login.scss +140 -32
- package/core/models/dashboard/dashboard.js +14 -0
- package/core/models/doctor/components/doctor-add/doctor-add.js +403 -0
- package/core/models/doctor/components/doctor-add/doctor-add.scss +32 -0
- package/core/models/menus/components/menu-add/menu-add.js +220 -267
- package/core/models/menus/components/menu-lists/menu-lists.js +366 -211
- package/core/models/menus/components/menu-lists/menu-lists.scss +6 -2
- package/core/models/menus/menus.js +256 -267
- package/core/models/roles/components/role-add/role-add.js +265 -228
- package/core/models/roles/components/role-list/role-list.js +326 -348
- package/core/models/roles/roles.js +191 -174
- package/core/models/staff/components/staff-add/staff-add.js +352 -0
- package/core/models/staff/components/staff-add/staff-add.scss +0 -0
- package/core/models/users/components/user-add/user-add.js +723 -367
- package/core/models/users/components/user-add/user-edit.js +90 -0
- package/core/models/users/users.js +318 -165
- package/core/modules/index.js +5 -8
- package/core/modules/reporting/components/index.js +5 -0
- package/core/modules/reporting/components/reporting-dashboard/reporting-dashboard.js +65 -2
- package/core/modules/steps/action-buttons.js +79 -0
- package/core/modules/steps/steps.js +553 -0
- package/core/modules/steps/steps.scss +158 -0
- package/core/modules/steps/timeline.js +49 -0
- package/package.json +2 -2
|
@@ -6,403 +6,381 @@ import React, { useState, useRef, useEffect, useContext } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { Link, useParams, useLocation } from 'react-router-dom';
|
|
8
8
|
|
|
9
|
-
import { Typography, Modal, Space, Switch, Popconfirm, Skeleton, Input, Drawer,Select} from 'antd';
|
|
9
|
+
import { Typography, Modal, Space, Switch, Popconfirm, Skeleton, Input, Drawer, Select } from 'antd';
|
|
10
10
|
|
|
11
11
|
import { TableComponent, Card, Button } from './../../../../lib';
|
|
12
12
|
|
|
13
13
|
import { ReloadOutlined, OrderedListOutlined, PicCenterOutlined, DeleteOutlined, EditOutlined, CopyOutlined } from '@ant-design/icons';
|
|
14
|
+
import { RolesAPI } from '../../..';
|
|
14
15
|
|
|
15
16
|
const { Title } = Typography;
|
|
16
17
|
|
|
17
|
-
|
|
18
18
|
const RoleList = ({ model, match, relativeAdd = false, additional_queries = [], disableAddModal = model.disableAddModal }) => {
|
|
19
|
+
const actions = [];
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
match = useParams();
|
|
23
|
-
|
|
24
|
-
// Block to get the url params #Note Location search is not working
|
|
25
|
-
let location = useLocation();
|
|
26
|
-
|
|
27
|
-
const query = new URLSearchParams(location.search);
|
|
28
|
-
|
|
29
|
-
console.log(query.get('step'));
|
|
30
|
-
|
|
31
|
-
let step = parseInt(query.get('step')) || 1;
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
const [loading, setLoading] = useState(false);
|
|
35
|
-
|
|
36
|
-
const [records, setRecords] = useState([]);
|
|
21
|
+
match = useParams();
|
|
37
22
|
|
|
38
|
-
|
|
23
|
+
// Block to get the url params #Note Location search is not working
|
|
24
|
+
let location = useLocation();
|
|
39
25
|
|
|
40
|
-
|
|
26
|
+
const query = new URLSearchParams(location.search);
|
|
41
27
|
|
|
42
|
-
|
|
28
|
+
console.log(query.get('step'));
|
|
43
29
|
|
|
44
|
-
|
|
30
|
+
let step = parseInt(query.get('step')) || 1;
|
|
31
|
+
//
|
|
45
32
|
|
|
46
|
-
|
|
33
|
+
const [loading, setLoading] = useState(false);
|
|
47
34
|
|
|
48
|
-
|
|
35
|
+
const [records, setRecords] = useState([]);
|
|
49
36
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}, []);
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
*/
|
|
57
|
-
const getRecords = () => {
|
|
58
|
-
|
|
59
|
-
let firstStepQueries = [{
|
|
60
|
-
field: 'step',
|
|
61
|
-
value: step
|
|
62
|
-
}]
|
|
63
|
-
|
|
64
|
-
let config = {
|
|
65
|
-
queries: [
|
|
66
|
-
// ...additional_queries,
|
|
67
|
-
// ...firstStepQueries
|
|
68
|
-
],
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// if (!additional_queries.length) {
|
|
72
|
-
|
|
73
|
-
// config.queries.push({
|
|
74
|
-
// field: 'header_id',
|
|
75
|
-
// value: null
|
|
76
|
-
// })
|
|
77
|
-
// }
|
|
37
|
+
const [view, setView] = useState(false);
|
|
78
38
|
|
|
79
|
-
|
|
39
|
+
const [visible, setVisible] = useState(false);
|
|
80
40
|
|
|
81
|
-
|
|
82
|
-
return model.get(config)
|
|
41
|
+
const [single, setSingle] = useState({});
|
|
83
42
|
|
|
84
|
-
|
|
43
|
+
var [queryValue, setQueryValue] = useState('');
|
|
85
44
|
|
|
86
|
-
|
|
87
|
-
var result = res;
|
|
45
|
+
const { Search } = Input;
|
|
88
46
|
|
|
89
|
-
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
getRecords();
|
|
49
|
+
}, []);
|
|
90
50
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
.catch((error) => {
|
|
102
|
-
|
|
103
|
-
setLoading(false);
|
|
104
|
-
|
|
105
|
-
console.log(error);
|
|
106
|
-
});
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
const getRecords = () => {
|
|
55
|
+
let firstStepQueries = [
|
|
56
|
+
{
|
|
57
|
+
field: 'step',
|
|
58
|
+
value: step,
|
|
59
|
+
},
|
|
60
|
+
];
|
|
107
61
|
|
|
62
|
+
let config = {
|
|
63
|
+
queries: [
|
|
64
|
+
// ...additional_queries,
|
|
65
|
+
// ...firstStepQueries
|
|
66
|
+
],
|
|
108
67
|
};
|
|
109
68
|
|
|
110
|
-
|
|
111
|
-
* Function to change view
|
|
112
|
-
*/
|
|
113
|
-
function changeView(result) {
|
|
114
|
-
setView(result);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Function to store search value
|
|
119
|
-
*/
|
|
120
|
-
function onSearch(event) {
|
|
121
|
-
setQueryValue(event.target.value);
|
|
122
|
-
}
|
|
69
|
+
// if (!additional_queries.length) {
|
|
123
70
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
71
|
+
// config.queries.push({
|
|
72
|
+
// field: 'header_id',
|
|
73
|
+
// value: null
|
|
74
|
+
// })
|
|
75
|
+
// }
|
|
128
76
|
|
|
129
|
-
|
|
77
|
+
setLoading(true);
|
|
130
78
|
|
|
131
|
-
|
|
79
|
+
// Get the records
|
|
80
|
+
return RolesAPI.getRole()
|
|
132
81
|
|
|
133
|
-
|
|
82
|
+
.then((res) => {
|
|
83
|
+
// setRecords(res.result);
|
|
84
|
+
var result = res;
|
|
134
85
|
|
|
135
|
-
|
|
86
|
+
// if (id) {
|
|
136
87
|
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
} else {
|
|
88
|
+
// var filtered = res.result.filter((record) => record.header_id = id)
|
|
141
89
|
|
|
142
|
-
|
|
90
|
+
// }
|
|
143
91
|
|
|
92
|
+
setRecords(result.result);
|
|
93
|
+
|
|
94
|
+
setLoading(false);
|
|
95
|
+
})
|
|
96
|
+
.catch((error) => {
|
|
97
|
+
setLoading(false);
|
|
98
|
+
|
|
99
|
+
console.log(error);
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Function to change view
|
|
105
|
+
*/
|
|
106
|
+
function changeView(result) {
|
|
107
|
+
setView(result);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Function to store search value
|
|
112
|
+
*/
|
|
113
|
+
function onSearch(event) {
|
|
114
|
+
setQueryValue(event.target.value);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Search in candidate visit List
|
|
119
|
+
*/
|
|
120
|
+
let filtered = records.filter((record) => {
|
|
121
|
+
let searchText = queryValue.toUpperCase();
|
|
122
|
+
|
|
123
|
+
if (queryValue) {
|
|
124
|
+
if (record.name !== null) {
|
|
125
|
+
if (record.name.toUpperCase().indexOf(searchText) != -1) {
|
|
126
|
+
return true;
|
|
144
127
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
* Function hides the modal
|
|
149
|
-
*
|
|
150
|
-
* @param reload
|
|
151
|
-
*/
|
|
152
|
-
function closeModal() {
|
|
153
|
-
|
|
154
|
-
setVisible(false);
|
|
155
|
-
|
|
156
|
-
// if (reload) {
|
|
157
|
-
// getRecords();
|
|
158
|
-
// }
|
|
128
|
+
}
|
|
129
|
+
} else {
|
|
130
|
+
return true;
|
|
159
131
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Function hides the modal
|
|
136
|
+
*
|
|
137
|
+
* @param reload
|
|
138
|
+
*/
|
|
139
|
+
function closeModal() {
|
|
140
|
+
setVisible(false);
|
|
141
|
+
|
|
142
|
+
// if (reload) {
|
|
143
|
+
// getRecords();
|
|
144
|
+
// }
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* On delete of each record
|
|
148
|
+
*/
|
|
149
|
+
function onDelete(id) {
|
|
150
|
+
RolesAPI.deleteRole(id)
|
|
151
|
+
.then((res) => {
|
|
152
|
+
if (res) {
|
|
153
|
+
getRecords();
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
.catch((error) => {
|
|
157
|
+
setLoading(false);
|
|
158
|
+
|
|
159
|
+
console.log(error);
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const cols = [
|
|
164
|
+
...[
|
|
165
|
+
{
|
|
166
|
+
title: '#',
|
|
167
|
+
dataIndex: 'index',
|
|
168
|
+
render: (value, item, index) => index + 1,
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
...model.columns.map((entry) => {
|
|
172
|
+
if (entry.sort) {
|
|
173
|
+
return {
|
|
174
|
+
render: (record) => {
|
|
175
|
+
if (entry.render) {
|
|
176
|
+
return entry.render(record);
|
|
177
|
+
} else {
|
|
178
|
+
return entry.field.split('.').reduce((acc, part) => acc && acc[part], record);
|
|
170
179
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
...[
|
|
184
|
-
{
|
|
185
|
-
title: '#',
|
|
186
|
-
dataIndex: 'index',
|
|
187
|
-
render: (value, item, index) => index + 1,
|
|
188
|
-
},
|
|
189
|
-
],
|
|
190
|
-
...model.columns.map((entry) => {
|
|
191
|
-
if (entry.sort) {
|
|
192
|
-
return {
|
|
193
|
-
render: (record) => {
|
|
194
|
-
if (entry.render) {
|
|
195
|
-
return entry.render(record);
|
|
196
|
-
} else {
|
|
197
|
-
return entry.field.split('.').reduce((acc, part) => acc && acc[part], record);
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
title: entry.caption,
|
|
201
|
-
key: entry.field,
|
|
202
|
-
// sorter: (a, b) => entry.sort(a, b),
|
|
203
|
-
sortDirections: ['ascend', 'descend', 'ascend'],
|
|
204
|
-
};
|
|
180
|
+
},
|
|
181
|
+
title: entry.caption,
|
|
182
|
+
key: entry.field,
|
|
183
|
+
// sorter: (a, b) => entry.sort(a, b),
|
|
184
|
+
sortDirections: ['ascend', 'descend', 'ascend'],
|
|
185
|
+
};
|
|
186
|
+
} else {
|
|
187
|
+
return {
|
|
188
|
+
render: (record) => {
|
|
189
|
+
if (entry.render) {
|
|
190
|
+
return entry.render(record);
|
|
191
|
+
// return entry.field.split('.').reduce((acc, part) => acc && acc[part], record);
|
|
205
192
|
} else {
|
|
206
|
-
|
|
207
|
-
render: (record) => {
|
|
208
|
-
if (entry.render) {
|
|
209
|
-
return entry.render(record);
|
|
210
|
-
// return entry.field.split('.').reduce((acc, part) => acc && acc[part], record);
|
|
211
|
-
} else {
|
|
212
|
-
return entry.field.split('.').reduce((acc, part) => acc && acc[part], record);
|
|
213
|
-
}
|
|
214
|
-
// return record[entry.field]
|
|
215
|
-
},
|
|
216
|
-
title: entry.caption,
|
|
217
|
-
key: entry.field,
|
|
218
|
-
// dataIndex: entry.field,
|
|
219
|
-
};
|
|
193
|
+
return entry.field.split('.').reduce((acc, part) => acc && acc[part], record);
|
|
220
194
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
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
|
-
|
|
195
|
+
// return record[entry.field]
|
|
196
|
+
},
|
|
197
|
+
title: entry.caption,
|
|
198
|
+
key: entry.field,
|
|
199
|
+
// dataIndex: entry.field,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
}),
|
|
203
|
+
...[
|
|
204
|
+
{
|
|
205
|
+
title: '',
|
|
206
|
+
key: 'action',
|
|
207
|
+
render: (text, record) => {
|
|
208
|
+
return (
|
|
209
|
+
<Space size="middle">
|
|
210
|
+
{/* Edit */}
|
|
211
|
+
{!model.ModalAddComponent ? null : (
|
|
212
|
+
<Button
|
|
213
|
+
size={'small'}
|
|
214
|
+
type="dashed"
|
|
215
|
+
onClick={() => {
|
|
216
|
+
setSingle({ ...record });
|
|
217
|
+
|
|
218
|
+
setVisible(true);
|
|
219
|
+
}}
|
|
220
|
+
>
|
|
221
|
+
<EditOutlined />
|
|
222
|
+
</Button>
|
|
223
|
+
)}
|
|
224
|
+
{/* Edit Ends */}
|
|
225
|
+
|
|
226
|
+
{/* Copy */}
|
|
227
|
+
{!model.ModalAddComponent ? null : (
|
|
228
|
+
<Button
|
|
229
|
+
size={'small'}
|
|
230
|
+
type="dashed"
|
|
231
|
+
onClick={() => {
|
|
232
|
+
setSingle({
|
|
233
|
+
...record,
|
|
234
|
+
id: null,
|
|
235
|
+
copy: true,
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
setVisible(true);
|
|
239
|
+
}}
|
|
240
|
+
>
|
|
241
|
+
<CopyOutlined />
|
|
242
|
+
</Button>
|
|
243
|
+
)}
|
|
244
|
+
{/* Copy Ends */}
|
|
245
|
+
|
|
246
|
+
{/* Delete Icon */}
|
|
247
|
+
<Popconfirm
|
|
248
|
+
title="Are you sure"
|
|
249
|
+
onConfirm={() => {
|
|
250
|
+
onDelete(record.id);
|
|
251
|
+
}}
|
|
252
|
+
>
|
|
253
|
+
<Button size={'small'} type="dashed">
|
|
254
|
+
<DeleteOutlined />
|
|
255
|
+
</Button>
|
|
256
|
+
</Popconfirm>
|
|
257
|
+
{/* Delete Icon */}
|
|
258
|
+
|
|
259
|
+
{/* {!model.hideView && !actions.length ? <Link to={`/${model.name}/${text.id}`}>View</Link> : null} */}
|
|
260
|
+
|
|
261
|
+
{/* {!model.hideView && !actions.length ? <Link to={`/users/${record['id']}`}>View</Link> : null} */}
|
|
262
|
+
|
|
263
|
+
{/* {actions.map((action) => (
|
|
276
264
|
<Link to={action.url(record)}>{action.caption}</Link>
|
|
277
265
|
))} */}
|
|
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
|
-
<div className="table-bar">
|
|
306
|
-
{/* Table Filters */}
|
|
307
|
-
{/* <div className="table-filters">
|
|
266
|
+
</Space>
|
|
267
|
+
);
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
],
|
|
271
|
+
];
|
|
272
|
+
|
|
273
|
+
return (
|
|
274
|
+
<Card className="generic-list">
|
|
275
|
+
{/* Table Header */}
|
|
276
|
+
<div className="table-header">
|
|
277
|
+
<div className="table-title">
|
|
278
|
+
<Search
|
|
279
|
+
placeholder="Enter Search Value"
|
|
280
|
+
allowClear
|
|
281
|
+
// value={query}
|
|
282
|
+
style={{ width: 300, marginTop: '10px', marginBottom: '20px' }}
|
|
283
|
+
onChange={onSearch}
|
|
284
|
+
/>
|
|
285
|
+
{/* <Title level={4}>{model.name}</Title> */}
|
|
286
|
+
|
|
287
|
+
{/* <p>{loading ? 'Loading records' : `${record.length} records`}</p> */}
|
|
288
|
+
</div>
|
|
289
|
+
|
|
290
|
+
<div className="table-bar">
|
|
291
|
+
{/* Table Filters */}
|
|
292
|
+
{/* <div className="table-filters">
|
|
308
293
|
<Space direction="vertical" size={12}></Space>
|
|
309
294
|
</div> */}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
</div>
|
|
342
|
-
</div>
|
|
343
|
-
</div>
|
|
295
|
+
{/* Table Filters Ends */}
|
|
296
|
+
|
|
297
|
+
<div className="table-actions">
|
|
298
|
+
<div className="button-container">
|
|
299
|
+
<Space size="small">
|
|
300
|
+
<Button onClick={getRecords} size={'small'} type="default">
|
|
301
|
+
<ReloadOutlined />
|
|
302
|
+
</Button>
|
|
303
|
+
|
|
304
|
+
<Switch
|
|
305
|
+
defaultChecked
|
|
306
|
+
onChange={changeView}
|
|
307
|
+
checked={view}
|
|
308
|
+
checkedChildren={<OrderedListOutlined />}
|
|
309
|
+
unCheckedChildren={<PicCenterOutlined />}
|
|
310
|
+
/>
|
|
311
|
+
|
|
312
|
+
{/* {disableAddModal || !model.ModalAddComponent ? null : ( */}
|
|
313
|
+
{!model.ModalAddComponent ? null : (
|
|
314
|
+
<Button
|
|
315
|
+
type="primary"
|
|
316
|
+
onClick={() => {
|
|
317
|
+
setSingle({});
|
|
318
|
+
|
|
319
|
+
setVisible(true);
|
|
320
|
+
}}
|
|
321
|
+
>
|
|
322
|
+
Create Role
|
|
323
|
+
</Button>
|
|
324
|
+
)}
|
|
325
|
+
</Space>
|
|
344
326
|
</div>
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
327
|
+
</div>
|
|
328
|
+
</div>
|
|
329
|
+
</div>
|
|
330
|
+
|
|
331
|
+
{/* Table Header Ends */}
|
|
332
|
+
|
|
333
|
+
{loading ? (
|
|
334
|
+
<Skeleton />
|
|
335
|
+
) : (
|
|
336
|
+
<>
|
|
337
|
+
<>
|
|
338
|
+
{!view ? (
|
|
339
|
+
<div className="card card-shadow">
|
|
340
|
+
<TableComponent
|
|
341
|
+
// rowKey={obj => obj.id}
|
|
342
|
+
// ref={(ref) => { tableRef = ref }}
|
|
343
|
+
loading={loading}
|
|
344
|
+
dataSource={filtered ? filtered : records}
|
|
345
|
+
columns={cols}
|
|
346
|
+
></TableComponent>
|
|
347
|
+
</div>
|
|
350
348
|
) : (
|
|
351
|
-
|
|
352
|
-
<>
|
|
353
|
-
{!view ? (
|
|
354
|
-
<div className='card card-shadow'>
|
|
355
|
-
<TableComponent
|
|
356
|
-
// rowKey={obj => obj.id}
|
|
357
|
-
// ref={(ref) => { tableRef = ref }}
|
|
358
|
-
loading={loading}
|
|
359
|
-
dataSource={filtered ? filtered : records}
|
|
360
|
-
columns={cols}
|
|
361
|
-
></TableComponent>
|
|
362
|
-
</div>
|
|
363
|
-
) : (
|
|
364
|
-
<CardList model={model} data={filtered ? filtered : records} />
|
|
365
|
-
)}
|
|
366
|
-
</>
|
|
367
|
-
</>
|
|
349
|
+
<CardList model={model} data={filtered ? filtered : records} />
|
|
368
350
|
)}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
351
|
+
</>
|
|
352
|
+
</>
|
|
353
|
+
)}
|
|
354
|
+
|
|
355
|
+
{/* Add Modal */}
|
|
356
|
+
<Drawer
|
|
357
|
+
title={single?.id ? 'Edit Role' : 'Create New Role'}
|
|
358
|
+
width={850}
|
|
359
|
+
open={visible}
|
|
360
|
+
destroyOnClose
|
|
361
|
+
onClose={closeModal}
|
|
362
|
+
bodyStyle={{ paddingBottom: 80 }}
|
|
363
|
+
>
|
|
364
|
+
<model.ModalAddComponent
|
|
365
|
+
match={match}
|
|
366
|
+
model={model}
|
|
367
|
+
additional_queries={additional_queries}
|
|
368
|
+
formContent={single}
|
|
369
|
+
callback={(event) => {
|
|
385
370
|
closeModal();
|
|
386
371
|
getRecords();
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
</Drawer>
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
{/* <FormCreator formContent={{ [model]: {} }} modelIndex="requestId" model={model} onSubmit={createRecord} config={step} /> */}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
</Card>
|
|
372
|
+
}}
|
|
373
|
+
/>
|
|
374
|
+
</Drawer>
|
|
397
375
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
376
|
+
{/* <FormCreator formContent={{ [model]: {} }} modelIndex="requestId" model={model} onSubmit={createRecord} config={step} /> */}
|
|
377
|
+
</Card>
|
|
378
|
+
);
|
|
379
|
+
};
|
|
401
380
|
|
|
402
381
|
function CardList({ model, data, url, ...props }) {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
382
|
+
return data.map((record, index) => {
|
|
383
|
+
return <model.Card record={record} model={model} index={index} key={index} {...record} {...props} />;
|
|
384
|
+
});
|
|
406
385
|
}
|
|
407
386
|
export default RoleList;
|
|
408
|
-
|