From 9c14941c153f3aa746625cab3fcc7839b85fa8f0 Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Sat, 21 Jan 2023 01:42:20 +0530 Subject: [PATCH] feat: using single line editors instead of input boxes --- .../RequestPane/MultipartFormParams/index.js | 21 +++++++++++-------- .../RequestPane/QueryParams/index.js | 21 +++++++++++-------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js b/packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js index d4bb1d4f..f5445916 100644 --- a/packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js +++ b/packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js @@ -4,6 +4,8 @@ import cloneDeep from 'lodash/cloneDeep'; import { IconTrash } from '@tabler/icons'; import { useDispatch } from 'react-redux'; import { addMultipartFormParam, updateMultipartFormParam, deleteMultipartFormParam } from 'providers/ReduxStore/slices/collections'; +import SingleLineEditor from 'components/SingleLineEditor'; +import { sendRequest } from 'providers/ReduxStore/slices/collections/actions'; import StyledWrapper from './StyledWrapper'; const MultipartFormParams = ({ item, collection }) => { @@ -19,6 +21,7 @@ const MultipartFormParams = ({ item, collection }) => { ); }; + const handleRun = () => dispatch(sendRequest(item, collection.uid)); const handleParamChange = (e, _param, type) => { const param = cloneDeep(_param); switch (type) { @@ -82,15 +85,15 @@ const MultipartFormParams = ({ item, collection }) => { /> - handleParamChange(e, param, 'value')} + handleParamChange({ + target: { + value: newValue + } + }, param, 'value')} + onRun={handleRun} + collection={collection} /> diff --git a/packages/bruno-app/src/components/RequestPane/QueryParams/index.js b/packages/bruno-app/src/components/RequestPane/QueryParams/index.js index 84d3bc28..7fd36397 100644 --- a/packages/bruno-app/src/components/RequestPane/QueryParams/index.js +++ b/packages/bruno-app/src/components/RequestPane/QueryParams/index.js @@ -4,6 +4,8 @@ import cloneDeep from 'lodash/cloneDeep'; import { IconTrash } from '@tabler/icons'; import { useDispatch } from 'react-redux'; import { addQueryParam, updateQueryParam, deleteQueryParam } from 'providers/ReduxStore/slices/collections'; +import SingleLineEditor from 'components/SingleLineEditor'; +import { sendRequest } from 'providers/ReduxStore/slices/collections/actions'; import StyledWrapper from './StyledWrapper'; @@ -20,6 +22,7 @@ const QueryParams = ({ item, collection }) => { ); }; + const handleRun = () => dispatch(sendRequest(item, collection.uid)); const handleParamChange = (e, _param, type) => { const param = cloneDeep(_param); @@ -85,15 +88,15 @@ const QueryParams = ({ item, collection }) => { /> - handleParamChange(e, param, 'value')} + handleParamChange({ + target: { + value: newValue + } + }, param, 'value')} + onRun={handleRun} + collection={collection} />