Skip to content

Commit b41c904

Browse files
authored
default grid test issue solve (#41)
1 parent 66508f8 commit b41c904

File tree

12 files changed

+211
-27
lines changed

12 files changed

+211
-27
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1_638711472506933004
1+
1_638719310182018432
22
node_modules

CodeGenerator/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
/bin/
2+
nodemodule
3+
/1_638719310182018432/

CodeGenerator/Properties/launchSettings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"PARAMETER": "{project_id:1,server:localhost,uid:1,username:root,password:,databaseName:dataroom,script:http://localhost/dataroom.sql,statusOfGeneration:,projectName:DataRoomApp,DBexists:Yes,port:3306,rabbitMQConn:https://localhost:5001/v1/api/,redisConn:localhost:6379,password=yourredispassword,apiflowurl:,fronttemplateurl:,Technology_Frontend:reactts,Backend_technology:,buttonClicked:generate,projectType:dnd,swgurl:,noderedurl:}"
77

88

9+
10+
911
},
1012
"remoteDebugEnabled": false
1113
}
1214
}
1315
}
14-
15-

CodeGenerator/ReactTsTemplate1/ReactTsProject/src/Dnd/Dnd Designer/Components/DefaultGridTest.tsx

Lines changed: 203 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11

2-
import React, { useRef, useState, useCallback, useEffect } from "react";
3-
42
import React, { useRef, useState, useCallback, useEffect } from "react";
53
import { Responsive, WidthProvider } from "react-grid-layout";
64
import "react-grid-layout/css/styles.css";
@@ -13,9 +11,19 @@ import {
1311
Typography,
1412
Box,
1513
Grid,
16-
IconButton} from '@mui/material';
14+
// Select,
15+
// MenuItem,
16+
IconButton,
17+
// Tooltip,
18+
// Pagination,
19+
// Toolbar
20+
} from '@mui/material';
1721
import EditIcon from '@mui/icons-material/Edit';
1822
import DeleteIcon from '@mui/icons-material/Delete';
23+
// import VisibilityIcon from '@mui/icons-material/Visibility';
24+
// import { makeStyles } from '@mui/styles';
25+
// import { ChevronRight, ChevronRightSharp, Visibility } from "@mui/icons-material";
26+
// import { config } from "process";
1927
const ResponsiveGridLayout = WidthProvider(Responsive);
2028
// Conversion of DefaultGridTest class component
2129

@@ -54,6 +62,198 @@ export const CustomGridLayoutDynamicV3 = ({
5462
return true;
5563
});
5664

