From 19a7f397bb286fd33507faabf5e3dce3a90fd3d4 Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Mon, 18 Sep 2023 13:37:00 +0530 Subject: [PATCH] feat(#197): prettier formatting on all files in packages/bruno-app --- .prettierrc.json | 2 +- packages/bruno-app/.prettierrc.json | 2 +- .../bruno-app/src/components/Bruno/index.js | 29 ++- .../components/CodeEditor/StyledWrapper.js | 21 ++- .../src/components/CodeEditor/index.js | 6 +- .../src/components/Dropdown/index.js | 11 +- .../EnvironmentSelector/StyledWrapper.js | 2 +- .../CreateEnvironment/index.js | 17 +- .../DeleteEnvironment/index.js | 8 +- .../EnvironmentVariables/StyledWrapper.js | 2 +- .../EnvironmentVariables/index.js | 14 +- .../EnvironmentDetails/index.js | 12 +- .../EnvironmentList/index.js | 12 +- .../RenameEnvironment/index.js | 17 +- .../Environments/EnvironmentSettings/index.js | 14 +- .../src/components/Icons/Send/index.js | 15 +- .../src/components/Modal/StyledWrapper.js | 2 +- .../bruno-app/src/components/Modal/index.js | 32 +++- .../components/Preferences/General/index.js | 20 +- .../src/components/Preferences/Theme/index.js | 6 +- .../Assertions/AssertionOperator/index.js | 34 +++- .../Assertions/AssertionRow/index.js | 112 ++++++++--- .../RequestPane/FormUrlEncodedParams/index.js | 31 ++- .../RequestPane/GraphQLRequestPane/index.js | 67 +++---- .../GraphQLRequestPane/useGraphqlSchema.js | 2 +- .../RequestPane/GraphQLVariables/index.js | 9 +- .../RequestPane/HttpRequestPane/index.js | 4 +- .../MultipartFormParams/StyledWrapper.js | 1 - .../RequestPane/MultipartFormParams/index.js | 33 +++- .../RequestPane/QueryEditor/StyledWrapper.js | 21 ++- .../RequestPane/QueryEditor/index.js | 9 +- .../QueryEditor/onHasCompletion.js | 5 +- .../RequestPane/QueryParams/StyledWrapper.js | 2 +- .../RequestPane/QueryParams/index.js | 25 ++- .../QueryUrl/HttpMethodSelector/index.js | 4 +- .../components/RequestPane/QueryUrl/index.js | 10 +- .../RequestPane/RequestBody/index.js | 14 +- .../RequestPane/RequestHeaders/index.js | 23 ++- .../RequestPane/SaveRequest/index.js | 9 +- .../components/RequestPane/Script/index.js | 34 ++-- .../src/components/RequestPane/Tests/index.js | 9 +- .../RequestPane/Vars/VarsTable/index.js | 28 +-- .../src/components/RequestPane/Vars/index.js | 28 ++- .../RequestTabPanel/RequestNotFound/index.js | 6 +- .../src/components/RequestTabPanel/index.js | 43 +++-- .../RequestTabs/CollectionToolBar/index.js | 10 +- .../RequestTab/RequestTabNotFound.js | 4 +- .../RequestTabs/RequestTab/index.js | 10 +- .../src/components/RequestTabs/index.js | 19 +- .../ResponsePane/QueryResult/index.js | 9 +- .../ResponsePane/StatusCode/StyledWrapper.js | 4 +- .../ResponsePane/TestResults/index.js | 27 +-- .../ResponsePane/TestResultsLabel/index.js | 18 +- .../components/ResponsePane/Timeline/index.js | 14 +- .../src/components/ResponsePane/index.js | 4 +- .../RunnerResults/ResponsePane/index.js | 22 +-- .../src/components/RunnerResults/index.js | 176 +++++++++--------- .../CloneCollectionItem/index.js | 15 +- .../DeleteCollectionItem/index.js | 8 +- .../RenameCollectionItem/index.js | 13 +- .../RunCollectionItem/StyledWrapper.js | 2 +- .../CollectionItem/RunCollectionItem/index.js | 32 ++-- .../Collection/CollectionItem/index.js | 41 +++- .../Collection/RenameCollection/index.js | 5 +- .../Sidebar/Collections/Collection/index.js | 23 ++- .../CreateOrOpenCollection/index.js | 10 +- .../SelectCollection/StyledWrapper.js | 2 +- .../Sidebar/CreateCollection/index.js | 26 ++- .../Sidebar/ImportCollection/index.js | 15 +- .../Sidebar/ImportCollectionLocation/index.js | 7 +- .../src/components/Sidebar/NewFolder/index.js | 10 +- .../components/Sidebar/NewRequest/index.js | 17 +- .../src/components/Sidebar/StyledWrapper.js | 2 +- .../src/components/Sidebar/TitleBar/index.js | 10 +- .../bruno-app/src/components/Sidebar/index.js | 7 +- .../SingleLineEditor/StyledWrapper.js | 1 - .../src/components/SingleLineEditor/index.js | 26 ++- .../bruno-app/src/components/Tooltip/index.js | 16 +- .../VariablesView/Popover/StyledWrapper.js | 2 +- .../components/VariablesView/Popover/index.js | 14 +- .../components/VariablesView/StyledWrapper.js | 4 +- .../VariablesTable/StyledWrapper.js | 8 +- .../VariablesView/VariablesTable/index.js | 44 +++-- .../src/components/VariablesView/index.js | 34 ++-- .../bruno-app/src/components/Welcome/index.js | 22 ++- .../src/hooks/useOnClickOutside/index.js | 4 +- .../bruno-app/src/hooks/usePrevious/index.js | 4 +- packages/bruno-app/src/pages/_app.js | 2 +- packages/bruno-app/src/pages/_document.js | 5 +- .../src/providers/App/StyledWrapper.js | 2 +- packages/bruno-app/src/providers/App/index.js | 4 +- .../providers/App/useCollectionTreeSync.js | 6 +- .../src/providers/App/useTelemetry.js | 10 +- .../bruno-app/src/providers/Hotkeys/index.js | 12 +- .../src/providers/Preferences/index.js | 23 +-- .../src/providers/ReduxStore/slices/app.js | 9 +- .../ReduxStore/slices/collections/actions.js | 88 +++++---- .../ReduxStore/slices/collections/index.js | 65 ++++--- .../src/providers/ReduxStore/slices/tabs.js | 3 +- .../bruno-app/src/providers/Theme/index.js | 2 +- .../bruno-app/src/providers/Toaster/index.js | 10 +- packages/bruno-app/src/themes/dark.js | 2 +- packages/bruno-app/src/themes/light.js | 4 +- .../src/utils/codemirror/brunoVarInfo.js | 43 ++--- .../bruno-app/src/utils/collections/export.js | 5 +- .../bruno-app/src/utils/collections/index.js | 20 +- .../bruno-app/src/utils/common/codemirror.js | 21 +-- packages/bruno-app/src/utils/common/index.js | 12 +- .../bruno-app/src/utils/common/index.spec.js | 28 +-- .../bruno-app/src/utils/common/platform.js | 4 +- packages/bruno-app/src/utils/common/slash.js | 14 +- .../bruno-app/src/utils/importers/common.js | 7 +- .../utils/importers/insomnia-collection.js | 38 ++-- .../src/utils/importers/postman-collection.js | 25 ++- packages/bruno-app/src/utils/network/index.js | 10 +- packages/bruno-app/src/utils/url/index.js | 6 +- .../bruno-app/src/utils/url/index.spec.js | 75 ++++---- 117 files changed, 1249 insertions(+), 854 deletions(-) diff --git a/.prettierrc.json b/.prettierrc.json index c91533e88..b42ad7170 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -3,5 +3,5 @@ "tabWidth": 2, "semi": true, "singleQuote": true, - "printWidth": 180 + "printWidth": 120 } diff --git a/packages/bruno-app/.prettierrc.json b/packages/bruno-app/.prettierrc.json index c91533e88..b42ad7170 100644 --- a/packages/bruno-app/.prettierrc.json +++ b/packages/bruno-app/.prettierrc.json @@ -3,5 +3,5 @@ "tabWidth": 2, "semi": true, "singleQuote": true, - "printWidth": 180 + "printWidth": 120 } diff --git a/packages/bruno-app/src/components/Bruno/index.js b/packages/bruno-app/src/components/Bruno/index.js index 4eccc7026..58279cc33 100644 --- a/packages/bruno-app/src/components/Bruno/index.js +++ b/packages/bruno-app/src/components/Bruno/index.js @@ -14,7 +14,11 @@ const Bruno = ({ width }) => { stroke="none" points="36,47.2521 32.9167,49.6688 30.4167,49.6688 30.3333,53.5021 31.0833,57.0021 32.1667,58.9188 35,60.4188 39.5833,59.8355 41.1667,58.0855 42.1667,53.8355 41.9167,49.8355 39.9167,50.0855" /> - + @@ -84,8 +88,27 @@ const Bruno = ({ width }) => { strokeWidth="2" d="M52.6309,46.4628c0,0-3.0781,6.7216-7.8049,8.2712" /> - - + + ); diff --git a/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js b/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js index 26f7a3ddb..09de00ddc 100644 --- a/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js +++ b/packages/bruno-app/src/components/CodeEditor/StyledWrapper.js @@ -6,7 +6,8 @@ const StyledWrapper = styled.div` border: solid 1px ${(props) => props.theme.codemirror.border}; } - .CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div { + .CodeMirror-overlayscroll-horizontal div, + .CodeMirror-overlayscroll-vertical div { background: #d2d7db; } @@ -17,12 +18,14 @@ const StyledWrapper = styled.div` // Todo: dark mode temporary fix // Clean this .CodeMirror.cm-s-monokai { - .CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div { + .CodeMirror-overlayscroll-horizontal div, + .CodeMirror-overlayscroll-vertical div { background: #444444; } } - .cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute { + .cm-s-monokai span.cm-property, + .cm-s-monokai span.cm-attribute { color: #9cdcfe !important; } @@ -30,16 +33,20 @@ const StyledWrapper = styled.div` color: #ce9178 !important; } - .cm-s-monokai span.cm-number{ + .cm-s-monokai span.cm-number { color: #b5cea8 !important; } - .cm-s-monokai span.cm-atom{ + .cm-s-monokai span.cm-atom { color: #569cd6 !important; } - .cm-variable-valid{color: green} - .cm-variable-invalid{color: red} + .cm-variable-valid { + color: green; + } + .cm-variable-invalid { + color: red; + } `; export default StyledWrapper; diff --git a/packages/bruno-app/src/components/CodeEditor/index.js b/packages/bruno-app/src/components/CodeEditor/index.js index fe9ad2cb0..4ff9b46bc 100644 --- a/packages/bruno-app/src/components/CodeEditor/index.js +++ b/packages/bruno-app/src/components/CodeEditor/index.js @@ -43,7 +43,7 @@ export default class CodeEditor extends React.Component { foldGutter: true, gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'], readOnly: this.props.readOnly, - scrollbarStyle: "overlay", + scrollbarStyle: 'overlay', theme: this.props.theme === 'dark' ? 'monokai' : 'default', extraKeys: { 'Cmd-Enter': () => { @@ -96,7 +96,7 @@ export default class CodeEditor extends React.Component { this.editor.setValue(this.props.value); } - if(this.editor) { + if (this.editor) { let variables = getEnvironmentVariables(this.props.collection); if (!isEqual(variables, this.variables)) { this.addOverlay(); @@ -135,7 +135,7 @@ export default class CodeEditor extends React.Component { defineCodeMirrorBrunoVariablesMode(variables, mode); this.editor.setOption('mode', 'brunovariables'); - } + }; _onEdit = () => { if (!this.ignoreChangeEvent && this.editor) { diff --git a/packages/bruno-app/src/components/Dropdown/index.js b/packages/bruno-app/src/components/Dropdown/index.js index 0de0d26b5..e4f48724c 100644 --- a/packages/bruno-app/src/components/Dropdown/index.js +++ b/packages/bruno-app/src/components/Dropdown/index.js @@ -5,7 +5,16 @@ import StyledWrapper from './StyledWrapper'; const Dropdown = ({ icon, children, onCreate, placement }) => { return ( - + {icon} diff --git a/packages/bruno-app/src/components/Environments/EnvironmentSelector/StyledWrapper.js b/packages/bruno-app/src/components/Environments/EnvironmentSelector/StyledWrapper.js index a4dc148c0..a7c57209b 100644 --- a/packages/bruno-app/src/components/Environments/EnvironmentSelector/StyledWrapper.js +++ b/packages/bruno-app/src/components/Environments/EnvironmentSelector/StyledWrapper.js @@ -2,7 +2,7 @@ import styled from 'styled-components'; const Wrapper = styled.div` .current-enviroment { - background-color: ${(props) => props.theme.sidebar.badge.bg}; + background-color: ${(props) => props.theme.sidebar.badge.bg}; border-radius: 15px; .caret { diff --git a/packages/bruno-app/src/components/Environments/EnvironmentSettings/CreateEnvironment/index.js b/packages/bruno-app/src/components/Environments/EnvironmentSettings/CreateEnvironment/index.js index 6c22da0c5..753d0fb24 100644 --- a/packages/bruno-app/src/components/Environments/EnvironmentSettings/CreateEnvironment/index.js +++ b/packages/bruno-app/src/components/Environments/EnvironmentSettings/CreateEnvironment/index.js @@ -16,7 +16,10 @@ const CreateEnvironment = ({ collection, onClose }) => { name: '' }, validationSchema: Yup.object({ - name: Yup.string().min(1, 'must be atleast 1 characters').max(50, 'must be 50 characters or less').required('name is required') + name: Yup.string() + .min(1, 'must be atleast 1 characters') + .max(50, 'must be 50 characters or less') + .required('name is required') }), onSubmit: (values) => { dispatch(addEnvironment(values.name, collection.uid)) @@ -40,7 +43,13 @@ const CreateEnvironment = ({ collection, onClose }) => { return ( - +
diff --git a/packages/bruno-app/src/components/Environments/EnvironmentSettings/DeleteEnvironment/index.js b/packages/bruno-app/src/components/Environments/EnvironmentSettings/DeleteEnvironment/index.js index 9a18d2388..c9a63c574 100644 --- a/packages/bruno-app/src/components/Environments/EnvironmentSettings/DeleteEnvironment/index.js +++ b/packages/bruno-app/src/components/Environments/EnvironmentSettings/DeleteEnvironment/index.js @@ -20,7 +20,13 @@ const DeleteEnvironment = ({ onClose, environment, collection }) => { return ( - + Are you sure you want to delete {environment.name} ? diff --git a/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/EnvironmentDetails/EnvironmentVariables/StyledWrapper.js b/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/EnvironmentDetails/EnvironmentVariables/StyledWrapper.js index f1b99ec66..22872cd46 100644 --- a/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/EnvironmentDetails/EnvironmentVariables/StyledWrapper.js +++ b/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/EnvironmentDetails/EnvironmentVariables/StyledWrapper.js @@ -12,7 +12,7 @@ const Wrapper = styled.div` } thead { - color: ${(props) => props.theme.table.thead.color};; + color: ${(props) => props.theme.table.thead.color}; font-size: 0.8125rem; user-select: none; } diff --git a/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/EnvironmentDetails/EnvironmentVariables/index.js b/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/EnvironmentDetails/EnvironmentVariables/index.js index bda2782a6..e3ad6e080 100644 --- a/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/EnvironmentDetails/EnvironmentVariables/index.js +++ b/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/EnvironmentDetails/EnvironmentVariables/index.js @@ -99,7 +99,12 @@ const EnvironmentVariables = ({ environment, collection }) => {
- handleVarChange(e, variable, 'enabled')} /> + handleVarChange(e, variable, 'enabled')} + /> @@ -119,7 +124,12 @@ const EnvironmentVariables = ({ environment, collection }) => {
-
diff --git a/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/EnvironmentDetails/index.js b/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/EnvironmentDetails/index.js index fee5a84cc..8db0d0418 100644 --- a/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/EnvironmentDetails/index.js +++ b/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/EnvironmentDetails/index.js @@ -10,8 +10,16 @@ const EnvironmentDetails = ({ environment, collection }) => { return (
- {openEditModal && setOpenEditModal(false)} environment={environment} collection={collection} />} - {openDeleteModal && setOpenDeleteModal(false)} environment={environment} collection={collection} />} + {openEditModal && ( + setOpenEditModal(false)} environment={environment} collection={collection} /> + )} + {openDeleteModal && ( + setOpenDeleteModal(false)} + environment={environment} + collection={collection} + /> + )}
diff --git a/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/index.js b/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/index.js index 9fbb008d5..b80cd92a5 100644 --- a/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/index.js +++ b/packages/bruno-app/src/components/Environments/EnvironmentSettings/EnvironmentList/index.js @@ -14,12 +14,12 @@ const EnvironmentList = ({ collection }) => { const prevEnvUids = usePrevious(envUids); useEffect(() => { - if(selectedEnvironment) { + if (selectedEnvironment) { return; } - + const environment = findEnvironmentInCollection(collection, collection.activeEnvironmentUid); - if(environment) { + if (environment) { setSelectedEnvironment(environment); } else { setSelectedEnvironment(environments && environments.length ? environments[0] : null); @@ -28,9 +28,9 @@ const EnvironmentList = ({ collection }) => { useEffect(() => { // check env add - if (prevEnvUids && prevEnvUids.length && envUids.length > prevEnvUids.length) { + if (prevEnvUids && prevEnvUids.length && envUids.length > prevEnvUids.length) { const newEnv = environments.find((env) => !prevEnvUids.includes(env.uid)); - if(newEnv){ + if (newEnv) { setSelectedEnvironment(newEnv); } } @@ -38,7 +38,7 @@ const EnvironmentList = ({ collection }) => { // check env delete if (prevEnvUids && prevEnvUids.length && envUids.length < prevEnvUids.length) { setSelectedEnvironment(environments && environments.length ? environments[0] : null); - } + } }, [envUids, environments, prevEnvUids]); if (!selectedEnvironment) { diff --git a/packages/bruno-app/src/components/Environments/EnvironmentSettings/RenameEnvironment/index.js b/packages/bruno-app/src/components/Environments/EnvironmentSettings/RenameEnvironment/index.js index f67496680..a79bff497 100644 --- a/packages/bruno-app/src/components/Environments/EnvironmentSettings/RenameEnvironment/index.js +++ b/packages/bruno-app/src/components/Environments/EnvironmentSettings/RenameEnvironment/index.js @@ -16,7 +16,10 @@ const RenameEnvironment = ({ onClose, environment, collection }) => { name: environment.name }, validationSchema: Yup.object({ - name: Yup.string().min(1, 'must be atleast 1 characters').max(50, 'must be 50 characters or less').required('name is required') + name: Yup.string() + .min(1, 'must be atleast 1 characters') + .max(50, 'must be 50 characters or less') + .required('name is required') }), onSubmit: (values) => { dispatch(renameEnvironment(values.name, environment.uid, collection.uid)) @@ -40,7 +43,13 @@ const RenameEnvironment = ({ onClose, environment, collection }) => { return ( - +
diff --git a/packages/bruno-app/src/components/Environments/EnvironmentSettings/index.js b/packages/bruno-app/src/components/Environments/EnvironmentSettings/index.js index 11afce987..855e0fb31 100644 --- a/packages/bruno-app/src/components/Environments/EnvironmentSettings/index.js +++ b/packages/bruno-app/src/components/Environments/EnvironmentSettings/index.js @@ -11,11 +11,21 @@ const EnvironmentSettings = ({ collection, onClose }) => { if (!environments || !environments.length) { return ( - + {openCreateModal && setOpenCreateModal(false)} />}

No environments found!

-
diff --git a/packages/bruno-app/src/components/Icons/Send/index.js b/packages/bruno-app/src/components/Icons/Send/index.js index 15b4fa8c9..9b2274354 100644 --- a/packages/bruno-app/src/components/Icons/Send/index.js +++ b/packages/bruno-app/src/components/Icons/Send/index.js @@ -1,17 +1,12 @@ import React from 'react'; -const SendIcon = ({color, width}) => { +const SendIcon = ({ color, width }) => { return ( - - - + + + ); -} +}; export default SendIcon; diff --git a/packages/bruno-app/src/components/Modal/StyledWrapper.js b/packages/bruno-app/src/components/Modal/StyledWrapper.js index b8d0b5c23..583bfe2ec 100644 --- a/packages/bruno-app/src/components/Modal/StyledWrapper.js +++ b/packages/bruno-app/src/components/Modal/StyledWrapper.js @@ -100,7 +100,7 @@ const Wrapper = styled.div` border-radius: 0px; outline: none; box-shadow: none; - transition: border-color ease-in-out .1s; + transition: border-color ease-in-out 0.1s; border-radius: 3px; background-color: ${(props) => props.theme.modal.input.bg}; border: 1px solid ${(props) => props.theme.modal.input.border}; diff --git a/packages/bruno-app/src/components/Modal/index.js b/packages/bruno-app/src/components/Modal/index.js index 0e888cdad..2a6a327b4 100644 --- a/packages/bruno-app/src/components/Modal/index.js +++ b/packages/bruno-app/src/components/Modal/index.js @@ -14,7 +14,15 @@ const ModalHeader = ({ title, handleCancel }) => ( const ModalContent = ({ children }) =>
{children}
; -const ModalFooter = ({ confirmText, cancelText, handleSubmit, handleCancel, confirmDisabled, hideCancel, hideFooter }) => { +const ModalFooter = ({ + confirmText, + cancelText, + handleSubmit, + handleCancel, + confirmDisabled, + hideCancel, + hideFooter +}) => { confirmText = confirmText || 'Save'; cancelText = cancelText || 'Cancel'; @@ -30,7 +38,12 @@ const ModalFooter = ({ confirmText, cancelText, handleSubmit, handleCancel, conf - @@ -38,7 +51,18 @@ const ModalFooter = ({ confirmText, cancelText, handleSubmit, handleCancel, conf ); }; -const Modal = ({ size, title, confirmText, cancelText, handleCancel, handleConfirm, children, confirmDisabled, hideCancel, hideFooter }) => { +const Modal = ({ + size, + title, + confirmText, + cancelText, + handleCancel, + handleConfirm, + children, + confirmDisabled, + hideCancel, + hideFooter +}) => { const [isClosing, setIsClosing] = useState(false); const escFunction = (event) => { const escKeyCode = 27; @@ -64,7 +88,7 @@ const Modal = ({ size, title, confirmText, cancelText, handleCancel, handleConfi if (isClosing) { classes += ' modal--animate-out'; } - if(hideFooter) { + if (hideFooter) { classes += ' modal-footer-none'; } return ( diff --git a/packages/bruno-app/src/components/Preferences/General/index.js b/packages/bruno-app/src/components/Preferences/General/index.js index b6d068f17..637c483e5 100644 --- a/packages/bruno-app/src/components/Preferences/General/index.js +++ b/packages/bruno-app/src/components/Preferences/General/index.js @@ -3,22 +3,17 @@ import { usePreferences } from 'providers/Preferences'; import StyledWrapper from './StyledWrapper'; const General = () => { - const { - preferences, - setPreferences, - } = usePreferences(); + const { preferences, setPreferences } = usePreferences(); - const [sslVerification, setSslVerification] = useState( - preferences.request.sslVerification - ); + const [sslVerification, setSslVerification] = useState(preferences.request.sslVerification); const handleCheckboxChange = () => { const updatedPreferences = { ...preferences, request: { ...preferences.request, - sslVerification: !sslVerification, - }, + sslVerification: !sslVerification + } }; setPreferences(updatedPreferences) @@ -33,12 +28,7 @@ const General = () => { return (
- + SSL Certificate Verification
diff --git a/packages/bruno-app/src/components/Preferences/Theme/index.js b/packages/bruno-app/src/components/Preferences/Theme/index.js index e49599016..8f0719f98 100644 --- a/packages/bruno-app/src/components/Preferences/Theme/index.js +++ b/packages/bruno-app/src/components/Preferences/Theme/index.js @@ -22,7 +22,7 @@ const Theme = () => { return ( -
+
{ name="theme" onChange={(e) => { formik.handleChange(e); - formik.handleSubmit() + formik.handleSubmit(); }} value="light" checked={formik.values.theme === 'light'} @@ -47,7 +47,7 @@ const Theme = () => { name="theme" onChange={(e) => { formik.handleChange(e); - formik.handleSubmit() + formik.handleSubmit(); }} value="dark" checked={formik.values.theme === 'dark'} diff --git a/packages/bruno-app/src/components/RequestPane/Assertions/AssertionOperator/index.js b/packages/bruno-app/src/components/RequestPane/Assertions/AssertionOperator/index.js index e58959736..ae0579fc7 100644 --- a/packages/bruno-app/src/components/RequestPane/Assertions/AssertionOperator/index.js +++ b/packages/bruno-app/src/components/RequestPane/Assertions/AssertionOperator/index.js @@ -2,7 +2,7 @@ import React from 'react'; /** * Assertion operators - * + * * eq : equal to * neq : not equal to * gt : greater than @@ -33,10 +33,32 @@ import React from 'react'; const AssertionOperator = ({ operator, onChange }) => { const operators = [ - 'eq', 'neq', 'gt', 'gte', 'lt', 'lte', 'in', 'notIn', - 'contains', 'notContains', 'length', 'matches', 'notMatches', - 'startsWith', 'endsWith', 'between', 'isEmpty', 'isNull', 'isUndefined', - 'isDefined', 'isTruthy', 'isFalsy', 'isJson', 'isNumber', 'isString', 'isBoolean' + 'eq', + 'neq', + 'gt', + 'gte', + 'lt', + 'lte', + 'in', + 'notIn', + 'contains', + 'notContains', + 'length', + 'matches', + 'notMatches', + 'startsWith', + 'endsWith', + 'between', + 'isEmpty', + 'isNull', + 'isUndefined', + 'isDefined', + 'isTruthy', + 'isFalsy', + 'isJson', + 'isNumber', + 'isString', + 'isBoolean' ]; const handleChange = (e) => { @@ -44,7 +66,7 @@ const AssertionOperator = ({ operator, onChange }) => { }; const getLabel = (operator) => { - switch(operator) { + switch (operator) { case 'eq': return 'equals'; case 'neq': diff --git a/packages/bruno-app/src/components/RequestPane/Assertions/AssertionRow/index.js b/packages/bruno-app/src/components/RequestPane/Assertions/AssertionRow/index.js index 201a47c9f..d4d6eeff8 100644 --- a/packages/bruno-app/src/components/RequestPane/Assertions/AssertionRow/index.js +++ b/packages/bruno-app/src/components/RequestPane/Assertions/AssertionRow/index.js @@ -6,7 +6,7 @@ import { useTheme } from 'providers/Theme'; /** * Assertion operators - * + * * eq : equal to * neq : not equal to * gt : greater than @@ -35,7 +35,7 @@ import { useTheme } from 'providers/Theme'; * isBoolean : is boolean */ const parseAssertionOperator = (str = '') => { - if(!str || typeof str !== 'string' || !str.length) { + if (!str || typeof str !== 'string' || !str.length) { return { operator: 'eq', value: str @@ -43,27 +43,58 @@ const parseAssertionOperator = (str = '') => { } const operators = [ - 'eq', 'neq', 'gt', 'gte', 'lt', 'lte', 'in', 'notIn', - 'contains', 'notContains', 'length', 'matches', 'notMatches', - 'startsWith', 'endsWith', 'between', 'isEmpty', 'isNull', 'isUndefined', - 'isDefined', 'isTruthy', 'isFalsy', 'isJson', 'isNumber', 'isString', 'isBoolean' + 'eq', + 'neq', + 'gt', + 'gte', + 'lt', + 'lte', + 'in', + 'notIn', + 'contains', + 'notContains', + 'length', + 'matches', + 'notMatches', + 'startsWith', + 'endsWith', + 'between', + 'isEmpty', + 'isNull', + 'isUndefined', + 'isDefined', + 'isTruthy', + 'isFalsy', + 'isJson', + 'isNumber', + 'isString', + 'isBoolean' ]; const unaryOperators = [ - 'isEmpty', 'isNull', 'isUndefined', 'isDefined', 'isTruthy', 'isFalsy', 'isJson', 'isNumber', 'isString', 'isBoolean' + 'isEmpty', + 'isNull', + 'isUndefined', + 'isDefined', + 'isTruthy', + 'isFalsy', + 'isJson', + 'isNumber', + 'isString', + 'isBoolean' ]; const [operator, ...rest] = str.trim().split(' '); const value = rest.join(' '); - if(unaryOperators.includes(operator)) { + if (unaryOperators.includes(operator)) { return { operator, value: '' }; } - if(operators.includes(operator)) { + if (operators.includes(operator)) { return { operator, value @@ -78,22 +109,33 @@ const parseAssertionOperator = (str = '') => { const isUnaryOperator = (operator) => { const unaryOperators = [ - 'isEmpty', 'isNull', 'isUndefined', 'isDefined', 'isTruthy', 'isFalsy', 'isJson', 'isNumber', 'isString', 'isBoolean' + 'isEmpty', + 'isNull', + 'isUndefined', + 'isDefined', + 'isTruthy', + 'isFalsy', + 'isJson', + 'isNumber', + 'isString', + 'isBoolean' ]; return unaryOperators.includes(operator); }; const AssertionRow = ({ - item, collection, assertion, handleAssertionChange, handleRemoveAssertion, - onSave, handleRun + item, + collection, + assertion, + handleAssertionChange, + handleRemoveAssertion, + onSave, + handleRun }) => { const { storedTheme } = useTheme(); - const { - operator, - value - } = parseAssertionOperator(assertion.value); + const { operator, value } = parseAssertionOperator(assertion.value); return ( @@ -112,11 +154,17 @@ const AssertionRow = ({ handleAssertionChange({ - target: { - value: `${op} ${value}` - } - }, assertion, 'value')} + onChange={(op) => + handleAssertionChange( + { + target: { + value: `${op} ${value}` + } + }, + assertion, + 'value' + ) + } /> @@ -126,20 +174,22 @@ const AssertionRow = ({ theme={storedTheme} readOnly={true} onSave={onSave} - onChange={(newValue) => handleAssertionChange({ - target: { - value: newValue - } - }, assertion, 'value')} + onChange={(newValue) => + handleAssertionChange( + { + target: { + value: newValue + } + }, + assertion, + 'value' + ) + } onRun={handleRun} collection={collection} /> ) : ( - + )} diff --git a/packages/bruno-app/src/components/RequestPane/FormUrlEncodedParams/index.js b/packages/bruno-app/src/components/RequestPane/FormUrlEncodedParams/index.js index c848c3ae8..4f28cc579 100644 --- a/packages/bruno-app/src/components/RequestPane/FormUrlEncodedParams/index.js +++ b/packages/bruno-app/src/components/RequestPane/FormUrlEncodedParams/index.js @@ -4,7 +4,11 @@ import cloneDeep from 'lodash/cloneDeep'; import { IconTrash } from '@tabler/icons'; import { useDispatch } from 'react-redux'; import { useTheme } from 'providers/Theme'; -import { addFormUrlEncodedParam, updateFormUrlEncodedParam, deleteFormUrlEncodedParam } from 'providers/ReduxStore/slices/collections'; +import { + addFormUrlEncodedParam, + updateFormUrlEncodedParam, + deleteFormUrlEncodedParam +} from 'providers/ReduxStore/slices/collections'; import SingleLineEditor from 'components/SingleLineEditor'; import { sendRequest, saveRequest } from 'providers/ReduxStore/slices/collections/actions'; import StyledWrapper from './StyledWrapper'; @@ -88,22 +92,33 @@ const FormUrlEncodedParams = ({ item, collection }) => { /> - handleParamChange({ - target: { - value: newValue - } - }, param, 'value')} + onChange={(newValue) => + handleParamChange( + { + target: { + value: newValue + } + }, + param, + 'value' + ) + } onRun={handleRun} collection={collection} />
- handleParamChange(e, param, 'enabled')} /> + handleParamChange(e, param, 'enabled')} + /> diff --git a/packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js b/packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js index bb4ae78b0..d25eaec03 100644 --- a/packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js +++ b/packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/index.js @@ -24,29 +24,24 @@ const GraphQLRequestPane = ({ item, collection, leftPaneWidth, onSchemaLoad, tog const tabs = useSelector((state) => state.tabs.tabs); const activeTabUid = useSelector((state) => state.tabs.activeTabUid); const query = item.draft ? get(item, 'draft.request.body.graphql.query') : get(item, 'request.body.graphql.query'); - const variables = item.draft ? get(item, 'draft.request.body.graphql.variables') : get(item, 'request.body.graphql.variables'); + const variables = item.draft + ? get(item, 'draft.request.body.graphql.variables') + : get(item, 'request.body.graphql.variables'); const url = item.draft ? get(item, 'draft.request.url') : get(item, 'request.url'); - const { - storedTheme - } = useTheme(); + const { storedTheme } = useTheme(); const environment = findEnvironmentInCollection(collection, collection.activeEnvironmentUid); - - let { - schema, - loadSchema, - isLoading: isSchemaLoading, - error: schemaError - } = useGraphqlSchema(url, environment); + + let { schema, loadSchema, isLoading: isSchemaLoading, error: schemaError } = useGraphqlSchema(url, environment); const loadGqlSchema = () => { - if(!isSchemaLoading) { + if (!isSchemaLoading) { loadSchema(); } }; useEffect(() => { - if(onSchemaLoad) { + if (onSchemaLoad) { onSchemaLoad(schema); } }, [schema]); @@ -75,17 +70,19 @@ const GraphQLRequestPane = ({ item, collection, leftPaneWidth, onSchemaLoad, tog const getTabPanel = (tab) => { switch (tab) { case 'query': { - return ; + return ( + + ); } case 'variables': { return ; @@ -150,20 +147,16 @@ const GraphQLRequestPane = ({ item, collection, leftPaneWidth, onSchemaLoad, tog
selectTab('tests')}> Tests
-
-
- {isSchemaLoading ? ( - - ) : null} - {!isSchemaLoading && !schema ? : null } - {!isSchemaLoading && schema ? : null } - Schema +
+
+ {isSchemaLoading ? : null} + {!isSchemaLoading && !schema ? : null} + {!isSchemaLoading && schema ? : null} + Schema
-
- Docs +
+ + Docs
diff --git a/packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/useGraphqlSchema.js b/packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/useGraphqlSchema.js index 7642f3027..308a65e61 100644 --- a/packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/useGraphqlSchema.js +++ b/packages/bruno-app/src/components/RequestPane/GraphQLRequestPane/useGraphqlSchema.js @@ -13,7 +13,7 @@ const useGraphqlSchema = (endpoint, environment) => { const [schema, setSchema] = useState(() => { try { const saved = localStorage.getItem(localStorageKey); - if(!saved) { + if (!saved) { return null; } return buildClientSchema(JSON.parse(saved)); diff --git a/packages/bruno-app/src/components/RequestPane/GraphQLVariables/index.js b/packages/bruno-app/src/components/RequestPane/GraphQLVariables/index.js index f5c51c639..59b132044 100644 --- a/packages/bruno-app/src/components/RequestPane/GraphQLVariables/index.js +++ b/packages/bruno-app/src/components/RequestPane/GraphQLVariables/index.js @@ -9,9 +9,7 @@ import StyledWrapper from './StyledWrapper'; const GraphQLVariables = ({ variables, item, collection }) => { const dispatch = useDispatch(); - const { - storedTheme - } = useTheme(); + const { storedTheme } = useTheme(); const onEdit = (value) => { dispatch( @@ -29,10 +27,11 @@ const GraphQLVariables = ({ variables, item, collection }) => { return ( diff --git a/packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js b/packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js index 55da6c9ca..cd40302e2 100644 --- a/packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js +++ b/packages/bruno-app/src/components/RequestPane/HttpRequestPane/index.js @@ -103,7 +103,9 @@ const HttpRequestPane = ({ item, collection, leftPaneWidth }) => {
) : null}
-
{getTabPanel(focusedTab.requestPaneTab)}
+
+ {getTabPanel(focusedTab.requestPaneTab)} +
); }; diff --git a/packages/bruno-app/src/components/RequestPane/MultipartFormParams/StyledWrapper.js b/packages/bruno-app/src/components/RequestPane/MultipartFormParams/StyledWrapper.js index de3218cb1..f04a30be0 100644 --- a/packages/bruno-app/src/components/RequestPane/MultipartFormParams/StyledWrapper.js +++ b/packages/bruno-app/src/components/RequestPane/MultipartFormParams/StyledWrapper.js @@ -41,7 +41,6 @@ const Wrapper = styled.div` color: ${(props) => props.theme.table.input.color}; background: transparent; - &:focus { outline: none !important; border: solid 1px transparent; diff --git a/packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js b/packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js index ae237bb17..9cbfd67fd 100644 --- a/packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js +++ b/packages/bruno-app/src/components/RequestPane/MultipartFormParams/index.js @@ -4,7 +4,11 @@ import cloneDeep from 'lodash/cloneDeep'; import { IconTrash } from '@tabler/icons'; import { useDispatch } from 'react-redux'; import { useTheme } from 'providers/Theme'; -import { addMultipartFormParam, updateMultipartFormParam, deleteMultipartFormParam } from 'providers/ReduxStore/slices/collections'; +import { + addMultipartFormParam, + updateMultipartFormParam, + deleteMultipartFormParam +} from 'providers/ReduxStore/slices/collections'; import SingleLineEditor from 'components/SingleLineEditor'; import { sendRequest, saveRequest } from 'providers/ReduxStore/slices/collections/actions'; import StyledWrapper from './StyledWrapper'; @@ -88,22 +92,33 @@ const MultipartFormParams = ({ item, collection }) => { /> - handleParamChange({ - target: { - value: newValue - } - }, param, 'value')} + value={param.value} + onChange={(newValue) => + handleParamChange( + { + target: { + value: newValue + } + }, + param, + 'value' + ) + } onRun={handleRun} collection={collection} />
- handleParamChange(e, param, 'enabled')} /> + handleParamChange(e, param, 'enabled')} + /> diff --git a/packages/bruno-app/src/components/RequestPane/QueryEditor/StyledWrapper.js b/packages/bruno-app/src/components/RequestPane/QueryEditor/StyledWrapper.js index 8768f77a6..99d5ed3b9 100644 --- a/packages/bruno-app/src/components/RequestPane/QueryEditor/StyledWrapper.js +++ b/packages/bruno-app/src/components/RequestPane/QueryEditor/StyledWrapper.js @@ -15,16 +15,19 @@ const StyledWrapper = styled.div` // Todo: dark mode temporary fix // Clean this .CodeMirror.cm-s-monokai { - .CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div { + .CodeMirror-overlayscroll-horizontal div, + .CodeMirror-overlayscroll-vertical div { background: #444444; } } - .cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute { + .cm-s-monokai span.cm-property, + .cm-s-monokai span.cm-attribute { color: #9cdcfe !important; } - .cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute { + .cm-s-monokai span.cm-property, + .cm-s-monokai span.cm-attribute { color: #9cdcfe !important; } @@ -32,16 +35,20 @@ const StyledWrapper = styled.div` color: #ce9178 !important; } - .cm-s-monokai span.cm-number{ + .cm-s-monokai span.cm-number { color: #b5cea8 !important; } - .cm-s-monokai span.cm-atom{ + .cm-s-monokai span.cm-atom { color: #569cd6 !important; } - .cm-variable-valid{color: green} - .cm-variable-invalid{color: red} + .cm-variable-valid { + color: green; + } + .cm-variable-invalid { + color: red; + } `; export default StyledWrapper; diff --git a/packages/bruno-app/src/components/RequestPane/QueryEditor/index.js b/packages/bruno-app/src/components/RequestPane/QueryEditor/index.js index 068da7716..32f2fe0e1 100644 --- a/packages/bruno-app/src/components/RequestPane/QueryEditor/index.js +++ b/packages/bruno-app/src/components/RequestPane/QueryEditor/index.js @@ -43,7 +43,7 @@ export default class QueryEditor extends React.Component { mode: 'graphql', // mode: 'brunovariables', brunoVarInfo: { - variables: getAllVariables(this.props.collection), + variables: getAllVariables(this.props.collection) }, theme: this.props.editorTheme || 'graphiql', theme: this.props.theme === 'dark' ? 'monokai' : 'default', @@ -51,7 +51,7 @@ export default class QueryEditor extends React.Component { autoCloseBrackets: true, matchBrackets: true, showCursorWhenSelecting: true, - scrollbarStyle: "overlay", + scrollbarStyle: 'overlay', readOnly: this.props.readOnly ? 'nocursor' : false, foldGutter: { minFoldSize: 4 @@ -179,14 +179,13 @@ export default class QueryEditor extends React.Component { } // Todo: Overlay is messing up with schema hint - // Fix this + // Fix this addOverlay = () => { // let variables = getAllVariables(this.props.collection); // this.variables = variables; - // defineCodeMirrorBrunoVariablesMode(variables, 'graphql'); // this.editor.setOption('mode', 'brunovariables'); - } + }; render() { return ( diff --git a/packages/bruno-app/src/components/RequestPane/QueryEditor/onHasCompletion.js b/packages/bruno-app/src/components/RequestPane/QueryEditor/onHasCompletion.js index 15bb2c867..080a4cfba 100644 --- a/packages/bruno-app/src/components/RequestPane/QueryEditor/onHasCompletion.js +++ b/packages/bruno-app/src/components/RequestPane/QueryEditor/onHasCompletion.js @@ -59,7 +59,10 @@ export default function onHasCompletion(_cm, data, onHintInformationRender) { const description = ctx.description ? md.render(ctx.description) : 'Self descriptive.'; const type = ctx.type ? '' + renderType(ctx.type) + '' : ''; - information.innerHTML = '
' + (description.slice(0, 3) === '

' ? '

' + type + description.slice(3) : type + description) + '

'; + information.innerHTML = + '
' + + (description.slice(0, 3) === '

' ? '

' + type + description.slice(3) : type + description) + + '

'; if (ctx && deprecation && ctx.deprecationReason) { const reason = ctx.deprecationReason ? md.render(ctx.deprecationReason) : ''; diff --git a/packages/bruno-app/src/components/RequestPane/QueryParams/StyledWrapper.js b/packages/bruno-app/src/components/RequestPane/QueryParams/StyledWrapper.js index a15d5a4b5..d3dc58d5c 100644 --- a/packages/bruno-app/src/components/RequestPane/QueryParams/StyledWrapper.js +++ b/packages/bruno-app/src/components/RequestPane/QueryParams/StyledWrapper.js @@ -13,7 +13,7 @@ const Wrapper = styled.div` } thead { - color: ${(props) => props.theme.table.thead.color};; + color: ${(props) => props.theme.table.thead.color}; font-size: 0.8125rem; user-select: none; } diff --git a/packages/bruno-app/src/components/RequestPane/QueryParams/index.js b/packages/bruno-app/src/components/RequestPane/QueryParams/index.js index cf76a77a1..0cb92f8e1 100644 --- a/packages/bruno-app/src/components/RequestPane/QueryParams/index.js +++ b/packages/bruno-app/src/components/RequestPane/QueryParams/index.js @@ -91,22 +91,33 @@ const QueryParams = ({ item, collection }) => { /> - handleParamChange({ - target: { - value: newValue - } - }, param, 'value')} + onChange={(newValue) => + handleParamChange( + { + target: { + value: newValue + } + }, + param, + 'value' + ) + } onRun={handleRun} collection={collection} />
- handleParamChange(e, param, 'enabled')} /> + handleParamChange(e, param, 'enabled')} + /> diff --git a/packages/bruno-app/src/components/RequestPane/QueryUrl/HttpMethodSelector/index.js b/packages/bruno-app/src/components/RequestPane/QueryUrl/HttpMethodSelector/index.js index eb72c85b7..c2bdf15f1 100644 --- a/packages/bruno-app/src/components/RequestPane/QueryUrl/HttpMethodSelector/index.js +++ b/packages/bruno-app/src/components/RequestPane/QueryUrl/HttpMethodSelector/index.js @@ -10,7 +10,9 @@ const HttpMethodSelector = ({ method, onMethodSelect }) => { const Icon = forwardRef((props, ref) => { return (
-
{method}
+
+ {method} +
diff --git a/packages/bruno-app/src/components/RequestPane/QueryUrl/index.js b/packages/bruno-app/src/components/RequestPane/QueryUrl/index.js index eda5e33e6..f783bb9d5 100644 --- a/packages/bruno-app/src/components/RequestPane/QueryUrl/index.js +++ b/packages/bruno-app/src/components/RequestPane/QueryUrl/index.js @@ -1,4 +1,4 @@ -import React, { useState, useEffect} from 'react'; +import React, { useState, useEffect } from 'react'; import get from 'lodash/get'; import { useDispatch } from 'react-redux'; import { requestUrlChanged, updateRequestMethod } from 'providers/ReduxStore/slices/collections'; @@ -18,7 +18,7 @@ const QueryUrl = ({ item, collection, handleRun }) => { const [methodSelectorWidth, setMethodSelectorWidth] = useState(90); useEffect(() => { - const el = document.querySelector(".method-selector-container"); + const el = document.querySelector('.method-selector-container'); setMethodSelectorWidth(el.offsetWidth); }, [method]); @@ -56,8 +56,8 @@ const QueryUrl = ({ item, collection, handleRun }) => { maxWidth: `calc(100% - ${methodSelectorWidth}px)` }} > - onUrlChange(newValue)} @@ -65,7 +65,7 @@ const QueryUrl = ({ item, collection, handleRun }) => { collection={collection} />
- +
diff --git a/packages/bruno-app/src/components/RequestPane/RequestBody/index.js b/packages/bruno-app/src/components/RequestPane/RequestBody/index.js index 91192f054..7ac178f79 100644 --- a/packages/bruno-app/src/components/RequestPane/RequestBody/index.js +++ b/packages/bruno-app/src/components/RequestPane/RequestBody/index.js @@ -13,9 +13,7 @@ const RequestBody = ({ item, collection }) => { const dispatch = useDispatch(); const body = item.draft ? get(item, 'draft.request.body') : get(item, 'request.body'); const bodyMode = item.draft ? get(item, 'draft.request.body.mode') : get(item, 'request.body.mode'); - const { - storedTheme - } = useTheme(); + const { storedTheme } = useTheme(); const onEdit = (value) => { dispatch( @@ -45,7 +43,15 @@ const RequestBody = ({ item, collection }) => { return ( - + ); } diff --git a/packages/bruno-app/src/components/RequestPane/RequestHeaders/index.js b/packages/bruno-app/src/components/RequestPane/RequestHeaders/index.js index 4d4afe715..04cb04d88 100644 --- a/packages/bruno-app/src/components/RequestPane/RequestHeaders/index.js +++ b/packages/bruno-app/src/components/RequestPane/RequestHeaders/index.js @@ -92,18 +92,29 @@ const RequestHeaders = ({ item, collection }) => { value={header.value} theme={storedTheme} onSave={onSave} - onChange={(newValue) => handleHeaderValueChange({ - target: { - value: newValue - } - }, header, 'value')} + onChange={(newValue) => + handleHeaderValueChange( + { + target: { + value: newValue + } + }, + header, + 'value' + ) + } onRun={handleRun} collection={collection} />
- handleHeaderValueChange(e, header, 'enabled')} /> + handleHeaderValueChange(e, header, 'enabled')} + /> diff --git a/packages/bruno-app/src/components/RequestPane/SaveRequest/index.js b/packages/bruno-app/src/components/RequestPane/SaveRequest/index.js index a0ddaca90..4b119f853 100644 --- a/packages/bruno-app/src/components/RequestPane/SaveRequest/index.js +++ b/packages/bruno-app/src/components/RequestPane/SaveRequest/index.js @@ -28,7 +28,14 @@ const SaveRequest = ({ items, onClose }) => { return ( - +

Select a folder to save request:

{showFolders && showFolders.length diff --git a/packages/bruno-app/src/components/RequestPane/Script/index.js b/packages/bruno-app/src/components/RequestPane/Script/index.js index d7fc8d54a..75ee3d360 100644 --- a/packages/bruno-app/src/components/RequestPane/Script/index.js +++ b/packages/bruno-app/src/components/RequestPane/Script/index.js @@ -12,9 +12,7 @@ const Script = ({ item, collection }) => { const requestScript = item.draft ? get(item, 'draft.request.script.req') : get(item, 'request.script.req'); const responseScript = item.draft ? get(item, 'draft.request.script.res') : get(item, 'request.script.res'); - const { - storedTheme - } = useTheme(); + const { storedTheme } = useTheme(); const onRequestScriptEdit = (value) => { dispatch( @@ -29,36 +27,38 @@ const Script = ({ item, collection }) => { const onResponseScriptEdit = (value) => { dispatch( updateResponseScript({ - script: value, - itemUid: item.uid, - collectionUid: collection.uid - }) - ); -}; + script: value, + itemUid: item.uid, + collectionUid: collection.uid + }) + ); + }; const onRun = () => dispatch(sendRequest(item, collection.uid)); const onSave = () => dispatch(saveRequest(item.uid, collection.uid)); return ( -
-
Pre Request
+
+
Pre Request
-
-
Post Response
+
+
Post Response
diff --git a/packages/bruno-app/src/components/RequestPane/Tests/index.js b/packages/bruno-app/src/components/RequestPane/Tests/index.js index ba748285c..351afd3d3 100644 --- a/packages/bruno-app/src/components/RequestPane/Tests/index.js +++ b/packages/bruno-app/src/components/RequestPane/Tests/index.js @@ -11,9 +11,7 @@ const Tests = ({ item, collection }) => { const dispatch = useDispatch(); const tests = item.draft ? get(item, 'draft.request.tests') : get(item, 'request.tests'); - const { - storedTheme - } = useTheme(); + const { storedTheme } = useTheme(); const onEdit = (value) => { dispatch( @@ -31,10 +29,11 @@ const Tests = ({ item, collection }) => { return ( diff --git a/packages/bruno-app/src/components/RequestPane/Vars/VarsTable/index.js b/packages/bruno-app/src/components/RequestPane/Vars/VarsTable/index.js index 0ea94b408..7333acc62 100644 --- a/packages/bruno-app/src/components/RequestPane/Vars/VarsTable/index.js +++ b/packages/bruno-app/src/components/RequestPane/Vars/VarsTable/index.js @@ -68,18 +68,18 @@ const VarsTable = ({ item, collection, vars, varType }) => { Name - { varType === 'request' ? ( + {varType === 'request' ? ( -
+
Value - +
- ) : ( + ) : ( -
+
Expr - +
)} @@ -108,11 +108,17 @@ const VarsTable = ({ item, collection, vars, varType }) => { value={_var.value} theme={storedTheme} onSave={onSave} - onChange={(newValue) => handleVarChange({ - target: { - value: newValue - } - }, _var, 'value')} + onChange={(newValue) => + handleVarChange( + { + target: { + value: newValue + } + }, + _var, + 'value' + ) + } onRun={handleRun} collection={collection} /> diff --git a/packages/bruno-app/src/components/RequestPane/Vars/index.js b/packages/bruno-app/src/components/RequestPane/Vars/index.js index 1da6f69ba..b63c08801 100644 --- a/packages/bruno-app/src/components/RequestPane/Vars/index.js +++ b/packages/bruno-app/src/components/RequestPane/Vars/index.js @@ -12,9 +12,7 @@ const Vars = ({ item, collection }) => { const requestVars = item.draft ? get(item, 'draft.request.vars.req') : get(item, 'request.vars.req'); const responseVars = item.draft ? get(item, 'draft.request.vars.res') : get(item, 'request.vars.res'); - const { - storedTheme - } = useTheme(); + const { storedTheme } = useTheme(); const onRequestScriptEdit = (value) => { dispatch( @@ -29,25 +27,25 @@ const Vars = ({ item, collection }) => { const onResponseScriptEdit = (value) => { dispatch( updateResponseScript({ - script: value, - itemUid: item.uid, - collectionUid: collection.uid - }) - ); -}; + script: value, + itemUid: item.uid, + collectionUid: collection.uid + }) + ); + }; const onRun = () => dispatch(sendRequest(item, collection.uid)); const onSave = () => dispatch(saveRequest(item.uid, collection.uid)); return ( -
-
Pre Request
- +
+
Pre Request
+
-
-
Post Response
- +
+
Post Response
+
); diff --git a/packages/bruno-app/src/components/RequestTabPanel/RequestNotFound/index.js b/packages/bruno-app/src/components/RequestTabPanel/RequestNotFound/index.js index e3bed1c40..db0e45e41 100644 --- a/packages/bruno-app/src/components/RequestTabPanel/RequestNotFound/index.js +++ b/packages/bruno-app/src/components/RequestTabPanel/RequestNotFound/index.js @@ -24,7 +24,7 @@ const RequestNotFound = ({ itemUid }) => { // and then shows the error message after a delay // this will prevent the error message from flashing on the screen - if(!showErrorMessage) { + if (!showErrorMessage) { return null; } @@ -32,7 +32,9 @@ const RequestNotFound = ({ itemUid }) => {
Request no longer exists.
-
This can happen when the .bru file associated with this request was deleted on your filesystem.
+
+ This can happen when the .bru file associated with this request was deleted on your filesystem. +
-
+
{item.type === 'graphql-request' ? ( { /> ) : null} - {item.type === 'http-request' ? : null} + {item.type === 'http-request' ? ( + + ) : null}
@@ -165,19 +178,15 @@ const RequestTabPanel = () => { {item.type === 'graphql-request' ? (
- docExplorerRef.current = r}> -
- ): null} + ) : null} ); }; -export default RequestTabPanel; \ No newline at end of file +export default RequestTabPanel; diff --git a/packages/bruno-app/src/components/RequestTabs/CollectionToolBar/index.js b/packages/bruno-app/src/components/RequestTabs/CollectionToolBar/index.js index d804e5da9..1d96df94b 100644 --- a/packages/bruno-app/src/components/RequestTabs/CollectionToolBar/index.js +++ b/packages/bruno-app/src/components/RequestTabs/CollectionToolBar/index.js @@ -10,9 +10,11 @@ const CollectionToolBar = ({ collection }) => { const dispatch = useDispatch(); const handleRun = () => { - dispatch(toggleRunnerView({ - collectionUid: collection.uid - })); + dispatch( + toggleRunnerView({ + collectionUid: collection.uid + }) + ); }; return ( @@ -26,7 +28,7 @@ const CollectionToolBar = ({ collection }) => { - +
diff --git a/packages/bruno-app/src/components/RequestTabs/RequestTab/RequestTabNotFound.js b/packages/bruno-app/src/components/RequestTabs/RequestTab/RequestTabNotFound.js index 180d4fa02..7bf45446e 100644 --- a/packages/bruno-app/src/components/RequestTabs/RequestTab/RequestTabNotFound.js +++ b/packages/bruno-app/src/components/RequestTabs/RequestTab/RequestTabNotFound.js @@ -1,7 +1,7 @@ import React, { useState, useEffect } from 'react'; import { IconAlertTriangle } from '@tabler/icons'; -const RequestTabNotFound = ({handleCloseClick}) => { +const RequestTabNotFound = ({ handleCloseClick }) => { const [showErrorMessage, setShowErrorMessage] = useState(false); // add a delay component in react that shows a loading spinner @@ -13,7 +13,7 @@ const RequestTabNotFound = ({handleCloseClick}) => { }, 300); }, []); - if(!showErrorMessage) { + if (!showErrorMessage) { return null; } diff --git a/packages/bruno-app/src/components/RequestTabs/RequestTab/index.js b/packages/bruno-app/src/components/RequestTabs/RequestTab/index.js index 7754b6286..a10fd8994 100644 --- a/packages/bruno-app/src/components/RequestTabs/RequestTab/index.js +++ b/packages/bruno-app/src/components/RequestTabs/RequestTab/index.js @@ -87,7 +87,15 @@ const RequestTab = ({ tab, collection }) => { > ) : ( - + )} diff --git a/packages/bruno-app/src/components/RequestTabs/index.js b/packages/bruno-app/src/components/RequestTabs/index.js index 7dbaca53e..a92c55271 100644 --- a/packages/bruno-app/src/components/RequestTabs/index.js +++ b/packages/bruno-app/src/components/RequestTabs/index.js @@ -81,7 +81,9 @@ const RequestTabs = () => { // Todo: Must support ephermal requests return ( - {newRequestModalOpen && setNewRequestModalOpen(false)} />} + {newRequestModalOpen && ( + setNewRequestModalOpen(false)} /> + )} {collectionRequestTabs && collectionRequestTabs.length ? ( <> @@ -106,7 +108,12 @@ const RequestTabs = () => { {collectionRequestTabs && collectionRequestTabs.length ? collectionRequestTabs.map((tab, index) => { return ( -
  • handleClick(tab)}> +
  • handleClick(tab)} + >
  • ); @@ -124,7 +131,13 @@ const RequestTabs = () => { ) : null}
  • - +
    diff --git a/packages/bruno-app/src/components/ResponsePane/QueryResult/index.js b/packages/bruno-app/src/components/ResponsePane/QueryResult/index.js index 84a8a748e..e6d6f94a8 100644 --- a/packages/bruno-app/src/components/ResponsePane/QueryResult/index.js +++ b/packages/bruno-app/src/components/ResponsePane/QueryResult/index.js @@ -20,7 +20,14 @@ const QueryResult = ({ item, collection, value, width, disableRunEventListener, return (
    - +
    ); diff --git a/packages/bruno-app/src/components/ResponsePane/StatusCode/StyledWrapper.js b/packages/bruno-app/src/components/ResponsePane/StatusCode/StyledWrapper.js index f0eb25be2..0633fac1e 100644 --- a/packages/bruno-app/src/components/ResponsePane/StatusCode/StyledWrapper.js +++ b/packages/bruno-app/src/components/ResponsePane/StatusCode/StyledWrapper.js @@ -3,11 +3,11 @@ import styled from 'styled-components'; const Wrapper = styled.div` font-size: 0.75rem; font-weight: 600; - + &.text-ok { color: ${(props) => props.theme.requestTabPanel.responseOk}; } - + &.text-error { color: ${(props) => props.theme.requestTabPanel.responseError}; } diff --git a/packages/bruno-app/src/components/ResponsePane/TestResults/index.js b/packages/bruno-app/src/components/ResponsePane/TestResults/index.js index 10e7d3afc..592a2fea5 100644 --- a/packages/bruno-app/src/components/ResponsePane/TestResults/index.js +++ b/packages/bruno-app/src/components/ResponsePane/TestResults/index.js @@ -5,11 +5,7 @@ const TestResults = ({ results, assertionResults }) => { results = results || []; assertionResults = assertionResults || []; if (!results.length && !assertionResults.length) { - return ( -
    - No tests found -
    - ); + return
    No tests found
    ; } const passedTests = results.filter((result) => result.status === 'pass'); @@ -19,7 +15,7 @@ const TestResults = ({ results, assertionResults }) => { const failedAssertions = assertionResults.filter((result) => result.status === 'fail'); return ( - +
    Tests ({results.length}/{results.length}), Passed: {passedTests.length}, Failed: {failedTests.length}
    @@ -27,18 +23,12 @@ const TestResults = ({ results, assertionResults }) => { {results.map((result) => (
  • {result.status === 'pass' ? ( - - ✔  {result.description} - + ✔  {result.description} ) : ( <> - - ✘  {result.description} - + ✘  {result.description}
    - - {result.error} - + {result.error} )}
  • @@ -46,7 +36,8 @@ const TestResults = ({ results, assertionResults }) => {
    - Assertions ({assertionResults.length}/{assertionResults.length}), Passed: {passedAssertions.length}, Failed: {failedAssertions.length} + Assertions ({assertionResults.length}/{assertionResults.length}), Passed: {passedAssertions.length}, Failed:{' '} + {failedAssertions.length}
      {assertionResults.map((result) => ( @@ -61,9 +52,7 @@ const TestResults = ({ results, assertionResults }) => { ✘  {result.lhsExpr}: {result.rhsExpr}
      - - {result.error} - + {result.error} )} diff --git a/packages/bruno-app/src/components/ResponsePane/TestResultsLabel/index.js b/packages/bruno-app/src/components/ResponsePane/TestResultsLabel/index.js index 6cf9a57b9..f894d1f76 100644 --- a/packages/bruno-app/src/components/ResponsePane/TestResultsLabel/index.js +++ b/packages/bruno-app/src/components/ResponsePane/TestResultsLabel/index.js @@ -3,32 +3,28 @@ import React from 'react'; const TestResultsLabel = ({ results, assertionResults }) => { results = results || []; assertionResults = assertionResults || []; - if(!results.length && !assertionResults.length) { + if (!results.length && !assertionResults.length) { return 'Tests'; } const numberOfTests = results.length; - const numberOfFailedTests = results.filter(result => result.status === 'fail').length; + const numberOfFailedTests = results.filter((result) => result.status === 'fail').length; const numberOfAssertions = assertionResults.length; - const numberOfFailedAssertions = assertionResults.filter(result => result.status === 'fail').length; + const numberOfFailedAssertions = assertionResults.filter((result) => result.status === 'fail').length; const totalNumberOfTests = numberOfTests + numberOfAssertions; const totalNumberOfFailedTests = numberOfFailedTests + numberOfFailedAssertions; return ( -
      +
      Tests
      {totalNumberOfFailedTests ? ( - - {totalNumberOfFailedTests} - + {totalNumberOfFailedTests} ) : ( - - {totalNumberOfTests} - + {totalNumberOfTests} )} -
      +
      ); }; diff --git a/packages/bruno-app/src/components/ResponsePane/Timeline/index.js b/packages/bruno-app/src/components/ResponsePane/Timeline/index.js index 3b2fd3f4f..c2d0e5de8 100644 --- a/packages/bruno-app/src/components/ResponsePane/Timeline/index.js +++ b/packages/bruno-app/src/components/ResponsePane/Timeline/index.js @@ -3,7 +3,7 @@ import forOwn from 'lodash/forOwn'; import { safeStringifyJSON } from 'utils/common'; import StyledWrapper from './StyledWrapper'; -const Timeline = ({ request, response}) => { +const Timeline = ({ request, response }) => { const requestHeaders = []; const responseHeaders = response.headers || []; @@ -22,32 +22,32 @@ const Timeline = ({ request, response}) => { return (
      -
      +        
                 {'>'} {request.method} {request.url}
               
      {requestHeaders.map((h) => { return ( -
      +            
                     {'>'} {h.name}: {h.value}
                   
      ); })} {requestData ? ( -
      +          
                   {'>'} data {requestData}
                 
      ) : null}
      -
      -
      +      
      +
                 {'<'} {response.status} {response.statusText}
               
      {responseHeaders.map((h) => { return ( -
      +            
                     {'<'} {h[0]}: {h[1]}
                   
      ); diff --git a/packages/bruno-app/src/components/ResponsePane/index.js b/packages/bruno-app/src/components/ResponsePane/index.js index ed070dc84..9d123dcfe 100644 --- a/packages/bruno-app/src/components/ResponsePane/index.js +++ b/packages/bruno-app/src/components/ResponsePane/index.js @@ -41,7 +41,9 @@ const ResponsePane = ({ rightPaneWidth, item, collection }) => { item={item} collection={collection} width={rightPaneWidth} - value={response.data ? (isJson(response.headers) ? safeStringifyJSON(response.data, true) : response.data) : ''} + value={ + response.data ? (isJson(response.headers) ? safeStringifyJSON(response.data, true) : response.data) : '' + } mode={getContentType(response.headers)} /> ); diff --git a/packages/bruno-app/src/components/RunnerResults/ResponsePane/index.js b/packages/bruno-app/src/components/RunnerResults/ResponsePane/index.js index 8096579cc..ba87fcaf9 100644 --- a/packages/bruno-app/src/components/RunnerResults/ResponsePane/index.js +++ b/packages/bruno-app/src/components/RunnerResults/ResponsePane/index.js @@ -15,11 +15,7 @@ import StyledWrapper from './StyledWrapper'; const ResponsePane = ({ rightPaneWidth, item, collection }) => { const [selectedTab, setSelectedTab] = useState('response'); - const { - requestSent, - responseReceived, - testResults - } = item; + const { requestSent, responseReceived, testResults } = item; const headers = get(item, 'responseReceived.headers', {}); const status = get(item, 'responseReceived.status', 0); @@ -31,13 +27,15 @@ const ResponsePane = ({ rightPaneWidth, item, collection }) => { const getTabPanel = (tab) => { switch (tab) { case 'response': { - return ; + return ( + + ); } case 'headers': { return ; diff --git a/packages/bruno-app/src/components/RunnerResults/index.js b/packages/bruno-app/src/components/RunnerResults/index.js index 68d686af0..aa269df60 100644 --- a/packages/bruno-app/src/components/RunnerResults/index.js +++ b/packages/bruno-app/src/components/RunnerResults/index.js @@ -18,14 +18,14 @@ const getRelativePath = (fullPath, pathname) => { let relativePath = path.relative(fullPath, pathname); const { dir, name } = path.parse(relativePath); return path.join(dir, name); -} +}; -export default function RunnerResults({collection}) { +export default function RunnerResults({ collection }) { const dispatch = useDispatch(); const [selectedItem, setSelectedItem] = useState(null); useEffect(() => { - if(!collection.runnerResult) { + if (!collection.runnerResult) { setSelectedItem(null); } }, [collection, setSelectedItem]); @@ -42,8 +42,8 @@ export default function RunnerResults({collection}) { item.pathname = info.pathname; item.relativePath = getRelativePath(collection.pathname, info.pathname); - if(item.status !== "error") { - if(item.testResults) { + if (item.status !== 'error') { + if (item.testResults) { const failed = item.testResults.filter((result) => result.status === 'fail'); item.testStatus = failed.length ? 'fail' : 'pass'; @@ -51,7 +51,7 @@ export default function RunnerResults({collection}) { item.testStatus = 'pass'; } - if(item.assertionResults) { + if (item.assertionResults) { const failed = item.assertionResults.filter((result) => result.status === 'fail'); item.assertionStatus = failed.length ? 'fail' : 'pass'; @@ -70,29 +70,31 @@ export default function RunnerResults({collection}) { }; const closeRunner = () => { - dispatch(closeCollectionRunner({ - collectionUid: collection.uid, - })); + dispatch( + closeCollectionRunner({ + collectionUid: collection.uid + }) + ); }; const totalRequestsInCollection = getTotalRequestCountInCollection(collectionCopy); const passedRequests = items.filter((item) => { - return item.status !== "error" && item.testStatus === 'pass' && item.assertionStatus === 'pass'; + return item.status !== 'error' && item.testStatus === 'pass' && item.assertionStatus === 'pass'; }); const failedRequests = items.filter((item) => { - return item.status !== "error" && item.testStatus === 'fail' || item.assertionStatus === 'fail'; + return (item.status !== 'error' && item.testStatus === 'fail') || item.assertionStatus === 'fail'; }); - if(!items || !items.length) { + if (!items || !items.length) { return ( - -
      + +
      Runner - +
      -
      - You have {totalRequestsInCollection} requests in this collection. +
      + You have {totalRequestsInCollection} requests in this collection.
      diff --git a/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js b/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js index 22b536df8..bb7fae621 100644 --- a/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js +++ b/packages/bruno-app/src/components/Sidebar/Collections/Collection/CollectionItem/index.js @@ -86,9 +86,11 @@ const CollectionItem = ({ item, collection, searchText }) => { }); const handleClick = (event) => { - dispatch(hideRunnerView({ - collectionUid: collection.uid - })); + dispatch( + hideRunnerView({ + collectionUid: collection.uid + }) + ); if (isItemARequest(item)) { if (itemIsOpenedInTabs(item, tabs)) { dispatch( @@ -151,12 +153,24 @@ const CollectionItem = ({ item, collection, searchText }) => { return ( - {renameItemModalOpen && setRenameItemModalOpen(false)} />} - {cloneItemModalOpen && setCloneItemModalOpen(false)} />} - {deleteItemModalOpen && setDeleteItemModalOpen(false)} />} - {newRequestModalOpen && setNewRequestModalOpen(false)} />} - {newFolderModalOpen && setNewFolderModalOpen(false)} />} - {runCollectionModalOpen && setRunCollectionModalOpen(false)} />} + {renameItemModalOpen && ( + setRenameItemModalOpen(false)} /> + )} + {cloneItemModalOpen && ( + setCloneItemModalOpen(false)} /> + )} + {deleteItemModalOpen && ( + setDeleteItemModalOpen(false)} /> + )} + {newRequestModalOpen && ( + setNewRequestModalOpen(false)} /> + )} + {newFolderModalOpen && ( + setNewFolderModalOpen(false)} /> + )} + {runCollectionModalOpen && ( + setRunCollectionModalOpen(false)} /> + )}
      drag(drop(node))}>
      {indents && indents.length @@ -185,7 +199,14 @@ const CollectionItem = ({ item, collection, searchText }) => { }} >
      - {isFolder ? : null} + {isFolder ? ( + + ) : null}
      diff --git a/packages/bruno-app/src/components/Sidebar/Collections/Collection/RenameCollection/index.js b/packages/bruno-app/src/components/Sidebar/Collections/Collection/RenameCollection/index.js index 9fd842b14..70311bd75 100644 --- a/packages/bruno-app/src/components/Sidebar/Collections/Collection/RenameCollection/index.js +++ b/packages/bruno-app/src/components/Sidebar/Collections/Collection/RenameCollection/index.js @@ -15,7 +15,10 @@ const RenameCollection = ({ collection, onClose }) => { name: collection.name }, validationSchema: Yup.object({ - name: Yup.string().min(1, 'must be atleast 1 characters').max(50, 'must be 50 characters or less').required('name is required') + name: Yup.string() + .min(1, 'must be atleast 1 characters') + .max(50, 'must be 50 characters or less') + .required('name is required') }), onSubmit: (values) => { dispatch(renameCollection(values.name, collection.uid)); diff --git a/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js b/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js index 6cd7dba95..c31ed7e7b 100644 --- a/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js +++ b/packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js @@ -97,13 +97,26 @@ const Collection = ({ collection, searchText }) => { {showNewRequestModal && setShowNewRequestModal(false)} />} {showNewFolderModal && setShowNewFolderModal(false)} />} - {showRenameCollectionModal && setShowRenameCollectionModal(false)} />} - {showRemoveCollectionModal && setShowRemoveCollectionModal(false)} />} - {showRunCollectionModal && setShowRunCollectionModal(false)} />} + {showRenameCollectionModal && ( + setShowRenameCollectionModal(false)} /> + )} + {showRemoveCollectionModal && ( + setShowRemoveCollectionModal(false)} /> + )} + {showRunCollectionModal && ( + setShowRunCollectionModal(false)} /> + )}
      - - + +
      } placement="bottom-start"> diff --git a/packages/bruno-app/src/components/Sidebar/Collections/CreateOrOpenCollection/index.js b/packages/bruno-app/src/components/Sidebar/Collections/CreateOrOpenCollection/index.js index 4874b5cee..09933cfaa 100644 --- a/packages/bruno-app/src/components/Sidebar/Collections/CreateOrOpenCollection/index.js +++ b/packages/bruno-app/src/components/Sidebar/Collections/CreateOrOpenCollection/index.js @@ -18,10 +18,16 @@ const CreateOrOpenCollection = () => { const [createCollectionModalOpen, setCreateCollectionModalOpen] = useState(false); const handleOpenCollection = () => { - dispatch(openCollection()).catch((err) => console.log(err) && toast.error('An error occured while opening the collection')); + dispatch(openCollection()).catch( + (err) => console.log(err) && toast.error('An error occured while opening the collection') + ); }; const CreateLink = () => ( - setCreateCollectionModalOpen(true)}> + setCreateCollectionModalOpen(true)} + > Create ); diff --git a/packages/bruno-app/src/components/Sidebar/Collections/SelectCollection/StyledWrapper.js b/packages/bruno-app/src/components/Sidebar/Collections/SelectCollection/StyledWrapper.js index 605aecc09..6537aac8c 100644 --- a/packages/bruno-app/src/components/Sidebar/Collections/SelectCollection/StyledWrapper.js +++ b/packages/bruno-app/src/components/Sidebar/Collections/SelectCollection/StyledWrapper.js @@ -10,7 +10,7 @@ const StyledWrapper = styled.div` cursor: pointer; &:hover { - background-color: ${(props) => props.theme.plainGrid.hoverBg};; + background-color: ${(props) => props.theme.plainGrid.hoverBg}; } } `; diff --git a/packages/bruno-app/src/components/Sidebar/CreateCollection/index.js b/packages/bruno-app/src/components/Sidebar/CreateCollection/index.js index 87ad5af7f..c5e163403 100644 --- a/packages/bruno-app/src/components/Sidebar/CreateCollection/index.js +++ b/packages/bruno-app/src/components/Sidebar/CreateCollection/index.js @@ -20,8 +20,14 @@ const CreateCollection = ({ onClose }) => { collectionLocation: '' }, validationSchema: Yup.object({ - collectionName: Yup.string().min(1, 'must be atleast 1 characters').max(50, 'must be 50 characters or less').required('collection name is required'), - collectionFolderName: Yup.string().min(1, 'must be atleast 1 characters').max(50, 'must be 50 characters or less').required('folder name is required'), + collectionName: Yup.string() + .min(1, 'must be atleast 1 characters') + .max(50, 'must be 50 characters or less') + .required('collection name is required'), + collectionFolderName: Yup.string() + .min(1, 'must be atleast 1 characters') + .max(50, 'must be 50 characters or less') + .required('folder name is required'), collectionLocation: Yup.string().required('location is required') }), onSubmit: (values) => { @@ -58,8 +64,8 @@ const CreateCollection = ({ onClose }) => {
      { spellCheck="false" value={formik.values.collectionName || ''} /> - {formik.touched.collectionName && formik.errors.collectionName ?
      {formik.errors.collectionName}
      : null} + {formik.touched.collectionName && formik.errors.collectionName ? ( +
      {formik.errors.collectionName}
      + ) : null} { spellCheck="false" value={formik.values.collectionFolderName || ''} /> - {formik.touched.collectionFolderName && formik.errors.collectionFolderName ?
      {formik.errors.collectionFolderName}
      : null} + {formik.touched.collectionFolderName && formik.errors.collectionFolderName ? ( +
      {formik.errors.collectionFolderName}
      + ) : null} <>