-
Notifications
You must be signed in to change notification settings - Fork 4.5k
chore: Updating styles and adding docs link for REST API plugin for better UI/UX #37941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
d09966f
fixing the switch UI for JS objects function popover & updating query…
ankitakinger ff52c5f
updating the schema tab to datasource tab
ankitakinger 1ddf9ca
adding background to query status bar in response pane to avoid text …
ankitakinger cb3688f
updating locators
ankitakinger 12bc4fc
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
ankitakinger 0baa8af
removing the edit datasource button for saved APIs next to the URL
ankitakinger a6f06fd
adding the datasource selector and datasource tab for APIs
ankitakinger 059cd8f
Migration to add documentation link to rest api plugin
trishaanand aeebee2
Merge branch 'chore/actions-redesign-fixes' of github.com:appsmithorg…
trishaanand 5c0d7cb
hiding the edit config icon button when schema is loading
ankitakinger 9b15718
Merge branch 'chore/actions-redesign-fixes' of https://github.com/app…
ankitakinger 077835c
updating icon
ankitakinger cd89c1f
adding no access state for datasource tab
ankitakinger e2f4937
addressing review comments
ankitakinger 3ac69bf
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
ankitakinger adc124b
Merge branch 'release' into chore/actions-redesign-fixes
hetunandu b295ed9
fixing tests
ankitakinger 1b0c9db
Merge branch 'release' of https://github.com/appsmithorg/appsmith int…
ankitakinger 925369c
fixing unit test
ankitakinger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
10 changes: 10 additions & 0 deletions
10
...lient/packages/design-system/ads/src/__assets__/icons/ads/datasource-config.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 hidden or 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
File renamed without changes.
File renamed without changes.
This file contains hidden or 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
69 changes: 69 additions & 0 deletions
69
...nActionEditor/components/PluginActionResponse/components/DatasourceTab/DatasourceInfo.tsx
This file contains hidden or 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,69 @@ | ||
| import React from "react"; | ||
| import { Button, Flex, Tooltip } from "@appsmith/ads"; | ||
| import DatasourceSelector from "./DatasourceSelector"; | ||
| import { createMessage, EDIT_DS_CONFIG } from "ee/constants/messages"; | ||
| import { DatasourceEditEntryPoints } from "constants/Datasource"; | ||
| import AnalyticsUtil from "ee/utils/AnalyticsUtil"; | ||
| import { datasourcesEditorIdURL } from "ee/RouteBuilder"; | ||
| import { omit } from "lodash"; | ||
| import { getQueryParams } from "utils/URLUtils"; | ||
| import history from "utils/history"; | ||
| import { useEditorType } from "ee/hooks"; | ||
| import { useParentEntityInfo } from "ee/hooks/datasourceEditorHooks"; | ||
|
|
||
| interface Props { | ||
| datasourceId: string; | ||
| datasourceName: string; | ||
| showEditButton: boolean; | ||
| } | ||
|
|
||
| const DatasourceInfo = ({ | ||
| datasourceId, | ||
| datasourceName, | ||
| showEditButton, | ||
| }: Props) => { | ||
| const editorType = useEditorType(location.pathname); | ||
| const { parentEntityId } = useParentEntityInfo(editorType); | ||
|
|
||
| // eslint-disable-next-line react-perf/jsx-no-new-function-as-prop | ||
| const editDatasource = () => { | ||
| const entryPoint = DatasourceEditEntryPoints.QUERY_EDITOR_DATASOURCE_SCHEMA; | ||
|
|
||
| AnalyticsUtil.logEvent("EDIT_DATASOURCE_CLICK", { | ||
| datasourceId: datasourceId, | ||
| pluginName: "", | ||
| entryPoint: entryPoint, | ||
| }); | ||
|
|
||
| const url = datasourcesEditorIdURL({ | ||
| baseParentEntityId: parentEntityId, | ||
| datasourceId: datasourceId, | ||
| params: { ...omit(getQueryParams(), "viewMode"), viewMode: false }, | ||
| generateEditorPath: true, | ||
| }); | ||
|
|
||
| history.push(url); | ||
| }; | ||
|
|
||
| return ( | ||
| <Flex alignItems={"center"} gap="spaces-2"> | ||
| <DatasourceSelector | ||
| datasourceId={datasourceId} | ||
| datasourceName={datasourceName} | ||
| /> | ||
| {showEditButton && ( | ||
| <Tooltip content={createMessage(EDIT_DS_CONFIG)} placement="top"> | ||
| <Button | ||
| isIconButton | ||
| kind="tertiary" | ||
| onClick={editDatasource} | ||
| size="sm" | ||
| startIcon="datasource-config" | ||
| /> | ||
| </Tooltip> | ||
| )} | ||
| </Flex> | ||
| ); | ||
| }; | ||
|
|
||
| export default DatasourceInfo; |
13 changes: 13 additions & 0 deletions
13
...luginActionResponse/components/DatasourceTab/DatasourceSelector/ApiDatasourceSelector.tsx
This file contains hidden or 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,13 @@ | ||
| import { API_EDITOR_FORM_NAME } from "ee/constants/forms"; | ||
| import { type Action } from "entities/Action"; | ||
| import { reduxForm } from "redux-form"; | ||
| import { | ||
| PluginDatasourceSelector, | ||
| type CustomProps, | ||
| } from "./PluginDatasourceSelector"; | ||
|
|
||
| export default reduxForm<Action, CustomProps>({ | ||
| form: API_EDITOR_FORM_NAME, | ||
| destroyOnUnmount: false, | ||
| enableReinitialize: true, | ||
| })(PluginDatasourceSelector); |
This file contains hidden or 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
13 changes: 13 additions & 0 deletions
13
...ginActionResponse/components/DatasourceTab/DatasourceSelector/QueryDatasourceSelector.tsx
This file contains hidden or 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,13 @@ | ||
| import { QUERY_EDITOR_FORM_NAME } from "ee/constants/forms"; | ||
| import { type Action } from "entities/Action"; | ||
| import { reduxForm } from "redux-form"; | ||
| import { | ||
| PluginDatasourceSelector, | ||
| type CustomProps, | ||
| } from "./PluginDatasourceSelector"; | ||
|
|
||
| export default reduxForm<Action, CustomProps>({ | ||
| form: QUERY_EDITOR_FORM_NAME, | ||
| destroyOnUnmount: false, | ||
| enableReinitialize: true, | ||
| })(PluginDatasourceSelector); |
31 changes: 31 additions & 0 deletions
31
...tor/components/PluginActionResponse/components/DatasourceTab/DatasourceSelector/index.tsx
This file contains hidden or 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,31 @@ | ||
| import React from "react"; | ||
| import { UIComponentTypes } from "api/PluginApi"; | ||
| import { usePluginActionContext } from "PluginActionEditor/PluginActionContext"; | ||
| import ApiDatasourceSelector from "./ApiDatasourceSelector"; | ||
| import QueryDatasourceSelector from "./QueryDatasourceSelector"; | ||
| import { | ||
| API_EDITOR_FORM_NAME, | ||
| QUERY_EDITOR_FORM_NAME, | ||
| } from "ee/constants/forms"; | ||
|
|
||
| const API_FORM_COMPONENTS = [ | ||
| UIComponentTypes.ApiEditorForm, | ||
| UIComponentTypes.GraphQLEditorForm, | ||
| ]; | ||
|
|
||
| export interface DatasourceProps { | ||
| datasourceId: string; | ||
| datasourceName: string; | ||
| } | ||
|
|
||
| const DatasourceSelector = (props: DatasourceProps) => { | ||
| const { plugin } = usePluginActionContext(); | ||
|
|
||
| return API_FORM_COMPONENTS.includes(plugin.uiComponent) ? ( | ||
| <ApiDatasourceSelector {...props} formName={API_EDITOR_FORM_NAME} /> | ||
| ) : ( | ||
| <QueryDatasourceSelector {...props} formName={QUERY_EDITOR_FORM_NAME} /> | ||
| ); | ||
| }; | ||
|
|
||
| export default DatasourceSelector; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.