-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
189 changed files
with
7,360 additions
and
1,991 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
...ss/integration/Smoke_TestSuite/ClientSideTests/Binding/BindApi_withPageload_Input_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/DisplayWidgets/Modal_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { ReduxActionTypes } from "constants/ReduxActionConstants"; | ||
|
||
export const historyPush = (url: string) => ({ | ||
type: ReduxActionTypes.HISTORY_PUSH, | ||
payload: { | ||
url, | ||
}, | ||
}); | ||
|
||
export const windowRedirect = (url: string) => ({ | ||
type: ReduxActionTypes.REDIRECT_WINDOW_LOCATION, | ||
payload: { | ||
url, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { getAppsmithConfigs } from "configs"; | ||
|
||
const { cloudServicesBaseUrl: BASE_URL } = getAppsmithConfigs(); | ||
|
||
export const authorizeSaasWithAppsmithToken = (appsmithToken: string) => | ||
`${BASE_URL}/api/v1/integrations/oauth/authorize?appsmithToken=${appsmithToken}`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import Api from "./Api"; | ||
import { AxiosPromise } from "axios"; | ||
import { GenericApiResponse } from "api/ApiResponses"; | ||
import { Datasource } from "entities/Datasource"; | ||
|
||
class SaasApi extends Api { | ||
static url = "v1/saas"; | ||
static getAppsmithToken( | ||
datasourceId: string, | ||
pageId: string, | ||
): AxiosPromise<GenericApiResponse<string>> { | ||
return Api.post(`${SaasApi.url}/${datasourceId}/pages/${pageId}/oauth`); | ||
} | ||
|
||
static getAccessToken( | ||
datasourceId: string, | ||
token: string, | ||
): AxiosPromise<GenericApiResponse<Datasource>> { | ||
return Api.post( | ||
`${SaasApi.url}/${datasourceId}/token?appsmithToken=${token}`, | ||
); | ||
} | ||
} | ||
|
||
export default SaasApi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
app/client/src/components/formControls/DynamicInputTextControl.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React from "react"; | ||
import { render, screen } from "test/testUtils"; | ||
import DynamicInputTextControl from "./DynamicInputTextControl"; | ||
import { reduxForm } from "redux-form"; | ||
import { mockCodemirrorRender } from "test/__mocks__/CodeMirrorEditorMock"; | ||
import userEvent from "@testing-library/user-event"; | ||
import { waitFor } from "@testing-library/dom"; | ||
|
||
const TestForm = (props: any) => <div>{props.children}</div>; | ||
|
||
const ReduxFormDecorator = reduxForm({ | ||
form: "TestForm", | ||
initialValues: { actionConfiguration: { testPath: "My test value" } }, | ||
})(TestForm); | ||
|
||
describe("DynamicInputTextControl", () => { | ||
beforeEach(() => { | ||
mockCodemirrorRender(); | ||
}); | ||
it("renders correctly", () => { | ||
render( | ||
<ReduxFormDecorator> | ||
<DynamicInputTextControl | ||
controlType="DYNAMIC_INPUT_TEXT_CONTROL" | ||
actionName="Test action" | ||
formName="TestForm" | ||
label="Action" | ||
configProperty="actionConfiguration.testPath" | ||
onPropertyChange={jest.fn()} | ||
id={"test"} | ||
isValid={true} | ||
dataType={"TABLE"} | ||
placeholderText="Test placeholder" | ||
/> | ||
</ReduxFormDecorator>, | ||
{}, | ||
); | ||
|
||
const input = screen.getAllByText("My test value")[0]; | ||
userEvent.type(input, "New text"); | ||
waitFor(async () => { | ||
await expect(screen.getAllByText("New text")).toHaveLength(2); | ||
await expect(screen.findByText("My test value")).toBeNull(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.