PromucFlow_constructor/app/client/src/components/formControls/DynamicTextFieldControl.tsx

159 lines
4.4 KiB
TypeScript
Raw Normal View History

import React from "react";
import { formValueSelector, change } from "redux-form";
import { connect } from "react-redux";
import BaseControl, { ControlProps } from "./BaseControl";
import { ControlType } from "constants/PropertyControlConstants";
import FormLabel from "components/editorComponents/FormLabel";
import DynamicTextField from "components/editorComponents/form/fields/DynamicTextField";
import {
EditorSize,
EditorModes,
TabBehaviour,
} from "components/editorComponents/CodeEditor/EditorConfig";
import { QUERY_EDITOR_FORM_NAME } from "constants/forms";
import { AppState } from "reducers";
import styled from "styled-components";
import TemplateMenu from "pages/Editor/QueryEditor/TemplateMenu";
import { QUERY_BODY_FIELD } from "constants/QueryEditorConstants";
import { getPluginResponseTypes } from "selectors/entitiesSelector";
import history from "utils/history";
import {
convertObjectToQueryParams,
getQueryParams,
} from "utils/AppsmithUtils";
Introducing Google Sheets Plugin (#3517) * cherry pick -make new * revert to enable fix from release * attempt to hook into existing datasource editor * gSheets plugin skeleton from Rest API * Changes for database migration * fix for auth code * separate it out * action page loads! * add to explorer * create action from datasource * Editor JSON WIP * working query form * Editor JSON WIP * import to * fix toast message * redirect from datasource and editor pages * fix onboarding * fix imports and constants * refactor form out * refactor queryForm * Merge branch 'release' into feature/google-sheets * Merge branch 'release' into feature/google-sheets * initial values from settings, editor and form * Check * remove dangling code around lightTheme * Safety net * remove class * try mouseover solve * force click * changes from review * fix action form name on import * Merge branch 'release' into feature/google-sheets * minor cleanup * Merge branch 'release' into feature/google-sheets * WIP * Google sheets changes * Merge conflicts * Merging and fixes, needs refactoring * Check * Merge branch 'release' into feature/google-sheets * Fixed tests * Add cloud services env variable * Clean up saga * Clean up * Refactoring * Deleted svg file * Minor fixes * Modified design to allow behaviour in google sheets methods (#3486) * Modified design to allow behaviour in google sheets methods * Review changes * Removed sysout * Added handling of edge cases with table data * Merge branch 'release' into feature/google-sheets * Fixes * Fixes * Added validations * Improved tests * Removed extraneous injected bean * Review changes * Fixed bug with method * Changes to Google sheets plugin's request and response structures (#3692) * Method changes * Removed logging * Renaming options * Reverting pom version * Modified type of collection variables, fixed errors * Converted row offset field to one that supports dynamic bindings * Review changes * List SAAS plugin type actions under lightning menu apis (#3820) * list saas plugin type actions under lightning menu apis * combine saas plugin type actions in the other sub menu of lightning menu Co-authored-by: Hetu Nandu <hetunandu@gmail.com> * Fix merge issues * Prettified query editor and a few fixes w/ ux * Test fixes * Reformatting request * code for REST added (#3876) Co-authored-by: hetunandu <hetu@appsmith.com> * Renamed body to row object * Renamed placeholder for range * Renamed range heading * Modifications to handle range semantics * Use spreadsheet Url instead of id * Ordering of methods * Removed logging * Add tests for Dynamic text controls * Add tests for url helpers * Fix coverage config * Nevermind * Interface changes * There is no body here * Yay to hints * Delete row field is separately handled as row index * placeholder support (#4001) * Fixed tests, typos and creating new sheets with random rows * Switched to using 'rowIndex' throughout * binding path added for query input field (#4016) * - Fixed QA bugs (#4032) - Split delete sheet into two - Removed dynamic query input types from hidden keys * Proper exceptions * Removed extra logging * Throw exception if update method does not match any of the columns * Same for bulk update * Zero-indexed delete row * I'm a space bound rocket ship * Logic to register installations with cs (#4062) * Logic to register installations with cs * Clean up * Casting to string * Checking to see if this makes the test pass * Added an extra null check Co-authored-by: Piyush <piyush@codeitout.com> Co-authored-by: hetunandu <hetu@appsmith.com> Co-authored-by: Hetu Nandu <hetunandu@gmail.com> Co-authored-by: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com>
2021-04-22 03:30:09 +00:00
import { actionPathFromName } from "components/formControls/utils";
import { EvaluationSubstitutionType } from "entities/DataTree/dataTreeFactory";
const Wrapper = styled.div`
width: 60%;
.dynamic-text-field {
border-radius: 4px;
font-size: 14px;
2020-11-02 09:31:00 +00:00
min-height: calc(100vh / 4);
}
&& {
.CodeMirror-lines {
2020-10-21 07:54:10 +00:00
padding: 10px;
}
}
`;
interface DynamicTextControlState {
showTemplateMenu: boolean;
}
class DynamicTextControl extends BaseControl<
DynamicTextFieldProps,
DynamicTextControlState
> {
constructor(props: DynamicTextFieldProps) {
super(props);
this.state = {
showTemplateMenu: true,
};
}
getControlType(): ControlType {
return "QUERY_DYNAMIC_TEXT";
}
render() {
Introducing Google Sheets Plugin (#3517) * cherry pick -make new * revert to enable fix from release * attempt to hook into existing datasource editor * gSheets plugin skeleton from Rest API * Changes for database migration * fix for auth code * separate it out * action page loads! * add to explorer * create action from datasource * Editor JSON WIP * working query form * Editor JSON WIP * import to * fix toast message * redirect from datasource and editor pages * fix onboarding * fix imports and constants * refactor form out * refactor queryForm * Merge branch 'release' into feature/google-sheets * Merge branch 'release' into feature/google-sheets * initial values from settings, editor and form * Check * remove dangling code around lightTheme * Safety net * remove class * try mouseover solve * force click * changes from review * fix action form name on import * Merge branch 'release' into feature/google-sheets * minor cleanup * Merge branch 'release' into feature/google-sheets * WIP * Google sheets changes * Merge conflicts * Merging and fixes, needs refactoring * Check * Merge branch 'release' into feature/google-sheets * Fixed tests * Add cloud services env variable * Clean up saga * Clean up * Refactoring * Deleted svg file * Minor fixes * Modified design to allow behaviour in google sheets methods (#3486) * Modified design to allow behaviour in google sheets methods * Review changes * Removed sysout * Added handling of edge cases with table data * Merge branch 'release' into feature/google-sheets * Fixes * Fixes * Added validations * Improved tests * Removed extraneous injected bean * Review changes * Fixed bug with method * Changes to Google sheets plugin's request and response structures (#3692) * Method changes * Removed logging * Renaming options * Reverting pom version * Modified type of collection variables, fixed errors * Converted row offset field to one that supports dynamic bindings * Review changes * List SAAS plugin type actions under lightning menu apis (#3820) * list saas plugin type actions under lightning menu apis * combine saas plugin type actions in the other sub menu of lightning menu Co-authored-by: Hetu Nandu <hetunandu@gmail.com> * Fix merge issues * Prettified query editor and a few fixes w/ ux * Test fixes * Reformatting request * code for REST added (#3876) Co-authored-by: hetunandu <hetu@appsmith.com> * Renamed body to row object * Renamed placeholder for range * Renamed range heading * Modifications to handle range semantics * Use spreadsheet Url instead of id * Ordering of methods * Removed logging * Add tests for Dynamic text controls * Add tests for url helpers * Fix coverage config * Nevermind * Interface changes * There is no body here * Yay to hints * Delete row field is separately handled as row index * placeholder support (#4001) * Fixed tests, typos and creating new sheets with random rows * Switched to using 'rowIndex' throughout * binding path added for query input field (#4016) * - Fixed QA bugs (#4032) - Split delete sheet into two - Removed dynamic query input types from hidden keys * Proper exceptions * Removed extra logging * Throw exception if update method does not match any of the columns * Same for bulk update * Zero-indexed delete row * I'm a space bound rocket ship * Logic to register installations with cs (#4062) * Logic to register installations with cs * Clean up * Casting to string * Checking to see if this makes the test pass * Added an extra null check Co-authored-by: Piyush <piyush@codeitout.com> Co-authored-by: hetunandu <hetu@appsmith.com> Co-authored-by: Hetu Nandu <hetunandu@gmail.com> Co-authored-by: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com>
2021-04-22 03:30:09 +00:00
const {
responseType,
label,
placeholderText,
actionName,
configProperty,
evaluationSubstitutionType,
Introducing Google Sheets Plugin (#3517) * cherry pick -make new * revert to enable fix from release * attempt to hook into existing datasource editor * gSheets plugin skeleton from Rest API * Changes for database migration * fix for auth code * separate it out * action page loads! * add to explorer * create action from datasource * Editor JSON WIP * working query form * Editor JSON WIP * import to * fix toast message * redirect from datasource and editor pages * fix onboarding * fix imports and constants * refactor form out * refactor queryForm * Merge branch 'release' into feature/google-sheets * Merge branch 'release' into feature/google-sheets * initial values from settings, editor and form * Check * remove dangling code around lightTheme * Safety net * remove class * try mouseover solve * force click * changes from review * fix action form name on import * Merge branch 'release' into feature/google-sheets * minor cleanup * Merge branch 'release' into feature/google-sheets * WIP * Google sheets changes * Merge conflicts * Merging and fixes, needs refactoring * Check * Merge branch 'release' into feature/google-sheets * Fixed tests * Add cloud services env variable * Clean up saga * Clean up * Refactoring * Deleted svg file * Minor fixes * Modified design to allow behaviour in google sheets methods (#3486) * Modified design to allow behaviour in google sheets methods * Review changes * Removed sysout * Added handling of edge cases with table data * Merge branch 'release' into feature/google-sheets * Fixes * Fixes * Added validations * Improved tests * Removed extraneous injected bean * Review changes * Fixed bug with method * Changes to Google sheets plugin's request and response structures (#3692) * Method changes * Removed logging * Renaming options * Reverting pom version * Modified type of collection variables, fixed errors * Converted row offset field to one that supports dynamic bindings * Review changes * List SAAS plugin type actions under lightning menu apis (#3820) * list saas plugin type actions under lightning menu apis * combine saas plugin type actions in the other sub menu of lightning menu Co-authored-by: Hetu Nandu <hetunandu@gmail.com> * Fix merge issues * Prettified query editor and a few fixes w/ ux * Test fixes * Reformatting request * code for REST added (#3876) Co-authored-by: hetunandu <hetu@appsmith.com> * Renamed body to row object * Renamed placeholder for range * Renamed range heading * Modifications to handle range semantics * Use spreadsheet Url instead of id * Ordering of methods * Removed logging * Add tests for Dynamic text controls * Add tests for url helpers * Fix coverage config * Nevermind * Interface changes * There is no body here * Yay to hints * Delete row field is separately handled as row index * placeholder support (#4001) * Fixed tests, typos and creating new sheets with random rows * Switched to using 'rowIndex' throughout * binding path added for query input field (#4016) * - Fixed QA bugs (#4032) - Split delete sheet into two - Removed dynamic query input types from hidden keys * Proper exceptions * Removed extra logging * Throw exception if update method does not match any of the columns * Same for bulk update * Zero-indexed delete row * I'm a space bound rocket ship * Logic to register installations with cs (#4062) * Logic to register installations with cs * Clean up * Casting to string * Checking to see if this makes the test pass * Added an extra null check Co-authored-by: Piyush <piyush@codeitout.com> Co-authored-by: hetunandu <hetu@appsmith.com> Co-authored-by: Hetu Nandu <hetunandu@gmail.com> Co-authored-by: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com>
2021-04-22 03:30:09 +00:00
} = this.props;
const dataTreePath = actionPathFromName(actionName, configProperty);
const isNewQuery =
new URLSearchParams(window.location.search).get("showTemplate") ===
"true";
const showTemplate =
isNewQuery && this.state.showTemplateMenu && this.props.pluginId;
const mode =
responseType === "TABLE"
? EditorModes.SQL_WITH_BINDING
: EditorModes.JSON_WITH_BINDING;
return (
<Wrapper>
<FormLabel>{label}</FormLabel>
{showTemplate ? (
<TemplateMenu
2020-12-24 04:32:25 +00:00
createTemplate={(templateString) => {
this.setState(
{
showTemplateMenu: false,
},
Introducing Google Sheets Plugin (#3517) * cherry pick -make new * revert to enable fix from release * attempt to hook into existing datasource editor * gSheets plugin skeleton from Rest API * Changes for database migration * fix for auth code * separate it out * action page loads! * add to explorer * create action from datasource * Editor JSON WIP * working query form * Editor JSON WIP * import to * fix toast message * redirect from datasource and editor pages * fix onboarding * fix imports and constants * refactor form out * refactor queryForm * Merge branch 'release' into feature/google-sheets * Merge branch 'release' into feature/google-sheets * initial values from settings, editor and form * Check * remove dangling code around lightTheme * Safety net * remove class * try mouseover solve * force click * changes from review * fix action form name on import * Merge branch 'release' into feature/google-sheets * minor cleanup * Merge branch 'release' into feature/google-sheets * WIP * Google sheets changes * Merge conflicts * Merging and fixes, needs refactoring * Check * Merge branch 'release' into feature/google-sheets * Fixed tests * Add cloud services env variable * Clean up saga * Clean up * Refactoring * Deleted svg file * Minor fixes * Modified design to allow behaviour in google sheets methods (#3486) * Modified design to allow behaviour in google sheets methods * Review changes * Removed sysout * Added handling of edge cases with table data * Merge branch 'release' into feature/google-sheets * Fixes * Fixes * Added validations * Improved tests * Removed extraneous injected bean * Review changes * Fixed bug with method * Changes to Google sheets plugin's request and response structures (#3692) * Method changes * Removed logging * Renaming options * Reverting pom version * Modified type of collection variables, fixed errors * Converted row offset field to one that supports dynamic bindings * Review changes * List SAAS plugin type actions under lightning menu apis (#3820) * list saas plugin type actions under lightning menu apis * combine saas plugin type actions in the other sub menu of lightning menu Co-authored-by: Hetu Nandu <hetunandu@gmail.com> * Fix merge issues * Prettified query editor and a few fixes w/ ux * Test fixes * Reformatting request * code for REST added (#3876) Co-authored-by: hetunandu <hetu@appsmith.com> * Renamed body to row object * Renamed placeholder for range * Renamed range heading * Modifications to handle range semantics * Use spreadsheet Url instead of id * Ordering of methods * Removed logging * Add tests for Dynamic text controls * Add tests for url helpers * Fix coverage config * Nevermind * Interface changes * There is no body here * Yay to hints * Delete row field is separately handled as row index * placeholder support (#4001) * Fixed tests, typos and creating new sheets with random rows * Switched to using 'rowIndex' throughout * binding path added for query input field (#4016) * - Fixed QA bugs (#4032) - Split delete sheet into two - Removed dynamic query input types from hidden keys * Proper exceptions * Removed extra logging * Throw exception if update method does not match any of the columns * Same for bulk update * Zero-indexed delete row * I'm a space bound rocket ship * Logic to register installations with cs (#4062) * Logic to register installations with cs * Clean up * Casting to string * Checking to see if this makes the test pass * Added an extra null check Co-authored-by: Piyush <piyush@codeitout.com> Co-authored-by: hetunandu <hetu@appsmith.com> Co-authored-by: Hetu Nandu <hetunandu@gmail.com> Co-authored-by: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com>
2021-04-22 03:30:09 +00:00
() =>
this.props.createTemplate(
templateString,
this.props.formName,
),
);
}}
pluginId={this.props.pluginId}
/>
) : (
<DynamicTextField
size={EditorSize.EXTENDED}
name={this.props.configProperty}
Introducing Google Sheets Plugin (#3517) * cherry pick -make new * revert to enable fix from release * attempt to hook into existing datasource editor * gSheets plugin skeleton from Rest API * Changes for database migration * fix for auth code * separate it out * action page loads! * add to explorer * create action from datasource * Editor JSON WIP * working query form * Editor JSON WIP * import to * fix toast message * redirect from datasource and editor pages * fix onboarding * fix imports and constants * refactor form out * refactor queryForm * Merge branch 'release' into feature/google-sheets * Merge branch 'release' into feature/google-sheets * initial values from settings, editor and form * Check * remove dangling code around lightTheme * Safety net * remove class * try mouseover solve * force click * changes from review * fix action form name on import * Merge branch 'release' into feature/google-sheets * minor cleanup * Merge branch 'release' into feature/google-sheets * WIP * Google sheets changes * Merge conflicts * Merging and fixes, needs refactoring * Check * Merge branch 'release' into feature/google-sheets * Fixed tests * Add cloud services env variable * Clean up saga * Clean up * Refactoring * Deleted svg file * Minor fixes * Modified design to allow behaviour in google sheets methods (#3486) * Modified design to allow behaviour in google sheets methods * Review changes * Removed sysout * Added handling of edge cases with table data * Merge branch 'release' into feature/google-sheets * Fixes * Fixes * Added validations * Improved tests * Removed extraneous injected bean * Review changes * Fixed bug with method * Changes to Google sheets plugin's request and response structures (#3692) * Method changes * Removed logging * Renaming options * Reverting pom version * Modified type of collection variables, fixed errors * Converted row offset field to one that supports dynamic bindings * Review changes * List SAAS plugin type actions under lightning menu apis (#3820) * list saas plugin type actions under lightning menu apis * combine saas plugin type actions in the other sub menu of lightning menu Co-authored-by: Hetu Nandu <hetunandu@gmail.com> * Fix merge issues * Prettified query editor and a few fixes w/ ux * Test fixes * Reformatting request * code for REST added (#3876) Co-authored-by: hetunandu <hetu@appsmith.com> * Renamed body to row object * Renamed placeholder for range * Renamed range heading * Modifications to handle range semantics * Use spreadsheet Url instead of id * Ordering of methods * Removed logging * Add tests for Dynamic text controls * Add tests for url helpers * Fix coverage config * Nevermind * Interface changes * There is no body here * Yay to hints * Delete row field is separately handled as row index * placeholder support (#4001) * Fixed tests, typos and creating new sheets with random rows * Switched to using 'rowIndex' throughout * binding path added for query input field (#4016) * - Fixed QA bugs (#4032) - Split delete sheet into two - Removed dynamic query input types from hidden keys * Proper exceptions * Removed extra logging * Throw exception if update method does not match any of the columns * Same for bulk update * Zero-indexed delete row * I'm a space bound rocket ship * Logic to register installations with cs (#4062) * Logic to register installations with cs * Clean up * Casting to string * Checking to see if this makes the test pass * Added an extra null check Co-authored-by: Piyush <piyush@codeitout.com> Co-authored-by: hetunandu <hetu@appsmith.com> Co-authored-by: Hetu Nandu <hetunandu@gmail.com> Co-authored-by: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com>
2021-04-22 03:30:09 +00:00
dataTreePath={dataTreePath}
className="dynamic-text-field"
mode={mode}
tabBehaviour={TabBehaviour.INDENT}
Introducing Google Sheets Plugin (#3517) * cherry pick -make new * revert to enable fix from release * attempt to hook into existing datasource editor * gSheets plugin skeleton from Rest API * Changes for database migration * fix for auth code * separate it out * action page loads! * add to explorer * create action from datasource * Editor JSON WIP * working query form * Editor JSON WIP * import to * fix toast message * redirect from datasource and editor pages * fix onboarding * fix imports and constants * refactor form out * refactor queryForm * Merge branch 'release' into feature/google-sheets * Merge branch 'release' into feature/google-sheets * initial values from settings, editor and form * Check * remove dangling code around lightTheme * Safety net * remove class * try mouseover solve * force click * changes from review * fix action form name on import * Merge branch 'release' into feature/google-sheets * minor cleanup * Merge branch 'release' into feature/google-sheets * WIP * Google sheets changes * Merge conflicts * Merging and fixes, needs refactoring * Check * Merge branch 'release' into feature/google-sheets * Fixed tests * Add cloud services env variable * Clean up saga * Clean up * Refactoring * Deleted svg file * Minor fixes * Modified design to allow behaviour in google sheets methods (#3486) * Modified design to allow behaviour in google sheets methods * Review changes * Removed sysout * Added handling of edge cases with table data * Merge branch 'release' into feature/google-sheets * Fixes * Fixes * Added validations * Improved tests * Removed extraneous injected bean * Review changes * Fixed bug with method * Changes to Google sheets plugin's request and response structures (#3692) * Method changes * Removed logging * Renaming options * Reverting pom version * Modified type of collection variables, fixed errors * Converted row offset field to one that supports dynamic bindings * Review changes * List SAAS plugin type actions under lightning menu apis (#3820) * list saas plugin type actions under lightning menu apis * combine saas plugin type actions in the other sub menu of lightning menu Co-authored-by: Hetu Nandu <hetunandu@gmail.com> * Fix merge issues * Prettified query editor and a few fixes w/ ux * Test fixes * Reformatting request * code for REST added (#3876) Co-authored-by: hetunandu <hetu@appsmith.com> * Renamed body to row object * Renamed placeholder for range * Renamed range heading * Modifications to handle range semantics * Use spreadsheet Url instead of id * Ordering of methods * Removed logging * Add tests for Dynamic text controls * Add tests for url helpers * Fix coverage config * Nevermind * Interface changes * There is no body here * Yay to hints * Delete row field is separately handled as row index * placeholder support (#4001) * Fixed tests, typos and creating new sheets with random rows * Switched to using 'rowIndex' throughout * binding path added for query input field (#4016) * - Fixed QA bugs (#4032) - Split delete sheet into two - Removed dynamic query input types from hidden keys * Proper exceptions * Removed extra logging * Throw exception if update method does not match any of the columns * Same for bulk update * Zero-indexed delete row * I'm a space bound rocket ship * Logic to register installations with cs (#4062) * Logic to register installations with cs * Clean up * Casting to string * Checking to see if this makes the test pass * Added an extra null check Co-authored-by: Piyush <piyush@codeitout.com> Co-authored-by: hetunandu <hetu@appsmith.com> Co-authored-by: Hetu Nandu <hetunandu@gmail.com> Co-authored-by: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com>
2021-04-22 03:30:09 +00:00
placeholder={placeholderText}
evaluationSubstitutionType={evaluationSubstitutionType}
/>
)}
</Wrapper>
);
}
}
export interface DynamicTextFieldProps extends ControlProps {
actionName: string;
Introducing Google Sheets Plugin (#3517) * cherry pick -make new * revert to enable fix from release * attempt to hook into existing datasource editor * gSheets plugin skeleton from Rest API * Changes for database migration * fix for auth code * separate it out * action page loads! * add to explorer * create action from datasource * Editor JSON WIP * working query form * Editor JSON WIP * import to * fix toast message * redirect from datasource and editor pages * fix onboarding * fix imports and constants * refactor form out * refactor queryForm * Merge branch 'release' into feature/google-sheets * Merge branch 'release' into feature/google-sheets * initial values from settings, editor and form * Check * remove dangling code around lightTheme * Safety net * remove class * try mouseover solve * force click * changes from review * fix action form name on import * Merge branch 'release' into feature/google-sheets * minor cleanup * Merge branch 'release' into feature/google-sheets * WIP * Google sheets changes * Merge conflicts * Merging and fixes, needs refactoring * Check * Merge branch 'release' into feature/google-sheets * Fixed tests * Add cloud services env variable * Clean up saga * Clean up * Refactoring * Deleted svg file * Minor fixes * Modified design to allow behaviour in google sheets methods (#3486) * Modified design to allow behaviour in google sheets methods * Review changes * Removed sysout * Added handling of edge cases with table data * Merge branch 'release' into feature/google-sheets * Fixes * Fixes * Added validations * Improved tests * Removed extraneous injected bean * Review changes * Fixed bug with method * Changes to Google sheets plugin's request and response structures (#3692) * Method changes * Removed logging * Renaming options * Reverting pom version * Modified type of collection variables, fixed errors * Converted row offset field to one that supports dynamic bindings * Review changes * List SAAS plugin type actions under lightning menu apis (#3820) * list saas plugin type actions under lightning menu apis * combine saas plugin type actions in the other sub menu of lightning menu Co-authored-by: Hetu Nandu <hetunandu@gmail.com> * Fix merge issues * Prettified query editor and a few fixes w/ ux * Test fixes * Reformatting request * code for REST added (#3876) Co-authored-by: hetunandu <hetu@appsmith.com> * Renamed body to row object * Renamed placeholder for range * Renamed range heading * Modifications to handle range semantics * Use spreadsheet Url instead of id * Ordering of methods * Removed logging * Add tests for Dynamic text controls * Add tests for url helpers * Fix coverage config * Nevermind * Interface changes * There is no body here * Yay to hints * Delete row field is separately handled as row index * placeholder support (#4001) * Fixed tests, typos and creating new sheets with random rows * Switched to using 'rowIndex' throughout * binding path added for query input field (#4016) * - Fixed QA bugs (#4032) - Split delete sheet into two - Removed dynamic query input types from hidden keys * Proper exceptions * Removed extra logging * Throw exception if update method does not match any of the columns * Same for bulk update * Zero-indexed delete row * I'm a space bound rocket ship * Logic to register installations with cs (#4062) * Logic to register installations with cs * Clean up * Casting to string * Checking to see if this makes the test pass * Added an extra null check Co-authored-by: Piyush <piyush@codeitout.com> Co-authored-by: hetunandu <hetu@appsmith.com> Co-authored-by: Hetu Nandu <hetunandu@gmail.com> Co-authored-by: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com>
2021-04-22 03:30:09 +00:00
createTemplate: (template: any, formName: string) => any;
pluginId: string;
responseType: string;
Introducing Google Sheets Plugin (#3517) * cherry pick -make new * revert to enable fix from release * attempt to hook into existing datasource editor * gSheets plugin skeleton from Rest API * Changes for database migration * fix for auth code * separate it out * action page loads! * add to explorer * create action from datasource * Editor JSON WIP * working query form * Editor JSON WIP * import to * fix toast message * redirect from datasource and editor pages * fix onboarding * fix imports and constants * refactor form out * refactor queryForm * Merge branch 'release' into feature/google-sheets * Merge branch 'release' into feature/google-sheets * initial values from settings, editor and form * Check * remove dangling code around lightTheme * Safety net * remove class * try mouseover solve * force click * changes from review * fix action form name on import * Merge branch 'release' into feature/google-sheets * minor cleanup * Merge branch 'release' into feature/google-sheets * WIP * Google sheets changes * Merge conflicts * Merging and fixes, needs refactoring * Check * Merge branch 'release' into feature/google-sheets * Fixed tests * Add cloud services env variable * Clean up saga * Clean up * Refactoring * Deleted svg file * Minor fixes * Modified design to allow behaviour in google sheets methods (#3486) * Modified design to allow behaviour in google sheets methods * Review changes * Removed sysout * Added handling of edge cases with table data * Merge branch 'release' into feature/google-sheets * Fixes * Fixes * Added validations * Improved tests * Removed extraneous injected bean * Review changes * Fixed bug with method * Changes to Google sheets plugin's request and response structures (#3692) * Method changes * Removed logging * Renaming options * Reverting pom version * Modified type of collection variables, fixed errors * Converted row offset field to one that supports dynamic bindings * Review changes * List SAAS plugin type actions under lightning menu apis (#3820) * list saas plugin type actions under lightning menu apis * combine saas plugin type actions in the other sub menu of lightning menu Co-authored-by: Hetu Nandu <hetunandu@gmail.com> * Fix merge issues * Prettified query editor and a few fixes w/ ux * Test fixes * Reformatting request * code for REST added (#3876) Co-authored-by: hetunandu <hetu@appsmith.com> * Renamed body to row object * Renamed placeholder for range * Renamed range heading * Modifications to handle range semantics * Use spreadsheet Url instead of id * Ordering of methods * Removed logging * Add tests for Dynamic text controls * Add tests for url helpers * Fix coverage config * Nevermind * Interface changes * There is no body here * Yay to hints * Delete row field is separately handled as row index * placeholder support (#4001) * Fixed tests, typos and creating new sheets with random rows * Switched to using 'rowIndex' throughout * binding path added for query input field (#4016) * - Fixed QA bugs (#4032) - Split delete sheet into two - Removed dynamic query input types from hidden keys * Proper exceptions * Removed extra logging * Throw exception if update method does not match any of the columns * Same for bulk update * Zero-indexed delete row * I'm a space bound rocket ship * Logic to register installations with cs (#4062) * Logic to register installations with cs * Clean up * Casting to string * Checking to see if this makes the test pass * Added an extra null check Co-authored-by: Piyush <piyush@codeitout.com> Co-authored-by: hetunandu <hetu@appsmith.com> Co-authored-by: Hetu Nandu <hetunandu@gmail.com> Co-authored-by: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com>
2021-04-22 03:30:09 +00:00
placeholderText?: string;
evaluationSubstitutionType: EvaluationSubstitutionType;
}
Introducing Google Sheets Plugin (#3517) * cherry pick -make new * revert to enable fix from release * attempt to hook into existing datasource editor * gSheets plugin skeleton from Rest API * Changes for database migration * fix for auth code * separate it out * action page loads! * add to explorer * create action from datasource * Editor JSON WIP * working query form * Editor JSON WIP * import to * fix toast message * redirect from datasource and editor pages * fix onboarding * fix imports and constants * refactor form out * refactor queryForm * Merge branch 'release' into feature/google-sheets * Merge branch 'release' into feature/google-sheets * initial values from settings, editor and form * Check * remove dangling code around lightTheme * Safety net * remove class * try mouseover solve * force click * changes from review * fix action form name on import * Merge branch 'release' into feature/google-sheets * minor cleanup * Merge branch 'release' into feature/google-sheets * WIP * Google sheets changes * Merge conflicts * Merging and fixes, needs refactoring * Check * Merge branch 'release' into feature/google-sheets * Fixed tests * Add cloud services env variable * Clean up saga * Clean up * Refactoring * Deleted svg file * Minor fixes * Modified design to allow behaviour in google sheets methods (#3486) * Modified design to allow behaviour in google sheets methods * Review changes * Removed sysout * Added handling of edge cases with table data * Merge branch 'release' into feature/google-sheets * Fixes * Fixes * Added validations * Improved tests * Removed extraneous injected bean * Review changes * Fixed bug with method * Changes to Google sheets plugin's request and response structures (#3692) * Method changes * Removed logging * Renaming options * Reverting pom version * Modified type of collection variables, fixed errors * Converted row offset field to one that supports dynamic bindings * Review changes * List SAAS plugin type actions under lightning menu apis (#3820) * list saas plugin type actions under lightning menu apis * combine saas plugin type actions in the other sub menu of lightning menu Co-authored-by: Hetu Nandu <hetunandu@gmail.com> * Fix merge issues * Prettified query editor and a few fixes w/ ux * Test fixes * Reformatting request * code for REST added (#3876) Co-authored-by: hetunandu <hetu@appsmith.com> * Renamed body to row object * Renamed placeholder for range * Renamed range heading * Modifications to handle range semantics * Use spreadsheet Url instead of id * Ordering of methods * Removed logging * Add tests for Dynamic text controls * Add tests for url helpers * Fix coverage config * Nevermind * Interface changes * There is no body here * Yay to hints * Delete row field is separately handled as row index * placeholder support (#4001) * Fixed tests, typos and creating new sheets with random rows * Switched to using 'rowIndex' throughout * binding path added for query input field (#4016) * - Fixed QA bugs (#4032) - Split delete sheet into two - Removed dynamic query input types from hidden keys * Proper exceptions * Removed extra logging * Throw exception if update method does not match any of the columns * Same for bulk update * Zero-indexed delete row * I'm a space bound rocket ship * Logic to register installations with cs (#4062) * Logic to register installations with cs * Clean up * Casting to string * Checking to see if this makes the test pass * Added an extra null check Co-authored-by: Piyush <piyush@codeitout.com> Co-authored-by: hetunandu <hetu@appsmith.com> Co-authored-by: Hetu Nandu <hetunandu@gmail.com> Co-authored-by: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com>
2021-04-22 03:30:09 +00:00
const mapStateToProps = (state: AppState, props: DynamicTextFieldProps) => {
const valueSelector = formValueSelector(
props.formName || QUERY_EDITOR_FORM_NAME,
);
const actionName = valueSelector(state, "name");
const pluginId = valueSelector(state, "datasource.pluginId");
const responseTypes = getPluginResponseTypes(state);
return {
actionName,
pluginId,
responseType: responseTypes[pluginId],
};
};
const mapDispatchToProps = (dispatch: any) => ({
Introducing Google Sheets Plugin (#3517) * cherry pick -make new * revert to enable fix from release * attempt to hook into existing datasource editor * gSheets plugin skeleton from Rest API * Changes for database migration * fix for auth code * separate it out * action page loads! * add to explorer * create action from datasource * Editor JSON WIP * working query form * Editor JSON WIP * import to * fix toast message * redirect from datasource and editor pages * fix onboarding * fix imports and constants * refactor form out * refactor queryForm * Merge branch 'release' into feature/google-sheets * Merge branch 'release' into feature/google-sheets * initial values from settings, editor and form * Check * remove dangling code around lightTheme * Safety net * remove class * try mouseover solve * force click * changes from review * fix action form name on import * Merge branch 'release' into feature/google-sheets * minor cleanup * Merge branch 'release' into feature/google-sheets * WIP * Google sheets changes * Merge conflicts * Merging and fixes, needs refactoring * Check * Merge branch 'release' into feature/google-sheets * Fixed tests * Add cloud services env variable * Clean up saga * Clean up * Refactoring * Deleted svg file * Minor fixes * Modified design to allow behaviour in google sheets methods (#3486) * Modified design to allow behaviour in google sheets methods * Review changes * Removed sysout * Added handling of edge cases with table data * Merge branch 'release' into feature/google-sheets * Fixes * Fixes * Added validations * Improved tests * Removed extraneous injected bean * Review changes * Fixed bug with method * Changes to Google sheets plugin's request and response structures (#3692) * Method changes * Removed logging * Renaming options * Reverting pom version * Modified type of collection variables, fixed errors * Converted row offset field to one that supports dynamic bindings * Review changes * List SAAS plugin type actions under lightning menu apis (#3820) * list saas plugin type actions under lightning menu apis * combine saas plugin type actions in the other sub menu of lightning menu Co-authored-by: Hetu Nandu <hetunandu@gmail.com> * Fix merge issues * Prettified query editor and a few fixes w/ ux * Test fixes * Reformatting request * code for REST added (#3876) Co-authored-by: hetunandu <hetu@appsmith.com> * Renamed body to row object * Renamed placeholder for range * Renamed range heading * Modifications to handle range semantics * Use spreadsheet Url instead of id * Ordering of methods * Removed logging * Add tests for Dynamic text controls * Add tests for url helpers * Fix coverage config * Nevermind * Interface changes * There is no body here * Yay to hints * Delete row field is separately handled as row index * placeholder support (#4001) * Fixed tests, typos and creating new sheets with random rows * Switched to using 'rowIndex' throughout * binding path added for query input field (#4016) * - Fixed QA bugs (#4032) - Split delete sheet into two - Removed dynamic query input types from hidden keys * Proper exceptions * Removed extra logging * Throw exception if update method does not match any of the columns * Same for bulk update * Zero-indexed delete row * I'm a space bound rocket ship * Logic to register installations with cs (#4062) * Logic to register installations with cs * Clean up * Casting to string * Checking to see if this makes the test pass * Added an extra null check Co-authored-by: Piyush <piyush@codeitout.com> Co-authored-by: hetunandu <hetu@appsmith.com> Co-authored-by: Hetu Nandu <hetunandu@gmail.com> Co-authored-by: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com>
2021-04-22 03:30:09 +00:00
createTemplate: (template: any, formName: string) => {
const params = getQueryParams();
if (params.showTemplate) {
params.showTemplate = "false";
}
history.replace({
...window.location,
search: convertObjectToQueryParams(params),
});
Introducing Google Sheets Plugin (#3517) * cherry pick -make new * revert to enable fix from release * attempt to hook into existing datasource editor * gSheets plugin skeleton from Rest API * Changes for database migration * fix for auth code * separate it out * action page loads! * add to explorer * create action from datasource * Editor JSON WIP * working query form * Editor JSON WIP * import to * fix toast message * redirect from datasource and editor pages * fix onboarding * fix imports and constants * refactor form out * refactor queryForm * Merge branch 'release' into feature/google-sheets * Merge branch 'release' into feature/google-sheets * initial values from settings, editor and form * Check * remove dangling code around lightTheme * Safety net * remove class * try mouseover solve * force click * changes from review * fix action form name on import * Merge branch 'release' into feature/google-sheets * minor cleanup * Merge branch 'release' into feature/google-sheets * WIP * Google sheets changes * Merge conflicts * Merging and fixes, needs refactoring * Check * Merge branch 'release' into feature/google-sheets * Fixed tests * Add cloud services env variable * Clean up saga * Clean up * Refactoring * Deleted svg file * Minor fixes * Modified design to allow behaviour in google sheets methods (#3486) * Modified design to allow behaviour in google sheets methods * Review changes * Removed sysout * Added handling of edge cases with table data * Merge branch 'release' into feature/google-sheets * Fixes * Fixes * Added validations * Improved tests * Removed extraneous injected bean * Review changes * Fixed bug with method * Changes to Google sheets plugin's request and response structures (#3692) * Method changes * Removed logging * Renaming options * Reverting pom version * Modified type of collection variables, fixed errors * Converted row offset field to one that supports dynamic bindings * Review changes * List SAAS plugin type actions under lightning menu apis (#3820) * list saas plugin type actions under lightning menu apis * combine saas plugin type actions in the other sub menu of lightning menu Co-authored-by: Hetu Nandu <hetunandu@gmail.com> * Fix merge issues * Prettified query editor and a few fixes w/ ux * Test fixes * Reformatting request * code for REST added (#3876) Co-authored-by: hetunandu <hetu@appsmith.com> * Renamed body to row object * Renamed placeholder for range * Renamed range heading * Modifications to handle range semantics * Use spreadsheet Url instead of id * Ordering of methods * Removed logging * Add tests for Dynamic text controls * Add tests for url helpers * Fix coverage config * Nevermind * Interface changes * There is no body here * Yay to hints * Delete row field is separately handled as row index * placeholder support (#4001) * Fixed tests, typos and creating new sheets with random rows * Switched to using 'rowIndex' throughout * binding path added for query input field (#4016) * - Fixed QA bugs (#4032) - Split delete sheet into two - Removed dynamic query input types from hidden keys * Proper exceptions * Removed extra logging * Throw exception if update method does not match any of the columns * Same for bulk update * Zero-indexed delete row * I'm a space bound rocket ship * Logic to register installations with cs (#4062) * Logic to register installations with cs * Clean up * Casting to string * Checking to see if this makes the test pass * Added an extra null check Co-authored-by: Piyush <piyush@codeitout.com> Co-authored-by: hetunandu <hetu@appsmith.com> Co-authored-by: Hetu Nandu <hetunandu@gmail.com> Co-authored-by: Apeksha Bhosale <7846888+ApekshaBhosale@users.noreply.github.com>
2021-04-22 03:30:09 +00:00
dispatch(
change(formName || QUERY_EDITOR_FORM_NAME, QUERY_BODY_FIELD, template),
);
},
});
export default connect(mapStateToProps, mapDispatchToProps)(DynamicTextControl);