Skip to content

Commit

Permalink
Add the dynamic form html and JSON form structure description #12
Browse files Browse the repository at this point in the history
  • Loading branch information
JetamZ committed Nov 26, 2024
1 parent a13304c commit 3fa22b2
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 0 deletions.
16 changes: 16 additions & 0 deletions WebApp/dynamic_form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dynamic JSON Form</title>
<link rel="stylesheet" href="styles/form.css">
</head>
<body>
<div class="form-wrapper">
<h1>Dynamic JSON Query Form</h1>
<form id="dynamicForm"></form>
</div>
<script src="scripts/dynamic_form_render2.js"></script>
</body>
</html>
112 changes: 112 additions & 0 deletions WebApp/form_structure.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"form": {
"sections": [
{
"id": "targetDatabaseSection",
"title": "Target Database and Description",
"fields": [
{
"id": "targetDatabase",
"label": "Target Database",
"type": "SIMPLE",
"inputType": "text",
"readonly": true
},
{
"id": "description",
"label": "Description",
"type": "SIMPLE",
"inputType": "text",
"readonly": true
}
]
},
{
"id": "stepsSection",
"title": "Steps",
"label": "step",
"type": "REPEATABLE",
"fields": [
{
"id": "goal",
"label": "Goal",
"type": "SIMPLE",
"inputType": "text"
},
{
"id": "columns",
"label": "Columns",
"type": "REPEATABLE",
"placeholder": "Column",
"inputType": "text"
},
{
"id": "aggregation",
"label": "Aggregation",
"type": "COMPLEX",
"subfields": [
{
"id": "group-by",
"label": "Group By",
"type": "REPEATABLE",
"placeholder": "Group By Column",
"inputType": "text"
},
{
"id": "order-by",
"label": "Order By",
"type": "REPEATABLE",
"columns": [
{
"label": "Column",
"inputType": "text"
},
{
"label": "Direction",
"inputType": "select",
"choices": ["ASC", "DESC"]
}
]
}
]
},
{
"id": "filtering",
"label": "Filtering",
"type": "COMPLEX",
"subfields": [
{
"id": "conditions",
"label": "Conditions",
"type": "REPEATABLE",
"columns": [
{
"label": "Column",
"inputType": "text"
},
{
"label": "Operator",
"inputType": "select",
"choices": ["=", "!=", ">", "<", ">=", "<=", "LIKE", "IN"]
},
{
"label": "Value",
"inputType": "text"
}
]
}
]
},
{
"id": "limit",
"label": "Limit",
"type": "SIMPLE",
"inputType": "number",
"placeholder": "Limit"
}
]
}
]
}
}

0 comments on commit 3fa22b2

Please sign in to comment.