Skip to content

Commit 6742daa

Browse files
committed
correct placement of loader and add env file to appropriate collection
1 parent 4f66fac commit 6742daa

File tree

7 files changed

+28
-34
lines changed

7 files changed

+28
-34
lines changed

src/components/atoms/sidebar/environments/EnvOptionsMenu.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { EllipsisVerticalIcon } from '@heroicons/react/20/solid';
66
import { DirectoryOptionsActions } from 'constants/WorkspaceDirectory';
77

88
// ToDo: Combine this component with OptionsMenu in sidebar atoms to make it generic
9-
const EnvOptionsMenu = ({ pathName, itemType }) => {
9+
const EnvOptionsMenu = ({ pathName, itemType, collectionId }) => {
1010
const menuItemsStyles =
1111
'group flex w-full items-center rounded px-2 py-2 text-sm text-gray-900 transition duration-200 ease-out hover:bg-slate-100';
1212
return (
@@ -43,6 +43,7 @@ const EnvOptionsMenu = ({ pathName, itemType }) => {
4343
data-click-from='env-options-menu'
4444
data-options-menu-item={DirectoryOptionsActions.addNewEnvironment.value}
4545
data-path-name={pathName}
46+
data-collection-id={collectionId}
4647
>
4748
<PencilSquareIcon
4849
className='w-4 h-4 mr-2'

src/components/molecules/flow/index.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import DelayNode from './nodes/DelayNode';
2020
import AuthNode from './nodes/AuthNode';
2121
import FlowNode from 'components/atoms/flow/FlowNode';
2222
import useCanvasStore from 'stores/CanvasStore';
23-
import useCommonStore from 'stores/CommonStore';
2423

2524
const StartNode = () => (
2625
<FlowNode title='Start' handleLeft={false} handleRight={true} handleRightData={{ type: 'source' }}></FlowNode>
@@ -101,7 +100,6 @@ const selector = (state) => ({
101100
});
102101

103102
const Flow = ({ collectionId }) => {
104-
const setShowLoader = useCommonStore((state) => state.setShowLoader);
105103
const { nodes, edges, onNodesChange, onEdgesChange, onConnect, setNodes, setEdges, setLogs } =
106104
useCanvasStore(selector);
107105
//console.log(nodes);
@@ -240,8 +238,6 @@ const Flow = ({ collectionId }) => {
240238
<Controls>
241239
<ControlButton
242240
onClick={() => {
243-
console.log(`\n \n \n ControlButton has been clicked \n \n \n`);
244-
setShowLoader(true);
245241
runnableEdges(true);
246242
const g = new Graph(
247243
cloneDeep(reactFlowInstance.getNodes()),
@@ -250,8 +246,6 @@ const Flow = ({ collectionId }) => {
250246
onGraphComplete,
251247
);
252248
g.run();
253-
console.log(`\n \n \n ControlButton has been clicked END \n \n \n`);
254-
setShowLoader(false);
255249
}}
256250
title='run'
257251
>

src/components/molecules/footers/MainFooter.js

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,38 @@ const MainFooter = () => {
2020
<ArrowLeftEndOnRectangleIcon className='w-6 h-6 swap-off' />
2121
</label>
2222
<div className='flex items-center justify-between gap-4'>
23-
<Tippy content='External link: github.com' placement='top'>
24-
<a href='#' target='_blank' className='link' rel='noreferrer'>
25-
Github
23+
<Tippy content='Github' placement='top'>
24+
<a href='https://github.com/FlowTestAI/FlowTest' target='_blank' rel='noreferrer' className='link'>
25+
<b>Github</b>
2626
</a>
2727
</Tippy>
2828

29-
<Tippy content='External link: github discussions' placement='top'>
30-
<a href='#' className='link'>
31-
Contact us
29+
<Tippy content='Contact Us' placement='top'>
30+
<a
31+
href='https://github.com/FlowTestAI/FlowTest/discussions'
32+
target='_blank'
33+
rel='noreferrer'
34+
className='link'
35+
>
36+
<b>Contact us</b>
3237
</a>
3338
</Tippy>
3439

35-
<Tippy content='External link' placement='top'>
36-
<a href='#' className='link'>
37-
Discord
40+
<Tippy content='Discord' placement='top'>
41+
<a href='https://discord.gg/Pf9tdSjPeF' target='_blank' rel='noreferrer' className='link'>
42+
<b>Discord</b>
3843
</a>
3944
</Tippy>
4045

4146
<Tippy content='Coming Soon' placement='top'>
4247
<a href='#' className='link'>
43-
Docs
48+
<b>Docs</b>
4449
</a>
4550
</Tippy>
4651

47-
<Tippy content='External link: github repo' placement='top'>
48-
<a href='https://github.com/FlowTestAI/FlowTest' className='link'>
49-
About
52+
<Tippy content='About' placement='top'>
53+
<a href='https://github.com/FlowTestAI/FlowTest' target='_blank' rel='noreferrer' className='link'>
54+
<b>About</b>
5055
</a>
5156
</Tippy>
5257
</div>

src/components/molecules/headers/TabPanelHeader.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ const TabPanelHeader = () => {
7878
className='drawer-overlay'
7979
></label>
8080
<ul className='min-h-full p-4 menu w-80 bg-base-200 text-base-content'>
81-
{console.log(`\n \n \n ======================>`)}
82-
{console.log(graphRunLogs)}
83-
{console.log(`\n \n \n ======================>`)}
8481
{graphRunLogs.map((item, index) => (
8582
<li key={index}>
8683
<a>{item}</a>
@@ -92,16 +89,6 @@ const TabPanelHeader = () => {
9289
) : (
9390
<></>
9491
)}
95-
<button>
96-
<Tippy content='Import - Coming Soon!' placement='top'>
97-
<DocumentArrowDownIcon className='w-5 h-5 fill-neutral-200 text-neutral-400' />
98-
</Tippy>
99-
</button>
100-
<button>
101-
<Tippy content='Export - Coming Soon!' placement='top'>
102-
<DocumentArrowUpIcon className='w-5 h-5 fill-neutral-200 text-neutral-400' />
103-
</Tippy>
104-
</button>
10592
</div>
10693
{focusTab.type === OBJ_TYPES.flowtest && (
10794
<div className='pl-4 border-l gen_ai_button border-neutral-300'>

src/components/molecules/modals/GenerateFlowTestModal.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ import { init } from '../flow';
1010
import useCanvasStore from 'stores/CanvasStore';
1111
import { toast } from 'react-toastify';
1212
import { isEqual } from 'lodash';
13+
import useCommonStore from 'stores/CommonStore';
1314

1415
const GenerateFlowTestModal = ({ closeFn = () => null, open = false, collectionId }) => {
16+
const setShowLoader = useCommonStore((state) => state.setShowLoader);
1517
const setNodes = useCanvasStore((state) => state.setNodes);
1618
const setEdges = useCanvasStore((state) => state.setEdges);
1719

@@ -116,8 +118,10 @@ const GenerateFlowTestModal = ({ closeFn = () => null, open = false, collectionI
116118
} else if (selectedModel === null) {
117119
toast.info('Please select a model');
118120
} else {
121+
setShowLoader(true);
119122
generateFlowData(textareaValue, selectedModel, collectionId)
120123
.then((flowData) => {
124+
setShowLoader(false);
121125
if (isEqual(flowData.nodes, [])) {
122126
toast.info(`${selectedModel} was not able to evaluate the instructions properly`);
123127
} else {
@@ -128,6 +132,7 @@ const GenerateFlowTestModal = ({ closeFn = () => null, open = false, collectionI
128132
closeFn();
129133
})
130134
.catch((error) => {
135+
setShowLoader(false);
131136
console.log(error);
132137
toast.error(`Error while generating flow data`);
133138
closeFn();

src/components/molecules/sidebar/content/Environment.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const Environment = ({ collectionId, collection }) => {
4343
data-click-from='env-options-menu'
4444
itemType={OBJ_TYPES.environment}
4545
pathName={collection.pathname}
46+
collectionId={collectionId}
4647
/>
4748
</div>
4849
{collection.envCollapsed === false && (

src/components/molecules/sidebar/content/Environments.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ const Environments = ({ collections }) => {
2121
// const itemType = clickFromElementDataSet?.itemType;
2222
const optionsMenuItem = clickFromElementDataSet?.optionsMenuItem;
2323
const pathName = clickFromElementDataSet?.pathName;
24+
const collectionId = clickFromElementDataSet?.collectionId;
2425

2526
setSelectedPathName(pathName);
26-
setSelectedCollectionId(collections[0].id);
27+
setSelectedCollectionId(collectionId);
2728
setSelectedMenuItem(optionsMenuItem);
2829

2930
switch (optionsMenuItem) {

0 commit comments

Comments
 (0)