From 5b4fefa97e09b3ffe621d313257b0ee1dc34ec0a Mon Sep 17 00:00:00 2001 From: vijayg10 <33152110+vijayg10@users.noreply.github.com> Date: Wed, 21 Jul 2021 22:17:33 +0530 Subject: [PATCH] Added download testcase definition button (#108) * Added download testcase definition button * Added metadata editor * Added editable metadata for all test cases and requests in test runner * Bumped up the version and postponed audits --- audit-resolve.json | 2 +- package-lock.json | 2 +- package.json | 2 +- src/views/outbound/MetadataEditor.jsx | 156 ++++++++++++++++++ src/views/outbound/OutboundRequest.jsx | 211 ++++++++++++++++--------- src/views/outbound/TestCaseEditor.jsx | 85 ++++++---- src/views/outbound/TestCaseViewer.jsx | 9 ++ 7 files changed, 353 insertions(+), 114 deletions(-) create mode 100644 src/views/outbound/MetadataEditor.jsx diff --git a/audit-resolve.json b/audit-resolve.json index d8ad8419..527fb552 100644 --- a/audit-resolve.json +++ b/audit-resolve.json @@ -30114,7 +30114,7 @@ }, "1763|socket.io-client>socket.io-parser": { "decision": "postpone", - "madeAt": 1626796239617 + "madeAt": 1626884473999 } }, "rules": {}, diff --git a/package-lock.json b/package-lock.json index 903935d6..7db280d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "ml-testing-toolkit-ui", - "version": "13.1.1", + "version": "13.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 848ef4d0..ad0a6ce1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ml-testing-toolkit-ui", - "version": "13.1.1", + "version": "13.2.0", "description": "Mojaloop Testing Toolkit Web User Interface", "main": "index.js", "repository": { diff --git a/src/views/outbound/MetadataEditor.jsx b/src/views/outbound/MetadataEditor.jsx new file mode 100644 index 00000000..53e7d85d --- /dev/null +++ b/src/views/outbound/MetadataEditor.jsx @@ -0,0 +1,156 @@ +/***** + License + -------------- + Copyright © 2017 Bill & Melinda Gates Foundation + The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + Contributors + -------------- + This is the official list of the Mojaloop project contributors for this file. + Names of the original copyright holders (individuals or organizations) + should be listed with a '*' in the first column. People who have + contributed from an organization can be listed under the organization + that actually holds the copyright for their contributions (see the + Gates Foundation organization for an example). Those individuals should have + their names indented and be marked with a '-'. Email address can be added + optionally within square brackets . + * Gates Foundation + + * ModusBox + * Vijaya Kumar Guthi (Original Author) + -------------- + ******/ + +import React from "react"; +import { Input, Row, Col, Descriptions, message, Popover, Button, Card, Checkbox, Radio, Typography } from 'antd'; +import { EditTwoTone, SaveTwoTone, CloseSquareTwoTone } from '@ant-design/icons'; +import 'antd/dist/antd.css'; + +const {Text, Title} = Typography + +const { TextArea } = Input; + +class MetadataItem extends React.Component { + state = { + editMode: false, + itemValue: null + }; + + componentDidMount = () => { + this.setState({itemValue: this.props.value}) + } + + handleValueChange = () => { + this.props.onChange(this.props.name, this.state.itemValue) + } + + getMetadataItemType = () => { + if(this.state.editMode) { + if (typeof this.props.value === 'boolean') { + return ( + this.setState({itemValue: e.target.check})} + /> + ) + } else if (typeof this.props.value === 'number') { + return ( + this.setState({itemValue: +e.target.value})} + /> + ) + } else { + return ( +