65+
// return (
66+
// <Card
67+
// variant="outlined"
68+
// sx={{
69+
// height: totalHeight,
70+
// display: 'flex',
71+
// flexDirection: 'column'
72+
// }}
73+
// >
74+
// <CardHeader
75+
// title={rowData.checklist_name || 'Item'}
76+
// subheader={rowData.createdAt ? `Created: ${rowData.createdAt}` : ''}
77+
// sx={{
78+
// backgroundColor: '#f5f5f5',
79+
// borderBottom: '1px solid #ccc'
80+
// }}
81+
// />
82+
83+
// <CardContent sx={{ flexGrow: 1, overflowY: 'auto' }}>
84+
// <Grid container spacing={2}>
85+
// {visibleColumns.map((column, index) => {
86+
// // Render the cell content
87+
// const cellContent = column.renderCell
88+
// ? column.renderCell({ row: rowData, field: column.field })
89+
// : rowData[column.field];
90+
91+
// return (
92+
// <Grid item xs={12} sm={6} md={4} key={index}>
93+
// <Box display="flex" flexDirection="column">
94+
// <Typography variant="body2" fontWeight="bold">
95+
// {column.headerName || column.field}
96+
// </Typography>
97+
// <Typography variant="body2">
98+
// {cellContent}
99+
// </Typography>
100+
// </Box>
101+
// </Grid>
102+
// );
103+
// })}
104+
// </Grid>
105+
// </CardContent>
106+
// </Card>
107+
// );
108+
109+
110+
111+
112+
// return (
113+
// <Card
114+
// variant="outlined"
115+
// sx={{
116+
// height: totalHeight,
117+
// display: 'flex',
118+
// flexDirection: 'column'
119+
// }}
120+
// >
121+
// <CardContent sx={{ flexGrow: 1, overflowY: 'auto', p: 2 }}>
122+
123+
// {(() => {
124+
// // Find the 'checklist_name' column for the avatar
125+
// const checklistNameCol = visibleColumns.find(col => col.field === 'checklist_name');
126+
// const createdAtCol = visibleColumns.find(col => col.field === 'createdAt');
127+
128+
// // We assume the next columns after 'checklist_name' can be used for title/snippet
129+
// const otherCols = visibleColumns.filter(col => col.field !== 'checklist_name' && col.field !== 'createdAt');
130+
131+
// // The primary text column could be the first column after checklist_name
132+
// const primaryCol = otherCols[0];
133+
// // The snippet column could be the second column after checklist_name
134+
// const snippetCol = otherCols[1];
135+
136+
// // Render cell for checklist_name
137+
// let avatarContent = checklistNameCol
138+
// ? (checklistNameCol.renderCell
139+
// ? checklistNameCol.renderCell({ row: rowData, field: checklistNameCol.field })
140+
// : rowData[checklistNameCol.field])
141+
// : null;
142+
143+
// // If avatarContent is a string, assume it's a URL and render an img
144+
// const isAvatarUrl = typeof avatarContent === 'string';
145+
146+
// const primaryContent = primaryCol
147+
// ? (primaryCol.renderCell
148+
// ? primaryCol.renderCell({ row: rowData, field: primaryCol.field })
149+
// : rowData[primaryCol.field])
150+
// : null;
151+
152+
// const snippetContent = snippetCol
153+
// ? (snippetCol.renderCell
154+
// ? snippetCol.renderCell({ row: rowData, field: snippetCol.field })
155+
// : rowData[snippetCol.field])
156+
// : null;
157+
158+
// const timeContent = createdAtCol
159+
// ? (createdAtCol.renderCell
160+
// ? createdAtCol.renderCell({ row: rowData, field: createdAtCol.field })
161+
// : rowData[createdAtCol.field])
162+
// : null;
163+
164+
// return (
165+
// <Box display="flex" alignItems="center" justifyContent="space-between">
166+
// {/* Left side - Avatar and text */}
167+
// <Box display="flex" alignItems="center">
168+
// <Box
169+
// sx={{
170+
// width: 40,
171+
// height: 40,
172+
// borderRadius: '50%',
173+
// backgroundColor: '#ccc',
174+
// mr: 2,
175+
// overflow: 'hidden',
176+
// display: 'flex',
177+
// alignItems: 'center',
178+
// justifyContent: 'center'
179+
// }}
180+
// >
181+
// {isAvatarUrl ? (
182+
// <img
183+
// src={avatarContent}
184+
// alt="Avatar"
185+
// style={{ width: '100%', height: 'auto', objectFit: 'cover' }}
186+
// />
187+
// ) : (
188+
// // If not a string URL, just render the content directly (e.g., an icon or element)
189+
// <Box>{avatarContent}</Box>
190+
// )}
191+
// </Box>
192+
193+
// <Box display="flex" flexDirection="column">
194+
// {/* Primary text (e.g., name) */}
195+
// {primaryContent && (
196+
// <Typography variant="body1" fontWeight="bold" sx={{ lineHeight: 1.2 }}>
197+
// {primaryContent}
198+
// </Typography>
199+
// )}
200+
// {/* Snippet text */}
201+
// {snippetContent && (
202+
// <Typography variant="body2" color="text.secondary" sx={{ lineHeight: 1.2 }}>
203+
// {snippetContent}
204+
// </Typography>
205+
// )}
206+
// </Box>
207+
// </Box>
208+
209+
// {/* Right side - Time */}
210+
// {timeContent && (
211+
// <Typography variant="caption" color="text.secondary" sx={{ whiteSpace: 'nowrap', ml: 2 }}>
212+
// {timeContent}
213+
// </Typography>
214+
// )}
215+
// </Box>
216+
// );
217+
// })()}
218+
// </CardContent>
219+
// </Card>
220+
// );
221+
222+
//Working version
223+
224+
// return (
225+
// <Card
226+
// variant="outlined"
227+
// sx={{
228+
// height: totalHeight,
229+
// display: 'flex',
230+
// flexDirection: 'column'
231+
// }}
232+
// >
233+
// <CardContent sx={{ flexGrow: 1, overflowY: 'auto' }}>
234+
// <Grid container spacing={2}>
235+
// {visibleColumns.map((column, index) => {
236+
// const cellContent = column.renderCell
237+
// ? column.renderCell({ row: rowData, field: column.field })
238+
// : rowData[column.field];
239+
240+
// return (
241+
// <Grid item xs={12} sm={6} md={4} key={index}>
242+
// <Box display="flex" flexDirection="column">
243+
// <Typography variant="body2" fontWeight="bold">
244+
// {column.headerName || column.field}
245+
// </Typography>
246+
// <Typography variant="body2">
247+
// {cellContent}
248+
// </Typography>
249+
// </Box>
250+
// </Grid>
251+
// );
252+
// })}
253+
// </Grid>
254+
// </CardContent>
255+
// </Card>
256+
// );
57257

