ui-soxo-bootstrap-core 2.5.6 → 2.5.7

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.
@@ -4,7 +4,7 @@
4
4
  }
5
5
 
6
6
  .ant-collapse {
7
- background: transparent !important;
7
+ background-color: #ffff !important;
8
8
  border: none !important;
9
9
  }
10
10
  .ant-collapse > .ant-collapse-item {
@@ -13,7 +13,7 @@
13
13
  }
14
14
 
15
15
  .ant-collapse > .ant-collapse-item {
16
- margin-bottom: 14px; // GAP between each panel
16
+ margin-bottom: 6px; // GAP between each panel
17
17
  // border: none !important;
18
18
  }
19
19
 
@@ -25,7 +25,7 @@
25
25
  }
26
26
 
27
27
  .nested-collapse {
28
- margin-left: 20px; // indent child collapses
28
+ margin-left: 2px; // indent child collapses
29
29
  }
30
30
 
31
31
  .nested-collapse .ant-collapse-item {
@@ -38,4 +38,9 @@
38
38
  padding: 10px 14px;
39
39
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
40
40
  }
41
+ .ant-collapse > .ant-collapse-item > .ant-collapse-heade{
42
+ align-items: center !important;
43
+ }
44
+
45
+
41
46
 
@@ -1,7 +1,7 @@
1
1
  // @ts-nocheck
2
2
  import React from 'react';
3
3
  import Base from '../base/base';
4
-
4
+ import { ApiUtils } from '../../lib'; // adjust path if needed
5
5
 
6
6
  import MenuList from './components/menu-list/menu-list';
7
7
 
@@ -12,7 +12,6 @@ import MenuAdd from './components/menu-add/menu-add';
12
12
  import { DateUtils } from './../../lib/';
13
13
  import MenuLists from './components/menu-lists/menu-lists';
14
14
 
15
-
16
15
  // import MenuAdd from '../modules/common/resources/menu-add/menu-add';
17
16
 
18
17
  // import MenuDetail from '../modules/common/resources/menu-detail/menu-detail';
@@ -20,272 +19,273 @@ import MenuLists from './components/menu-lists/menu-lists';
20
19
  // import { Models, Pages, Modules } from './index';
21
20
 
