1
+ import React , { Component } from 'react' ;
2
+ import PropTypes from 'prop-types' ;
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
8
import get from 'lodash/get' ;
7
- import PropTypes from 'prop-types' ;
8
- import React , { Component } from 'react' ;
9
+
9
10
import NotificationForm from '../../components/NotificationForm' ;
10
11
import Topbar from '../../components/Topbar' ;
11
- import EventUrgencyForm from './Form ' ;
12
+ import SettingForm from '../../components/SettingForm ' ;
12
13
import ListItemActions from '../../components/ListItemActions' ;
13
14
import ListItem from '../../components/ListItem' ;
14
15
import ItemList from '../../components/List' ;
15
16
import { notifyError , notifySuccess } from '../../util' ;
16
17
import './styles.css' ;
17
18
18
- /* constants */
19
+ /* http actions */
19
20
const {
20
21
getFocalPeople,
21
22
getJurisdictions,
@@ -24,6 +25,7 @@ const {
24
25
getAgencies,
25
26
getEventUrgenciesExportUrl,
26
27
} = httpActions ;
28
+ /* redux actions */
27
29
const {
28
30
closeEventUrgencyForm,
29
31
getEventUrgencies,
@@ -33,18 +35,19 @@ const {
33
35
refreshEventUrgencies,
34
36
paginateEventUrgencies,
35
37
deleteEventUrgency,
38
+ postEventUrgency,
39
+ putEventUrgency,
36
40
} = reduxActions ;
37
41
42
+ /* constants */
43
+ const { confirm } = Modal ;
38
44
const nameSpan = { xxl : 4 , xl : 5 , lg : 6 , md : 7 , sm : 0 , xs : 0 } ;
39
45
const descriptionSpan = { xxl : 18 , xl : 17 , lg : 16 , md : 14 , sm : 20 , xs : 18 } ;
40
-
41
46
const headerLayout = [
42
47
{ ...nameSpan , header : 'Name' } ,
43
48
{ ...descriptionSpan , header : 'Description' } ,
44
49
] ;
45
50
46
- const { confirm } = Modal ;
47
-
48
51
/**
49
52
* @class
50
53
* @name EventUrgency
@@ -202,6 +205,7 @@ class EventUrgency extends Component {
202
205
* @since 0.1.0
203
206
*/
204
207
handleAfterCloseForm = ( ) => {
208
+ selectEventUrgency ( null ) ;
205
209
this . setState ( { isEditForm : false } ) ;
206
210
} ;
207
211
@@ -383,10 +387,11 @@ class EventUrgency extends Component {
383
387
maskClosable = { false }
384
388
afterClose = { this . handleAfterCloseForm }
385
389
>
386
- < EventUrgencyForm
390
+ < SettingForm
391
+ setting = { eventUrgency }
387
392
posting = { posting }
388
- isEditForm = { isEditForm }
389
- eventUrgency = { eventUrgency }
393
+ onCreate = { postEventUrgency }
394
+ onUpdate = { putEventUrgency }
390
395
onCancel = { this . closeEventUrgencyForm }
391
396
/>
392
397
</ Modal >
0 commit comments