Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Transformerlab App
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
TransformerLab
Transformerlab App
Commits
3fd429a1
Commit
3fd429a1
authored
3 weeks ago
by
deep1401
Browse files
Options
Downloads
Patches
Plain Diff
Remove redundant code
parent
881822fa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/renderer/components/Experiment/DynamicPluginForm.tsx
+0
-147
0 additions, 147 deletions
src/renderer/components/Experiment/DynamicPluginForm.tsx
with
0 additions
and
147 deletions
src/renderer/components/Experiment/DynamicPluginForm.tsx
+
0
−
147
View file @
3fd429a1
...
@@ -461,153 +461,6 @@ function CustomAutocompleteWidget<T = any, S extends StrictRJSFSchema = RJSFSche
...
@@ -461,153 +461,6 @@ function CustomAutocompleteWidget<T = any, S extends StrictRJSFSchema = RJSFSche
);
);
}
}
// type EvaluationField = {
// name: string;
// expression: string;
// return_type: 'boolean' | 'number';
// };
// const CustomEvaluationWidget = (props: WidgetProps<any>) => {
// const { id, value, onChange, disabled, readonly } = props;
// const valueSent = value;
// console.log("Value", valueSent);
// const parseValue = (val: any): EvaluationField[] => {
// if (Array.isArray(val)) {
// if (val.every(item => typeof item === "string")) {
// // If every element is a string: join them and parse the result.
// try {
// const joined = val.join(',');
// console.log("Joined", joined);
// console.log("TYPE", typeof joined);
// const parsed = JSON.parse(joined);
// console.log("PARSED HERE", parsed);
// return Array.isArray(parsed) ? parsed : [];
// } catch (err) {
// console.error("Error parsing evaluation widget value:", err);
// return [];
// }
// } else {
// // If not all elements are strings, assume it's already an array of EvaluationField.
// return val;
// }
// } else if (typeof val === "string") {
// try {
// return JSON.parse(val);
// } catch (err) {
// console.error("Error parsing evaluation widget value string:", err);
// return [];
// }
// }
// return [];
// };
// // const parsed = parseValue(value);
// // Initialize state by parsing the incoming value
// const [evalMetrics, setEvalMetrics] = React.useState<EvaluationField[]>(parseValue(valueSent));
// // Update state if a new default value is provided
// React.useEffect(() => {
// const parsed = parseValue(valueSent);
// if (JSON.stringify(parsed) !== JSON.stringify(evalMetrics)) {
// setEvalMetrics(parsed);
// }
// }, [value]);
// // Propagate state changes upstream.
// React.useEffect(() => {
// onChange(evalMetrics);
// }, [evalMetrics]);
// const handleAddField = () => {
// setEvalMetrics([
// ...evalMetrics,
// { name: '', expression: '', return_type: 'boolean' }
// ]);
// };
// const handleFieldChange = (
// index: number,
// field: keyof EvaluationField,
// newValue: string
// ) => {
// const updated = evalMetrics.map((evaluation, i) =>
// i === index ? { ...evaluation, [field]: newValue } : evaluation
// );
// setEvalMetrics(updated);
// };
// const handleRemoveField = (index: number) => {
// const updated = evalMetrics.filter((_, i) => i !== index);
// setEvalMetrics(updated);
// };
// return (
// <div id={id}>
// {evalMetrics.map((evaluation, index) => (
// <div
// key={index}
// style={{
// marginBottom: '1rem',
// border: '1px solid #ccc',
// padding: '0.5rem'
// }}
// >
// <Input
// placeholder="Evaluation Name"
// value={evaluation.name}
// onChange={(e) =>
// handleFieldChange(index, 'name', e.target.value)
// }
// disabled={disabled || readonly}
// style={{ marginBottom: '0.5rem' }}
// />
// <Textarea
// placeholder="Regular Expression"
// value={evaluation.expression}
// onChange={(e) =>
// handleFieldChange(index, 'expression', e.target.value)
// }
// disabled={disabled || readonly}
// style={{ marginBottom: '0.5rem' }}
// />
// <Select
// placeholder="Output Type"
// value={evaluation.return_type}
// onChange={(e, newValue) =>
// handleFieldChange(index, 'return_type', newValue as string)
// }
// disabled={disabled || readonly}
// style={{ marginBottom: '0.5rem' }}
// >
// <Option value="boolean">Boolean</Option>
// <Option value="number">Number</Option>
// </Select>
// <Button
// onClick={() => handleRemoveField(index)}
// disabled={disabled || readonly}
// size="sm"
// variant="outlined"
// >
// Remove Field
// </Button>
// </div>
// ))}
// <Button
// onClick={handleAddField}
// disabled={disabled || readonly}
// variant="solid"
// >
// Add Field
// </Button>
// {/* Hidden input to capture the JSON result on form submission */}
// <input type="hidden" id={id} name={id} value={JSON.stringify(evalMetrics)} />
// </div>
// );
// };
function
CustomFieldTemplate
(
props
:
FieldTemplateProps
)
{
function
CustomFieldTemplate
(
props
:
FieldTemplateProps
)
{
const
{
const
{
id
,
id
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment