From 8c8312928aedc3d270aa9ce462c4af27a05554a0 Mon Sep 17 00:00:00 2001 From: Hetu Nandu Date: Wed, 13 Nov 2019 07:34:59 +0000 Subject: [PATCH] Fix various api pane bugs --- app/client/src/actions/actionActions.ts | 2 +- app/client/src/actions/bindingActions.ts | 2 +- app/client/src/api/Api.tsx | 2 +- .../appsmith/TextInputComponent.tsx | 68 +++--- .../blueprint/ButtonComponent.tsx | 23 +- .../editorComponents/ApiResponseView.tsx | 2 +- .../fields/DatasourcesField.tsx | 2 - .../src/constants/ReduxActionConstants.tsx | 3 + .../pages/Editor/APIEditor/ApiEditorForm.tsx | 95 ++++---- app/client/src/pages/Editor/ApiEditor.tsx | 46 ++-- app/client/src/pages/Editor/ApiSidebar.tsx | 118 +++++++-- app/client/src/pages/Editor/EditorHeader.tsx | 13 +- app/client/src/pages/Editor/index.tsx | 2 +- .../entityReducers/actionsReducer.tsx | 36 --- app/client/src/reducers/index.tsx | 2 + .../src/reducers/uiReducers/apiPaneReducer.ts | 84 +++++++ app/client/src/reducers/uiReducers/index.tsx | 2 + app/client/src/sagas/ActionSagas.ts | 226 ++++++++++-------- app/client/src/sagas/BindingsSagas.ts | 25 +- app/client/src/sagas/DatasourcesSagas.ts | 52 ++-- app/client/src/sagas/InitSagas.ts | 14 +- app/client/src/sagas/PageSagas.tsx | 55 +---- app/client/src/sagas/WidgetOperationSagas.tsx | 4 - app/client/src/utils/validation/ApiForm.ts | 2 +- app/client/src/widgets/BaseWidget.tsx | 2 +- 25 files changed, 533 insertions(+), 349 deletions(-) create mode 100644 app/client/src/reducers/uiReducers/apiPaneReducer.ts diff --git a/app/client/src/actions/actionActions.ts b/app/client/src/actions/actionActions.ts index 122c3d8681..879f3e7c9f 100644 --- a/app/client/src/actions/actionActions.ts +++ b/app/client/src/actions/actionActions.ts @@ -2,7 +2,7 @@ import { ReduxActionTypes } from "../constants/ReduxActionConstants"; import { RestAction } from "../api/ActionAPI"; import { ActionPayload } from "../constants/ActionConstants"; -export const createActionRequest = (payload: RestAction) => { +export const createActionRequest = (payload: Partial) => { return { type: ReduxActionTypes.CREATE_ACTION_INIT, payload, diff --git a/app/client/src/actions/bindingActions.ts b/app/client/src/actions/bindingActions.ts index 9b5c2975ab..ebd7303a7f 100644 --- a/app/client/src/actions/bindingActions.ts +++ b/app/client/src/actions/bindingActions.ts @@ -5,7 +5,7 @@ import { } from "../constants/ReduxActionConstants"; import { NamePathBindingMap } from "../constants/BindingsConstants"; -export const createUpdateBindingsMap = (): ReduxActionWithoutPayload => ({ +export const initBindingMapListener = (): ReduxActionWithoutPayload => ({ type: ReduxActionTypes.CREATE_UPDATE_BINDINGS_MAP_INIT, }); diff --git a/app/client/src/api/Api.tsx b/app/client/src/api/Api.tsx index 036dc81fd6..a7dd8cb421 100644 --- a/app/client/src/api/Api.tsx +++ b/app/client/src/api/Api.tsx @@ -6,7 +6,7 @@ import { REQUEST_HEADERS, AUTH_CREDENTIALS, } from "../constants/ApiConstants"; -import { ActionApiResponse, ActionResponse } from "./ActionAPI"; +import { ActionApiResponse } from "./ActionAPI"; const axiosInstance = axios.create({ baseURL: BASE_URL, diff --git a/app/client/src/components/designSystems/appsmith/TextInputComponent.tsx b/app/client/src/components/designSystems/appsmith/TextInputComponent.tsx index cc57fd581d..a714d725e4 100644 --- a/app/client/src/components/designSystems/appsmith/TextInputComponent.tsx +++ b/app/client/src/components/designSystems/appsmith/TextInputComponent.tsx @@ -1,24 +1,40 @@ import React from "react"; -import styled, { css } from "styled-components"; +import styled from "styled-components"; import { WrappedFieldInputProps, WrappedFieldMetaProps } from "redux-form"; +import { FormGroup, IconName, InputGroup, Intent } from "@blueprintjs/core"; import { ComponentProps } from "./BaseComponent"; -const InputStyles = css` - padding: ${props => `${props.theme.spaces[3]}px ${props.theme.spaces[1]}px`}; +const TextInput = styled(InputGroup)` flex: 1; - border: 1px solid ${props => props.theme.colors.inputInactiveBorders}; - border-radius: 4px; - height: 32px; - background-color: ${props => props.theme.colors.textOnDarkBG}; - &:focus { - border-color: ${props => props.theme.colors.secondary}; + input { + border: 1px solid ${props => props.theme.colors.inputInactiveBorders}; + border-radius: 4px; + box-shadow: none; + height: 38px; background-color: ${props => props.theme.colors.textOnDarkBG}; - outline: 0; + &:focus { + border-color: ${props => props.theme.colors.secondary}; + background-color: ${props => props.theme.colors.textOnDarkBG}; + outline: 0; + } + } + .bp3-icon { + border-radius: 4px 0 0 4px; + margin: 0; + height: 38px; + width: 30px; + background-color: ${props => props.theme.colors.menuButtonBGInactive}; + display: flex; + align-items: center; + justify-content: center; + svg { + height: 20px; + width: 20px; + path { + fill: ${props => props.theme.colors.textDefault}; + } + } } -`; - -const Input = styled.input` - ${InputStyles} `; const InputContainer = styled.div` @@ -27,32 +43,26 @@ const InputContainer = styled.div` flex-direction: column; `; -const Error = styled.span` +const ErrorText = styled.span` + height: 10px; + padding: 3px; + font-size: 10px; color: ${props => props.theme.colors.error}; - fontsize: ${props => props.theme.fontSizes[1]}; -`; - -const TextArea = styled.textarea` - ${InputStyles} - height: 100px; `; export interface TextInputProps { placeholderMessage?: string; - multiline?: boolean; - input?: WrappedFieldInputProps; + input?: Partial; meta?: WrappedFieldMetaProps; + icon?: IconName; } export const BaseTextInput = (props: TextInputProps) => { - const { placeholderMessage, multiline, input, meta } = props; - if (multiline) { - return