Skip to content

Commit

Permalink
refactor(features): improve form & migrate to antd v4
Browse files Browse the repository at this point in the history
see #250
  • Loading branch information
lykmapipo committed May 27, 2020
1 parent 7eb8699 commit 89850d8
Show file tree
Hide file tree
Showing 5 changed files with 288 additions and 199 deletions.
2 changes: 1 addition & 1 deletion src/Events/EventFunctions/Form/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const MESSAGE_PUT_ERROR =
* @description Form for create and edit event function
* @param {object} props Valid form properties
* @param {object} props.eventFunction Valid event function object
* @param {boolean} props.isEditForm Flag wether form is on edit mode
* @param {boolean} props.isEditForm Flag whether form is on edit mode
* @param {boolean} props.posting Flag whether form is posting data
* @param {Function} props.onCancel Form cancel callback
* @returns {object} EventFunctionForm component
Expand Down
9 changes: 6 additions & 3 deletions src/GeographicalFeatures/AdministrativeAreas/Form/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
// import isEmpty from 'lodash/isEmpty';
import get from 'lodash/get';
import { Button, Input, Form, Row, Col } from 'antd';
import { httpActions } from '@codetanzania/ewea-api-client';
Expand Down Expand Up @@ -47,7 +46,7 @@ const MESSAGE_PUT_ERROR =
* @description Form for create and edit administrative area
* @param {object} props Valid form properties
* @param {object} props.administrativeArea Valid administrative area object
* @param {boolean} props.isEditForm Flag wether form is on edit mode
* @param {boolean} props.isEditForm Flag whether form is on edit mode
* @param {boolean} props.posting Flag whether form is posting data
* @param {Function} props.onCancel Form cancel callback
* @returns {object} AdministrativeAreaForm component
Expand Down Expand Up @@ -130,7 +129,7 @@ const AdministrativeAreaForm = ({
>
{/* start: name & code */}
<Row justify="space-between">
{/* start:code */}
{/* start:name */}
<Col span={11}>
<Form.Item
label="Name"
Expand Down Expand Up @@ -258,6 +257,7 @@ AdministrativeAreaForm.propTypes = {
administrativeArea: PropTypes.shape({
_id: PropTypes.string,
strings: PropTypes.shape({
code: PropTypes.string,
name: PropTypes.shape({
en: PropTypes.string.isRequired,
}),
Expand All @@ -269,6 +269,9 @@ AdministrativeAreaForm.propTypes = {
weight: PropTypes.number.isRequired,
}),
relations: PropTypes.shape({
level: PropTypes.shape({
_id: PropTypes.string,
}),
parent: PropTypes.shape({
_id: PropTypes.string,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const MESSAGE_PUT_ERROR =
* @description Form for create and edit administrative level
* @param {object} props Valid form properties
* @param {object} props.administrativeLevel Valid administrative level object
* @param {boolean} props.isEditForm Flag wether form is on edit mode
* @param {boolean} props.isEditForm Flag whether form is on edit mode
* @param {boolean} props.posting Flag whether form is posting data
* @param {Function} props.onCancel Form cancel callback
* @returns {object} AdministrativeLevelForm component
Expand Down
Loading

0 comments on commit 89850d8

Please sign in to comment.