fix: start with data flow Rest api and graphql api in Apis section (#30799)

This commit is contained in:
Aman Agarwal 2024-01-31 22:46:01 +05:30 committed by GitHub
parent d1bf668f7d
commit 13c7af7bfc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View File

@ -89,6 +89,7 @@ function CreateNewAPI({
active,
history,
isCreating,
isOnboardingScreen,
pageId,
showUnsupportedPluginDialog,
}: any) {
@ -114,6 +115,7 @@ function CreateNewAPI({
<NewApiScreen
history={history}
isCreating={isCreating}
isOnboardingScreen={isOnboardingScreen}
location={location}
pageId={pageId}
showSaasAPIs={false}
@ -318,6 +320,7 @@ class CreateNewDatasourceTab extends React.Component<
active={false}
history={history}
isCreating={isCreating}
isOnboardingScreen={!!isOnboardingScreen}
location={location}
pageId={pageId}
showUnsupportedPluginDialog={this.showUnsupportedPluginDialog}

View File

@ -141,6 +141,7 @@ interface ApiHomeScreenProps {
parentEntityType: ActionParentEntityTypeInterface,
apiType: string,
) => void;
isOnboardingScreen?: boolean;
}
type Props = ApiHomeScreenProps;
@ -154,7 +155,14 @@ export const API_ACTION = {
};
function NewApiScreen(props: Props) {
const { history, isCreating, pageId, plugins, showSaasAPIs } = props;
const {
history,
isCreating,
isOnboardingScreen,
pageId,
plugins,
showSaasAPIs,
} = props;
const editorType = useEditorType(location.pathname);
const { editorId, parentEntityId, parentEntityType } =
useParentEntityInfo(editorType);
@ -190,7 +198,8 @@ function NewApiScreen(props: Props) {
props.createNewApiActionBasedOnEditorType(
editorType,
editorId,
parentEntityId,
// Set parentEntityId as (parentEntityId or if it is onboarding screen then set it as pageId) else empty string
parentEntityId || (isOnboardingScreen && pageId) || "",
parentEntityType,
source === API_ACTION.CREATE_NEW_GRAPHQL_API
? PluginPackageName.GRAPHQL