Skip to content

Commit 89850d8

Browse files
committed
refactor(features): improve form & migrate to antd v4
see #250
1 parent 7eb8699 commit 89850d8

File tree

5 files changed

+288
-199
lines changed

5 files changed

+288
-199
lines changed

src/Events/EventFunctions/Form/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const MESSAGE_PUT_ERROR =
4747
* @description Form for create and edit event function
4848
* @param {object} props Valid form properties
4949
* @param {object} props.eventFunction Valid event function object
50-
* @param {boolean} props.isEditForm Flag wether form is on edit mode
50+
* @param {boolean} props.isEditForm Flag whether form is on edit mode
5151
* @param {boolean} props.posting Flag whether form is posting data
5252
* @param {Function} props.onCancel Form cancel callback
5353
* @returns {object} EventFunctionForm component

src/GeographicalFeatures/AdministrativeAreas/Form/index.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3-
// import isEmpty from 'lodash/isEmpty';
43
import get from 'lodash/get';
54
import { Button, Input, Form, Row, Col } from 'antd';
65
import { httpActions } from '@codetanzania/ewea-api-client';
@@ -47,7 +46,7 @@ const MESSAGE_PUT_ERROR =
4746
* @description Form for create and edit administrative area
4847
* @param {object} props Valid form properties
4948
* @param {object} props.administrativeArea Valid administrative area object
50-
* @param {boolean} props.isEditForm Flag wether form is on edit mode
49+
* @param {boolean} props.isEditForm Flag whether form is on edit mode
5150
* @param {boolean} props.posting Flag whether form is posting data
5251
* @param {Function} props.onCancel Form cancel callback
5352
* @returns {object} AdministrativeAreaForm component
@@ -130,7 +129,7 @@ const AdministrativeAreaForm = ({
130129
>
131130
{/* start: name & code */}
132131
<Row justify="space-between">
133-
{/* start:code */}
132+
{/* start:name */}
134133
<Col span={11}>
135134
<Form.Item
136135
label="Name"
@@ -258,6 +257,7 @@ AdministrativeAreaForm.propTypes = {
258257
administrativeArea: PropTypes.shape({
259258
_id: PropTypes.string,
260259
strings: PropTypes.shape({
260+
code: PropTypes.string,
261261
name: PropTypes.shape({
262262
en: PropTypes.string.isRequired,
263263
}),
@@ -269,6 +269,9 @@ AdministrativeAreaForm.propTypes = {
269269
weight: PropTypes.number.isRequired,
270270
}),
271271
relations: PropTypes.shape({
272+
level: PropTypes.shape({
273+
_id: PropTypes.string,
274+
}),
272275
parent: PropTypes.shape({
273276
_id: PropTypes.string,
274277
}),

src/GeographicalFeatures/AdministrativeLevels/Form/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const MESSAGE_PUT_ERROR =
4646
* @description Form for create and edit administrative level
4747
* @param {object} props Valid form properties
4848
* @param {object} props.administrativeLevel Valid administrative level object
49-
* @param {boolean} props.isEditForm Flag wether form is on edit mode
49+
* @param {boolean} props.isEditForm Flag whether form is on edit mode
5050
* @param {boolean} props.posting Flag whether form is posting data
5151
* @param {Function} props.onCancel Form cancel callback
5252
* @returns {object} AdministrativeLevelForm component

0 commit comments

Comments
 (0)