mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-21 13:37:28 +00:00
support to build modules with prompt
This commit is contained in:
parent
35f2c474fd
commit
8866b23a4d
7 changed files with 27 additions and 10 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit 8b0a7bfa73f281d8fbe100324ef3fd1578fd0b36
|
||||
Subproject commit 4becfb8ea76e119bfb5c5668362d5fff43755981
|
||||
|
|
@ -173,7 +173,17 @@ export const BaseLeftSidebar = ({
|
|||
|
||||
const renderLeftSidebarItems = () => {
|
||||
if (isModuleEditor) {
|
||||
return renderCommonItems();
|
||||
return (
|
||||
<>
|
||||
{renderAISideBarTrigger({
|
||||
darkMode,
|
||||
setSideBarBtnRefs,
|
||||
selectedSidebarItem,
|
||||
handleSelectedSidebarItem,
|
||||
})}
|
||||
{renderCommonItems()}
|
||||
</>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<>
|
||||
|
|
|
|||
|
|
@ -395,16 +395,11 @@ const useAppData = (
|
|||
moduleId
|
||||
);
|
||||
|
||||
if (
|
||||
!moduleMode &&
|
||||
state?.prompt &&
|
||||
!promptSentRef.current &&
|
||||
(conversation?.aiConversationMessages || []).length === 0
|
||||
) {
|
||||
if (state?.prompt && !promptSentRef.current && (conversation?.aiConversationMessages || []).length === 0) {
|
||||
promptSentRef.current = true;
|
||||
setSelectedSidebarItem('tooljetai');
|
||||
toggleLeftSidebar(true);
|
||||
sendMessage(state.prompt);
|
||||
sendMessage(state.prompt, {}, {}, moduleId);
|
||||
setIsQueryPaneExpanded(false);
|
||||
// Clear prompt from navigation state so it doesn't re-trigger on page refresh
|
||||
const { prompt: _prompt, ...restUsrState } = window.history.state?.usr || {};
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ import {
|
|||
AppTypeTab,
|
||||
} from '@/modules/dashboard/components';
|
||||
import CreateAppWithPrompt from '@/modules/AiBuilder/components/CreateAppWithPrompt';
|
||||
import CreateModuleWithPrompt from '@/modules/AiBuilder/components/CreateModuleWithPrompt';
|
||||
import SolidIcon from '@/_ui/Icon/SolidIcons';
|
||||
import { isWorkflowsFeatureEnabled } from '@/modules/common/helpers/utils';
|
||||
import EmptyModuleSvg from '../../assets/images/icons/empty-modules.svg';
|
||||
|
|
@ -1862,6 +1863,8 @@ class HomePageComponent extends React.Component {
|
|||
<CreateAppWithPrompt createApp={this.createApp} />
|
||||
)}
|
||||
|
||||
{this.props.appType === 'module' && this.canCreateApp() && <CreateModuleWithPrompt />}
|
||||
|
||||
{(meta?.total_count > 0 || appSearchKey) && (
|
||||
<>
|
||||
{!(isLoading && !appSearchKey) && (
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
import React from 'react';
|
||||
import { withEditionSpecificComponent } from '@/modules/common/helpers/withEditionSpecificComponent';
|
||||
|
||||
const CreateModuleWithPrompt = () => {
|
||||
return <></>;
|
||||
};
|
||||
|
||||
export default withEditionSpecificComponent(CreateModuleWithPrompt, 'AiBuilder');
|
||||
|
|
@ -0,0 +1 @@
|
|||
export { default } from './CreateModuleWithPrompt';
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit e3a079650c47564f82e9cc7ee26473f29ff06f20
|
||||
Subproject commit 909d05c7459f8c239c30d2b7522b2226cf1788cf
|
||||
Loading…
Reference in a new issue