1
+ import PropTypes from 'prop-types' ;
2
+ import React , { Component } from 'react' ;
1
3
import { httpActions } from '@codetanzania/ewea-api-client' ;
2
4
import { Connect , reduxActions } from '@codetanzania/ewea-api-states' ;
3
5
import { Col , Modal } from 'antd' ;
4
6
import { PlusOutlined } from '@ant-design/icons' ;
5
7
import isArray from 'lodash/isArray' ;
6
- import PropTypes from 'prop-types' ;
7
- import React , { Component } from 'react' ;
8
+
8
9
import NotificationForm from '../../components/NotificationForm' ;
9
10
import Topbar from '../../components/Topbar' ;
10
- import EventCertaintyForm from './Form ' ;
11
+ import SettingForm from '../../components/SettingForm ' ;
11
12
import ListItemActions from '../../components/ListItemActions' ;
12
13
import ListItem from '../../components/ListItem' ;
13
14
import ItemList from '../../components/List' ;
14
15
import { notifyError , notifySuccess } from '../../util' ;
15
16
import './styles.css' ;
16
17
17
- /* constants */
18
+ /* http actions */
19
+ const {
20
+ getFocalPeople,
21
+ getJurisdictions,
22
+ getPartyGroups,
23
+ getRoles,
24
+ getAgencies,
25
+ getEventCertaintiesExportUrl,
26
+ } = httpActions ;
27
+ /* redux actions */
18
28
const {
19
29
closeEventCertaintyForm,
20
30
getEventCertainties,
@@ -24,26 +34,19 @@ const {
24
34
refreshEventCertainties,
25
35
paginateEventCertainties,
26
36
deleteEventCertainty,
37
+ postEventCertainty,
38
+ putEventCertainty,
27
39
} = reduxActions ;
28
- const {
29
- getFocalPeople,
30
- getJurisdictions,
31
- getPartyGroups,
32
- getRoles,
33
- getAgencies,
34
- getEventCertaintiesExportUrl,
35
- } = httpActions ;
36
40
41
+ /* constants */
42
+ const { confirm } = Modal ;
37
43
const nameSpan = { xxl : 4 , xl : 5 , lg : 6 , md : 7 , sm : 0 , xs : 0 } ;
38
44
const descriptionSpan = { xxl : 18 , xl : 17 , lg : 16 , md : 14 , sm : 20 , xs : 18 } ;
39
-
40
45
const headerLayout = [
41
46
{ ...nameSpan , header : 'Name' } ,
42
47
{ ...descriptionSpan , header : 'Description' } ,
43
48
] ;
44
49
45
- const { confirm } = Modal ;
46
-
47
50
/**
48
51
* @class
49
52
* @name EventCertainties
@@ -201,6 +204,7 @@ class EventCertainties extends Component {
201
204
* @since 0.1.0
202
205
*/
203
206
handleAfterCloseForm = ( ) => {
207
+ selectEventCertainty ( null ) ;
204
208
this . setState ( { isEditForm : false } ) ;
205
209
} ;
206
210
@@ -384,11 +388,12 @@ class EventCertainties extends Component {
384
388
maskClosable = { false }
385
389
afterClose = { this . handleAfterCloseForm }
386
390
>
387
- < EventCertaintyForm
391
+ < SettingForm
392
+ setting = { eventCertainty }
388
393
posting = { posting }
389
- isEditForm = { isEditForm }
390
- eventCertainty = { eventCertainty }
391
394
onCancel = { this . closeEventCertaintyForm }
395
+ onCreate = { postEventCertainty }
396
+ onUpdate = { putEventCertainty }
392
397
/>
393
398
</ Modal >
394
399
{ /* end create/edit form modal */ }
0 commit comments