fix more issues

This commit is contained in:
Aarushi
2024-07-11 18:40:13 +01:00
parent 76cfeef789
commit 5969d4444d
2 changed files with 20 additions and 13 deletions

View File

@@ -3,20 +3,17 @@ dotenv.config();
const nextConfig = {
output: 'export',
// Optional: Change links `/me` -> `/me/` and emit `/me.html` -> `/me/index.html`
// trailingSlash: true,
// Optional: Prevent automatic `/me` -> `/me/`, instead preserve `href`
// skipTrailingSlashRedirect: true,
// Optional: Change the output directory `out` -> `dist`
// distDir: 'dist',
}
module.exports = {
env: {
AGPT_SERVER_URL: process.env.AGPT_SERVER_URL,
},
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
};
module.exports = {
nextConfig,
};

View File

@@ -102,6 +102,16 @@ const CustomNode: FC<NodeProps<CustomNodeData>> = ({ data, id }) => {
setErrors((prevErrors) => ({ ...prevErrors, [key]: null }));
};
const getSelectValue = (value: any): string => {
if (typeof value === 'string') return value;
if (typeof value === 'number') return value.toString();
if (Array.isArray(value)) return value.join(',');
if (typeof value === 'object' && value !== null) {
return JSON.stringify(value);
}
return '';
};
const getValue = (key: string) => {
const keys = key.split('.');
return keys.reduce((acc, k) => (acc && acc[k] !== undefined) ? acc[k] : '', data.hardcodedValues);
@@ -288,7 +298,7 @@ const CustomNode: FC<NodeProps<CustomNodeData>> = ({ data, id }) => {
return schema.enum ? (
<div key={fullKey} className="input-container">
<select
value={value || ''}
value={getSelectValue(value)}
onChange={(e) => handleInputChange(fullKey, e.target.value)}
className="select-input"
>