diff --git a/app/client/.gitlab-ci.yml b/app/client/.gitlab-ci.yml index 12d371e6af..4fa48d9a2a 100644 --- a/app/client/.gitlab-ci.yml +++ b/app/client/.gitlab-ci.yml @@ -81,6 +81,8 @@ react-build-automation: unit_test: image: tarampampam/node:10.16-alpine stage: test + # Start running this job only when the build-automation job is complete + needs: ["react-build-automation"] script: - *set_automation_env - yarn run test:unit diff --git a/app/client/build.sh b/app/client/build.sh index 2a3218f035..4061e27ddd 100755 --- a/app/client/build.sh +++ b/app/client/build.sh @@ -1,5 +1,4 @@ #!/bin/sh -# GIT_BRANCH=$(git branch --no-color | grep -E '^\*' | sed 's/\*[^a-z]*//g') GIT_SHA=$(eval git rev-parse HEAD) echo $GIT_SHA diff --git a/app/client/src/components/designSystems/appsmith/MapComponent.tsx b/app/client/src/components/designSystems/appsmith/MapComponent.tsx index b74f121887..55b9565616 100644 --- a/app/client/src/components/designSystems/appsmith/MapComponent.tsx +++ b/app/client/src/components/designSystems/appsmith/MapComponent.tsx @@ -8,7 +8,7 @@ import { import SearchBox from "react-google-maps/lib/components/places/SearchBox"; import { MarkerProps } from "widgets/MapWidget"; import PickMyLocation from "./PickMyLocation"; -import styled, { AnyStyledComponent } from "styled-components"; +import styled from "styled-components"; interface MapComponentProps { widgetId: string; diff --git a/app/client/src/pages/Editor/APIEditor/ProviderTemplates.tsx b/app/client/src/pages/Editor/APIEditor/ProviderTemplates.tsx index 893ed575e4..c4d4b85b35 100644 --- a/app/client/src/pages/Editor/APIEditor/ProviderTemplates.tsx +++ b/app/client/src/pages/Editor/APIEditor/ProviderTemplates.tsx @@ -27,33 +27,14 @@ import { fetchProviderTemplates, addApiToPage, } from "actions/providerActions"; -import { Colors } from "constants/Colors"; import { getDuplicateName } from "utils/AppsmithUtils"; import { API_EDITOR_URL_WITH_SELECTED_PAGE_ID } from "constants/routes"; -import { BaseTextInput } from "components/designSystems/appsmith/TextInputComponent"; import Spinner from "components/editorComponents/Spinner"; import { getInitialsAndColorCode } from "utils/AppsmithUtils"; import AnalyticsUtil from "utils/AnalyticsUtil"; const TEMPLATES_TOP_SECTION_HEIGHT = "83px"; -const SearchContainer = styled.div` - display: flex; - width: 40%; - .closeBtn { - position: absolute; - left: 70%; - } -`; - -const SearchBar = styled(BaseTextInput)` - margin-bottom: 10px; - input { - background-color: ${Colors.WHITE}; - 1px solid ${Colors.GEYSER}; - } -`; - const ProviderInfo = styled.div` display: flex; padding: 10px; diff --git a/app/client/src/pages/Editor/DataSourceEditor/DBForm.tsx b/app/client/src/pages/Editor/DataSourceEditor/DBForm.tsx index 33a19cb12f..86a626fbc5 100644 --- a/app/client/src/pages/Editor/DataSourceEditor/DBForm.tsx +++ b/app/client/src/pages/Editor/DataSourceEditor/DBForm.tsx @@ -18,9 +18,6 @@ import ImageAlt from "assets/images/placeholder-image.svg"; import Postgres from "assets/images/Postgress.png"; import MongoDB from "assets/images/MongoDB.png"; import RestTemplateImage from "assets/images/RestAPI.png"; -import MongoConfigResponse from "mockResponses/MongoConfigResponse"; -import PostgresConfigResponse from "mockResponses/PostgresConfigResponse"; -import RestTemplateConfigResponse from "mockResponses/RestTemplateConfigResponse"; import { ControlProps } from "components/formControls/BaseControl"; import CenteredWrapper from "components/designSystems/appsmith/CenteredWrapper"; @@ -183,19 +180,6 @@ class DatasourceDBEditor extends React.Component< return !_.isEmpty(errors); }; - getMockResponse = (packageName: string) => { - switch (packageName) { - case PLUGIN_PACKAGE_POSTGRES: - return PostgresConfigResponse; - case PLUGIN_PACKAGE_MONGO: - return MongoConfigResponse; - case REST_PLUGIN_PACKAGE_NAME: - return RestTemplateConfigResponse; - default: - return []; - } - }; - getImageSrc = (pluginPackage: string) => { switch (pluginPackage) { case PLUGIN_PACKAGE_POSTGRES: @@ -246,13 +230,15 @@ class DatasourceDBEditor extends React.Component< const values = _.get(formData, properties[0]); const newValues: ({ [s: string]: unknown } | ArrayLike)[] = []; - values.map((object: { [s: string]: unknown } | ArrayLike) => { - const isEmpty = Object.values(object).every(x => x === ""); + values.forEach( + (object: { [s: string]: unknown } | ArrayLike) => { + const isEmpty = Object.values(object).every(x => x === ""); - if (!isEmpty) { - newValues.push(object); - } - }); + if (!isEmpty) { + newValues.push(object); + } + }, + ); if (newValues.length) { formData = _.set(formData, properties[0], newValues); @@ -265,13 +251,15 @@ class DatasourceDBEditor extends React.Component< const values = _.get(formData, configProperty); const newValues: ({ [s: string]: unknown } | ArrayLike)[] = []; - values.map((object: { [s: string]: unknown } | ArrayLike) => { - const isEmpty = Object.values(object).every(x => x === ""); + values.forEach( + (object: { [s: string]: unknown } | ArrayLike) => { + const isEmpty = Object.values(object).every(x => x === ""); - if (!isEmpty) { - newValues.push(object); - } - }); + if (!isEmpty) { + newValues.push(object); + } + }, + ); if (newValues.length) { formData = _.set(formData, configProperty, newValues); diff --git a/app/client/src/sagas/DatasourcesSagas.ts b/app/client/src/sagas/DatasourcesSagas.ts index 094db1272a..4579e3931e 100644 --- a/app/client/src/sagas/DatasourcesSagas.ts +++ b/app/client/src/sagas/DatasourcesSagas.ts @@ -208,14 +208,14 @@ function* createDatasourceFromFormSaga( return _.map(section.children, (subSection: any) => { if ("children" in subSection) { return parseConfig(subSection); - } else { - if (subSection.initialValue) { - _.set( - initialValues, - subSection.configProperty, - subSection.initialValue, - ); - } + } + + if (subSection.initialValue) { + _.set( + initialValues, + subSection.configProperty, + subSection.initialValue, + ); } }); }; @@ -237,7 +237,7 @@ function* createDatasourceFromFormSaga( formConfig = yield select(getPluginForm, actionPayload.payload.pluginId); } - formConfig.map((section: any) => { + formConfig.forEach((section: any) => { parseConfig(section); });