22
21
  class MenusAPI extends Base {
23
-
24
- constructor() {
25
-
26
- super();
27
-
28
- // this.id = model.id;
29
-
30
- // this.name = 'Menus';
31
-
32
- this.fields = [
33
- {
34
- field: 'name',
35
- caption: 'Name',
36
- },
37
- {
38
- field: 'path',
39
- caption: 'Path',
40
- },
41
- ];
42
- }
43
-
44
- get getEndpoint() {
45
- return 'core-menus';
46
- }
47
-
48
- get path() {
49
- return `menus`;
50
- }
51
-
52
- get getName() {
53
- return this.modelName;
54
- }
55
-
56
- get modelName() {
57
- return `core-menus`;
58
- }
59
-
60
- get route() {
61
- return 'core-menus';
62
- }
63
-
64
- get disableAddModal() {
65
- return false;
66
- }
67
-
68
- get disableEditModal() {
69
- return false;
70
- }
71
-
72
- /**
73
- *
74
- */
75
- get columns() {
76
- return [
77
-
78
- {
79
- caption: 'Id',
80
- field: 'id',
81
- key: 'id',
82
- },
83
-
84
- {
85
- caption: 'Name',
86
- field: 'name',
87
- key: 'name',
88
- },
89
-
90
- {
91
- caption: 'Description',
92
- field: 'description',
93
- key: 'description',
94
- },
95
-
96
- {
97
- caption: 'Path',
98
- field: 'path',
99
- key: 'path',
100
- },
101
-
102
- {
103
- caption: 'Route',
104
- field: 'route',
105
- key: 'route',
106
- },
107
- {
108
- caption: 'Created at',
109
- field: 'created_at',
110
- key: 'created_at',
111
- render: (ele) => {
112
- return ele.created_at ? DateUtils.formatDate(ele.created_at) : null
113
- },
114
- },
115
- ];
116
- }
117
-
118
- ListComponent = MenuList;
119
-
120
- DetailComponent = MenuDetail;
121
-
122
- ModalAddComponent = (props) => <MenuAdd model={this} {...props} />;
123
-
124
- // ModalAddComponent = (props) => <GenericAdd model={this} {...props} />;
125
-
126
- /**
127
- * Get the data from the table
128
- */
129
- // get = (queries) => {
130
- // return this.getMethod(queries).then((result) => {
131
- // return Promise.all(result.menus.map((menu) => this.loadModule(menu))).then((result) => {
132
- // return { menus: result };
133
- // });
134
- // });
135
- // };
136
-
137
- /**
138
- * Load the module of the menu
139
- *
140
- * @param {*} param0
141
- * @returns
142
- */
143
- loadModule = (menu) => { };
144
-
145
- /**
146
- * load the detail of menu
147
- *
148
- * @param {*} menu
149
- * @returns
150
- */
151
- getDetail = (id) => {
152
- return this.getRecord(id).then((result) => {
153
- return result;
154
- });
155
- };
156
-
157
- /**
158
- * load the list of menu
159
- *
160
- * @param {*} menu
161
- * @returns
162
- */
163
- getMenus = (config) => {
22
+ constructor() {
23
+ super();
24
+
25
+ // this.id = model.id;
26
+
27
+ // this.name = 'Menus';
28
+
29
+ this.fields = [
30
+ {
31
+ field: 'name',
32
+ caption: 'Name',
33
+ },
34
+ {
35
+ field: 'path',
36
+ caption: 'Path',
37
+ },
38
+ ];
39
+ }
40
+
41
+ get getEndpoint() {
42
+ return 'core-menus';
43
+ }
44
+
45
+ get path() {
46
+ return `menus`;
47
+ }
48
+
49
+ get getName() {
50
+ return this.modelName;
51
+ }
52
+
53
+ get modelName() {
54
+ return `core-menus`;
55
+ }
56
+
57
+ get route() {
58
+ return 'core-menus';
59
+ }
60
+
61
+ get disableAddModal() {
62
+ return false;
63
+ }
64
+
65
+ get disableEditModal() {
66
+ return false;
67
+ }
68
+
69
+ /**
70
+ *
71
+ */
72
+ get columns() {
73
+ return [
74
+ {
75
+ caption: 'Id',
76
+ field: 'id',
77
+ key: 'id',
78
+ },
79
+
80
+ {
81
+ caption: 'Name',
82
+ field: 'name',
83
+ key: 'name',
84
+ },
85
+
86
+ {
87
+ caption: 'Description',
88
+ field: 'description',
89
+ key: 'description',
90
+ },
91
+
92
+ {
93
+ caption: 'Path',
94
+ field: 'path',
95
+ key: 'path',
96
+ },
97
+
98
+ {
99
+ caption: 'Route',
100
+ field: 'route',
101
+ key: 'route',
102
+ },
103
+ {
104
+ caption: 'Created at',
105
+ field: 'created_at',
106
+ key: 'created_at',
107
+ render: (ele) => {
108
+ return ele.created_at ? DateUtils.formatDate(ele.created_at) : null;
109
+ },
110
+ },
111
+ ];
112
+ }
113
+
114
+ ListComponent = MenuLists;
115
+
116
+ DetailComponent = MenuDetail;
117
+
118
+ ModalAddComponent = (props) => <MenuAdd model={this} {...props} />;
119
+
120
+ // ModalAddComponent = (props) => <GenericAdd model={this} {...props} />;
121
+
122
+ /**
123
+ * Get the data from the table
124
+ */
125
+ // get = (queries) => {
126
+ // return this.getMethod(queries).then((result) => {
127
+ // return Promise.all(result.menus.map((menu) => this.loadModule(menu))).then((result) => {
128
+ // return { menus: result };
129
+ // });
130
+ // });
131
+ // };
132
+
133
+ /**
134
+ * Load the module of the menu
135
+ *
136
+ * @param {*} param0
137
+ * @returns
138
+ */
139
+ loadModule = (menu) => {};
140
+
141
+ /**
142
+ * load the detail of menu
143
+ *
144
+ * @param {*} menu
145
+ * @returns
146
+ */
147
+ getDetail = (id) => {
148
+ return this.getRecord(id).then((result) => {
149
+ return result;
150
+ });
151
+ };
152
+
153
+ /**
154
+ * Save menu order (drag & drop)
155
+ */
156
+ saveOrder = ({ formBody }) => {
157
+ return ApiUtils.put({
158
+ url: `core-menus/menu-order`,
159
+ formBody,
160
+ });
161
+ };
162
+
163
+ /**
164
+ * create menu
165
+ */
166
+
167
+ createMenu = ({ formBody }) => {
168
+ return ApiUtils.post({
169
+ url: `core-menus/create-menu`,
170
+ formBody,
171
+ });
172
+ };
173
+
174
+ /**
175
+ * load the list of menu
176
+ *
177
+ * @param {*} menu
178
+ * @returns
179
+ */
180
+ getMenus = (config) => {
164
181
  // Use 'core-menus' endpoint if REACT_APP_USE_CORE_MENUS is true (used for Matria)
165
- const url = process.env.REACT_APP_USE_CORE_MENUS === 'true'
166
- ? 'core-menus/get-menus' // Matria
167
- : 'menus/get-menus'; // NURA
168
-
169
- return this.get({ url, config }).then(result => result);
170
- };
171
-
172
-
173
-
174
-
175
-
176
- getCoreMenus = () => {
177
-
178
- return [
179
-
180
- // {
181
-
182
- // caption: 'Configure',
183
- // sub_menus: [
184
-
185
- // // {
186
- // // // is_visible: true,
187
- // // path: '/process',
188
- // // caption: 'Process',
189
- // // },
190
-
191
- // // {
192
- // // path: '/models',
193
- // // caption: 'Models',
194
- // // },
195
-
196
- // {
197
- // path: '/pages',
198
- // caption: 'Pages',
199
- // },
200
-
201
-
202
- // {
203
- // path: '/forms',
204
- // caption: 'Forms',
205
- // },
206
-
207
- // {
208
- // path: '/actions',
209
- // caption: 'Actions',
210
- // },
211
-
212
- // {
213
- // path: '/permissions',
214
- // caption: 'Permissions',
215
- // },
216
-
217
- // {
218
- // path: '/questions',
219
- // caption: 'Questions',
220
- // },
221
-
222
-
223
- // {
224
- // path: '/lookup-types',
225
- // caption: 'Lookup Types',
226
- // },
227
-
228
- // ],
229
- // },
230
-
231
- // {
232
-
233
- // caption: 'Access Control',
234
- // sub_menus: [
235
- // // {
236
- // // path: '/users',
237
- // // caption: 'Users',
238
- // // },
239
-
240
- // {
241
- // path: '/roles',
242
- // caption: 'Roles',
243
- // },
244
-
245
- // {
246
- // path: '/menus',
247
- // caption: 'Menus',
248
- // },
249
- // ]
250
- // },
251
-
252
- // {
253
-
254
- // caption: 'Settings',
255
- // sub_menus: [
256
- // {
257
- // path: '/branches',
258
- // caption: 'Branches',
259
- // },
260
-
261
- // {
262
- // path: '/departments',
263
- // caption: 'Departments',
264
- // },
265
-
266
- // {
267
- // path: '/financial-years',
268
- // caption: 'Financial Years',
269
- // },
270
- // {
271
- // path: '/invoice-numbers',
272
- // caption: 'Invoice Numbers',
273
- // },
274
-
275
- // ]
276
- // },
277
- // {
278
- // caption: 'Preferences',
279
- // sub_menus: [{
280
- // path: '/change-password',
281
- // caption: 'Change Password'
282
- // }]
283
- // }
284
-
285
- ];
286
-
287
- }
288
-
182
+ const url =
183
+ process.env.REACT_APP_USE_CORE_MENUS === 'true'
184
+ ? 'core-menus/get-menus' // Matria
185
+ : 'menus/get-menus'; // NURA
186
+
187
+ return this.get({
188
+ url,
189
+ config,
190
+ }).then((result) => result);
191
+ };
192
+
193
+ // get core-menu list with submenu
194
+ getCoreMenuLists = () => {
195
+ const url = 'core-menus/core-menus?step=1&header_id=null';
196
+
197
+ return this.get({
198
+ url,
199
+ }).then((result) => result);
200
+ };
201
+
202
+ getCoreMenus = () => {
203
+ return [
204
+ // {
205
+ // caption: 'Configure',
206
+ // sub_menus: [
207
+ // // {
208
+ // // // is_visible: true,
209
+ // // path: '/process',
210
+ // // caption: 'Process',
211
+ // // },
212
+ // // {
213
+ // // path: '/models',
214
+ // // caption: 'Models',
215
+ // // },
216
+ // {
217
+ // path: '/pages',
218
+ // caption: 'Pages',
219
+ // },
220
+ // {
221
+ // path: '/forms',
222
+ // caption: 'Forms',
223
+ // },
224
+ // {
225
+ // path: '/actions',
226
+ // caption: 'Actions',
227
+ // },
228
+ // {
229
+ // path: '/permissions',
230
+ // caption: 'Permissions',
231
+ // },
232
+ // {
233
+ // path: '/questions',
234
+ // caption: 'Questions',
235
+ // },
236
+ // {
237
+ // path: '/lookup-types',
238
+ // caption: 'Lookup Types',
239
+ // },
240
+ // ],
241
+ // },
242
+ // {
243
+ // caption: 'Access Control',
244
+ // sub_menus: [
245
+ // // {
246
+ // // path: '/users',
247
+ // // caption: 'Users',
248
+ // // },
249
+ // {
250
+ // path: '/roles',
251
+ // caption: 'Roles',
252
+ // },
253
+ // {
254
+ // path: '/menus',
255
+ // caption: 'Menus',
256
+ // },
257
+ // ]
258
+ // },
259
+ // {
260
+ // caption: 'Settings',
261
+ // sub_menus: [
262
+ // {
263
+ // path: '/branches',
264
+ // caption: 'Branches',
265
+ // },
266
+ // {
267
+ // path: '/departments',
268
+ // caption: 'Departments',
269
+ // },
270
+ // {
271
+ // path: '/financial-years',
272
+ // caption: 'Financial Years',
273
+ // },
274
+ // {
275
+ // path: '/invoice-numbers',
276
+ // caption: 'Invoice Numbers',
277
+ // },
278
+ // ]
279
+ // },
280
+ // {
281
+ // caption: 'Preferences',
282
+ // sub_menus: [{
283
+ // path: '/change-password',
284
+ // caption: 'Change Password'
285
+ // }]
286
+ // }
287
+ ];
288
+ };
289
289
  }
290
290
 
291
291
  export default MenusAPI;