Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
form-creator-ui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simmctic
form-creator
form-creator-ui
Commits
e2a47f5d
Commit
e2a47f5d
authored
5 years ago
by
pdg16
Browse files
Options
Downloads
Patches
Plain Diff
submit form only questions
parent
7ff5d97e
No related branches found
No related tags found
3 merge requests
!58
Version 1.1
,
!54
Issue #53: Fix password info
,
!15
Issue/4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/App.js
+36
-0
36 additions, 0 deletions
src/App.js
with
36 additions
and
0 deletions
src/App.js
+
36
−
0
View file @
e2a47f5d
...
...
@@ -8,6 +8,8 @@ import IconButton from '@material-ui/core/IconButton';
import
ReorderIcon
from
'
@material-ui/icons/Reorder
'
;
import
RadioButtonCheckedIcon
from
'
@material-ui/icons/RadioButtonChecked
'
;
import
CheckBoxOutlineBlankIcon
from
'
@material-ui/icons/CheckBoxOutlineBlank
'
;
import
Button
from
'
@material-ui/core/Button
'
;
import
axios
from
'
axios
'
;
import
FormFieldText
from
'
./components/fieldsCreateForm/FormFieldText
'
;
import
FormFieldSelect
from
'
./components/fieldsCreateForm/FormFieldSelect
'
;
...
...
@@ -15,6 +17,8 @@ import FormFieldRadio from './components/fieldsCreateForm/FormFieldRadio';
import
FormFieldCheckbox
from
'
./components/fieldsCreateForm/FormFieldCheckbox
'
;
import
FormFieldTitle
from
'
./components/fieldsCreateForm/FormFieldTitle
'
;
import
config
from
'
./config
'
;
const
useStyles
=
makeStyles
(
theme
=>
({
menu
:
{
...
...
@@ -101,6 +105,35 @@ function App() {
console
.
log
(
form
);
}
function
createForm
()
{
let
json
=
{
title
:
form
[
0
].
title
,
description
:
form
[
0
].
description
,
inputs
:
[]
}
form
.
forEach
(
function
(
x
,
index
){
if
(
x
.
type
===
"
question
"
)
{
json
.
inputs
.
push
({
"
placement
"
:
index
-
1
,
"
description
"
:
"
Adicionar esse campo no front
"
,
"
question
"
:
x
.
question
,
"
enabled
"
:
x
.
required
,
"
type
"
:
0
,
// question type = 0
"
validation
"
:
[]
});
}
});
console
.
log
(
json
);
axios
.
post
(
`
${
config
.
genformsapi
.
url
}
/form`
,
json
)
.
then
(
res
=>
{
console
.
log
(
res
);
console
.
log
(
res
.
data
);
});
}
return
(
<
div
>
<
Grid
...
...
@@ -139,6 +172,9 @@ function App() {
setDescriptionField
=
{
setDescriptionField
}
/
>
})
}
<
Button
variant
=
"
contained
"
color
=
"
primary
"
onClick
=
{
createForm
}
>
Criar
<
/Button
>
<
/Grid
>
<
Paper
className
=
{
classes
.
menu
}
>
...
...
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