From 5cbf163e26b17b129ce48e72a0faffe81ad04890 Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Sat, 19 Mar 2022 17:35:51 +0530 Subject: [PATCH] refactor: regroup request related components under request pane --- .../GraphQLRequestPane/StyledWrapper.js | 0 .../{ => RequestPane}/GraphQLRequestPane/index.js | 4 ++-- .../HttpRequestPane/StyledWrapper.js | 0 .../{ => RequestPane}/HttpRequestPane/index.js | 12 +++++++++--- .../{ => RequestPane}/QueryEditor/StyledWrapper.js | 0 .../{ => RequestPane}/QueryEditor/index.js | 0 .../{ => RequestPane}/QueryEditor/onHasCompletion.js | 0 .../{ => RequestPane}/QueryParams/StyledWrapper.js | 2 ++ .../{ => RequestPane}/QueryParams/index.js | 0 .../{ => RequestPane}/QueryUrl/StyledWrapper.js | 0 .../components/{ => RequestPane}/QueryUrl/index.js | 4 ++-- .../RequestHeaders/StyledWrapper.js | 2 ++ .../{ => RequestPane}/RequestHeaders/index.js | 0 .../{ => RequestPane}/SaveRequest/StyledWrapper.js | 0 .../{ => RequestPane}/SaveRequest/index.js | 2 +- renderer/components/RequestTabPanel/index.js | 6 +++--- 16 files changed, 21 insertions(+), 11 deletions(-) rename renderer/components/{ => RequestPane}/GraphQLRequestPane/StyledWrapper.js (100%) rename renderer/components/{ => RequestPane}/GraphQLRequestPane/index.js (87%) rename renderer/components/{ => RequestPane}/HttpRequestPane/StyledWrapper.js (100%) rename renderer/components/{ => RequestPane}/HttpRequestPane/index.js (69%) rename renderer/components/{ => RequestPane}/QueryEditor/StyledWrapper.js (100%) rename renderer/components/{ => RequestPane}/QueryEditor/index.js (100%) rename renderer/components/{ => RequestPane}/QueryEditor/onHasCompletion.js (100%) rename renderer/components/{ => RequestPane}/QueryParams/StyledWrapper.js (94%) rename renderer/components/{ => RequestPane}/QueryParams/index.js (100%) rename renderer/components/{ => RequestPane}/QueryUrl/StyledWrapper.js (100%) rename renderer/components/{ => RequestPane}/QueryUrl/index.js (96%) rename renderer/components/{ => RequestPane}/RequestHeaders/StyledWrapper.js (94%) rename renderer/components/{ => RequestPane}/RequestHeaders/index.js (100%) rename renderer/components/{ => RequestPane}/SaveRequest/StyledWrapper.js (100%) rename renderer/components/{ => RequestPane}/SaveRequest/index.js (98%) diff --git a/renderer/components/GraphQLRequestPane/StyledWrapper.js b/renderer/components/RequestPane/GraphQLRequestPane/StyledWrapper.js similarity index 100% rename from renderer/components/GraphQLRequestPane/StyledWrapper.js rename to renderer/components/RequestPane/GraphQLRequestPane/StyledWrapper.js diff --git a/renderer/components/GraphQLRequestPane/index.js b/renderer/components/RequestPane/GraphQLRequestPane/index.js similarity index 87% rename from renderer/components/GraphQLRequestPane/index.js rename to renderer/components/RequestPane/GraphQLRequestPane/index.js index 75543568..c4332bb7 100644 --- a/renderer/components/GraphQLRequestPane/index.js +++ b/renderer/components/RequestPane/GraphQLRequestPane/index.js @@ -1,8 +1,8 @@ import React from 'react'; import { Tab, TabList, TabPanel, Tabs } from 'react-tabs'; +import QueryEditor from 'components/RequestPane/QueryEditor'; +import RequestHeaders from 'components/RequestPane/RequestHeaders'; import StyledWrapper from './StyledWrapper'; -import QueryEditor from '../QueryEditor'; -import RequestHeaders from '../RequestHeaders'; const GraphQLRequestPane = ({onRunQuery, schema, leftPaneWidth, value, onQueryChange}) => { return ( diff --git a/renderer/components/HttpRequestPane/StyledWrapper.js b/renderer/components/RequestPane/HttpRequestPane/StyledWrapper.js similarity index 100% rename from renderer/components/HttpRequestPane/StyledWrapper.js rename to renderer/components/RequestPane/HttpRequestPane/StyledWrapper.js diff --git a/renderer/components/HttpRequestPane/index.js b/renderer/components/RequestPane/HttpRequestPane/index.js similarity index 69% rename from renderer/components/HttpRequestPane/index.js rename to renderer/components/RequestPane/HttpRequestPane/index.js index 4d2ab7ca..e955bb6e 100644 --- a/renderer/components/HttpRequestPane/index.js +++ b/renderer/components/RequestPane/HttpRequestPane/index.js @@ -1,8 +1,8 @@ import React from 'react'; import { Tab, TabList, TabPanel, Tabs } from 'react-tabs'; +import QueryParams from 'components/RequestPane/QueryParams'; +import RequestHeaders from 'components/RequestPane/RequestHeaders'; import StyledWrapper from './StyledWrapper'; -import QueryParams from '../QueryParams'; -import RequestHeaders from '../RequestHeaders'; const HttpRequestPane = ({leftPaneWidth}) => { return ( @@ -12,14 +12,20 @@ const HttpRequestPane = ({leftPaneWidth}) => { Params Body Headers - Authorization + Auth + +
Body
+
+ +
Auth
+
) diff --git a/renderer/components/QueryEditor/StyledWrapper.js b/renderer/components/RequestPane/QueryEditor/StyledWrapper.js similarity index 100% rename from renderer/components/QueryEditor/StyledWrapper.js rename to renderer/components/RequestPane/QueryEditor/StyledWrapper.js diff --git a/renderer/components/QueryEditor/index.js b/renderer/components/RequestPane/QueryEditor/index.js similarity index 100% rename from renderer/components/QueryEditor/index.js rename to renderer/components/RequestPane/QueryEditor/index.js diff --git a/renderer/components/QueryEditor/onHasCompletion.js b/renderer/components/RequestPane/QueryEditor/onHasCompletion.js similarity index 100% rename from renderer/components/QueryEditor/onHasCompletion.js rename to renderer/components/RequestPane/QueryEditor/onHasCompletion.js diff --git a/renderer/components/QueryParams/StyledWrapper.js b/renderer/components/RequestPane/QueryParams/StyledWrapper.js similarity index 94% rename from renderer/components/QueryParams/StyledWrapper.js rename to renderer/components/RequestPane/QueryParams/StyledWrapper.js index 20374c7a..f0b25869 100644 --- a/renderer/components/QueryParams/StyledWrapper.js +++ b/renderer/components/RequestPane/QueryParams/StyledWrapper.js @@ -37,6 +37,8 @@ const Wrapper = styled.div` input[type="checkbox"] { cursor: pointer; + position: relative; + top: 1px; } `; diff --git a/renderer/components/QueryParams/index.js b/renderer/components/RequestPane/QueryParams/index.js similarity index 100% rename from renderer/components/QueryParams/index.js rename to renderer/components/RequestPane/QueryParams/index.js diff --git a/renderer/components/QueryUrl/StyledWrapper.js b/renderer/components/RequestPane/QueryUrl/StyledWrapper.js similarity index 100% rename from renderer/components/QueryUrl/StyledWrapper.js rename to renderer/components/RequestPane/QueryUrl/StyledWrapper.js diff --git a/renderer/components/QueryUrl/index.js b/renderer/components/RequestPane/QueryUrl/index.js similarity index 96% rename from renderer/components/QueryUrl/index.js rename to renderer/components/RequestPane/QueryUrl/index.js index fd0d26c0..0d255995 100644 --- a/renderer/components/QueryUrl/index.js +++ b/renderer/components/RequestPane/QueryUrl/index.js @@ -1,9 +1,9 @@ import React, { useRef, forwardRef } from 'react'; import PropTypes from 'prop-types'; import { IconCaretDown } from '@tabler/icons'; -import Dropdown from '../Dropdown'; +import Dropdown from 'components/Dropdown'; +import SaveRequestButton from 'components/RequestPane/SaveRequest'; import StyledWrapper from './StyledWrapper'; -import SaveRequestButton from '../SaveRequest'; const QueryUrl = ({value, onChange, handleRun, collections}) => { const dropdownTippyRef = useRef(); diff --git a/renderer/components/RequestHeaders/StyledWrapper.js b/renderer/components/RequestPane/RequestHeaders/StyledWrapper.js similarity index 94% rename from renderer/components/RequestHeaders/StyledWrapper.js rename to renderer/components/RequestPane/RequestHeaders/StyledWrapper.js index 120ec958..92a31ee7 100644 --- a/renderer/components/RequestHeaders/StyledWrapper.js +++ b/renderer/components/RequestPane/RequestHeaders/StyledWrapper.js @@ -37,6 +37,8 @@ const Wrapper = styled.div` input[type="checkbox"] { cursor: pointer; + position: relative; + top: 1px; } `; diff --git a/renderer/components/RequestHeaders/index.js b/renderer/components/RequestPane/RequestHeaders/index.js similarity index 100% rename from renderer/components/RequestHeaders/index.js rename to renderer/components/RequestPane/RequestHeaders/index.js diff --git a/renderer/components/SaveRequest/StyledWrapper.js b/renderer/components/RequestPane/SaveRequest/StyledWrapper.js similarity index 100% rename from renderer/components/SaveRequest/StyledWrapper.js rename to renderer/components/RequestPane/SaveRequest/StyledWrapper.js diff --git a/renderer/components/SaveRequest/index.js b/renderer/components/RequestPane/SaveRequest/index.js similarity index 98% rename from renderer/components/SaveRequest/index.js rename to renderer/components/RequestPane/SaveRequest/index.js index 4d34cc04..1ce7a2f2 100644 --- a/renderer/components/SaveRequest/index.js +++ b/renderer/components/RequestPane/SaveRequest/index.js @@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'; import { faFolder } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import StyledWrapper from './StyledWrapper'; -import Modal from '../Modal'; +import Modal from 'components//Modal'; const SaveRequestButton = ({folders}) => { const [openSaveRequestModal, setOpenSaveRequestModal] = useState(false); diff --git a/renderer/components/RequestTabPanel/index.js b/renderer/components/RequestTabPanel/index.js index 0e8c1b1c..b9291109 100644 --- a/renderer/components/RequestTabPanel/index.js +++ b/renderer/components/RequestTabPanel/index.js @@ -1,9 +1,9 @@ import React, { useState, useEffect } from 'react'; import find from 'lodash/find'; import { useSelector, useDispatch } from 'react-redux'; -import QueryUrl from 'components/QueryUrl'; -import GraphQLRequestPane from 'components/GraphQLRequestPane'; -import HttpRequestPane from 'components/HttpRequestPane'; +import QueryUrl from 'components/RequestPane/QueryUrl'; +import GraphQLRequestPane from 'components/RequestPane/GraphQLRequestPane'; +import HttpRequestPane from 'components/RequestPane/HttpRequestPane'; import ResponsePane from 'components/ResponsePane'; import Welcome from 'components/Welcome'; import { findItemInCollection } from 'utils/collections';