58258
// Dynamic Renderer using chatgpt
59259
return (
@@ -647,8 +847,6 @@ export const CustomGridLayoutDynamicV2 = ({
647847
};
648848
console.log('Filtered Columns',JSON.stringify(filteredColumns, null, 2));
649849
console.log('config',JSON.stringify(filteredColumns, null, 2));
650-
console.log('Filtered Columns',JSON.stringify(filteredColumns, null, 2));
651-
console.log('config',JSON.stringify(filteredColumns, null, 2));
652850
const totalHeight = calculateTotalHeight(layoutItems, 30); // Assuming rowHeight is 30
653851

654852
return (
@@ -831,7 +1029,3 @@ function useStyles() {
8311029
throw new Error("Function not implemented.");
8321030
}
8331031

834-
function useStyles() {
835-
throw new Error("Function not implemented.");
836-
}
837-

CodeGenerator/obj/Debug/netcoreapp6.0/NoCodeAppGenerator.AssemblyInfo.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@
1313
[assembly: System.Reflection.AssemblyCompanyAttribute("NoCodeAppGenerator")]
1414
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
1515
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
16-
<<<<<<< HEAD
17-
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+ec01993054c462e2f8aa65d06cf38b3cabbf5732")]
18-
=======
19-
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+0fb054cb0f57be35417ba1d90f22b05a7c9d01ea")]
20-
>>>>>>> 3c3177e15f345a0905c86266fab3ec1465d97f92
16+
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+66508f8fee74b2404c0c0b9998b844b43939a5b0")]
2117
[assembly: System.Reflection.AssemblyProductAttribute("NoCodeAppGenerator")]
2218
[assembly: System.Reflection.AssemblyTitleAttribute("NoCodeAppGenerator")]
2319
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
<<<<<<< HEAD
2-
88b489df65c4a532f04b789c075d03214e7209a9dcc9fd24abc2788bd5931182
3-
=======
4-
4d8a7227a6d6ef0e5af34f7b441628da094735266c311e91664f263559015d96
5-
>>>>>>> 3c3177e15f345a0905c86266fab3ec1465d97f92
1+
112122aab116b2d145a3fac011411b8bae95f964b35d2b7dc5b496d0c5593526
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
<<<<<<< HEAD
2-
{"documents":{"C:\\Projects\\Final project\\NeoApps.AI-CodeGenerator\\*":"https://raw.githubusercontent.com/Keval545/NeoApps.AI-CodeGenerator/ec01993054c462e2f8aa65d06cf38b3cabbf5732/*"}}
3-
=======
4-
{"documents":{"C:\\Projects\\Final project\\NeoApps.AI-CodeGenerator\\*":"https://raw.githubusercontent.com/Neopric-Inc/NeoApps.AI-CodeGenerator/0fb054cb0f57be35417ba1d90f22b05a7c9d01ea/*"}}
5-
>>>>>>> 3c3177e15f345a0905c86266fab3ec1465d97f92
1+
{"documents":{"C:\\Projects\\Final project\\NeoApps.AI-CodeGenerator\\*":"https://raw.githubusercontent.com/Keval545/NeoApps.AI-CodeGenerator/66508f8fee74b2404c0c0b9998b844b43939a5b0/*"}}
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)