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
Harbor Registry
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
62022323
Commit
62022323
authored
4 years ago
by
Stephanie Briere Americo
Browse files
Options
Downloads
Plain Diff
Merge branch 'issue/42-Detection' into 'development'
Issue
#42
: Detection on user leaving See merge request
!39
parents
bbb819d5
dc07e177
No related branches found
No related tags found
3 merge requests
!58
Version 1.1
,
!54
Issue #53: Fix password info
,
!39
Issue #42: Detection on user leaving
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/fieldsDisplayForm/DisplayForm.js
+23
-19
23 additions, 19 deletions
src/components/fieldsDisplayForm/DisplayForm.js
src/pages/AnswerForm.js
+4
-0
4 additions, 0 deletions
src/pages/AnswerForm.js
with
27 additions
and
19 deletions
src/components/fieldsDisplayForm/DisplayForm.js
+
23
−
19
View file @
62022323
...
...
@@ -17,39 +17,39 @@ import { FormEditionContext } from "../../contexts/FormContext";
import
useForm
from
"
../../contexts/useForm
"
;
import
SubmitButton
from
"
./SubmitButton
"
;
/** CSS styles used on page components */
const
useStyles
=
makeStyles
(
(
theme
)
=>
({
const
useStyles
=
makeStyles
(
theme
=>
({
app
:
{
margin
:
"
0
"
,
padding
:
"
40px
"
,
display
:
"
flex
"
,
[
"
@media (max-width: 600px)
"
]:
{
flexDirection
:
"
column-reverse
"
,
justifyContent
:
"
flex-end
"
,
justifyContent
:
"
flex-end
"
},
paddingBottom
:
"
78px
"
,
[
"
@media (min-width: 600px)
"
]:
{
minHeight
:
"
calc(100vh - 92.4px - 78px -60px)
"
,
minHeight
:
"
calc(100vh - 92.4px - 78px -60px)
"
},
minHeight
:
"
calc(100vh - 71.6px - 78px -60px)
"
,
marginBottom
:
"
60px
"
,
marginBottom
:
"
60px
"
},
addButton
:
{
fontSize
:
"
100%
"
,
fontSize
:
"
100%
"
},
sideMenuFormatingGrid
:
{
[
"
@media (max-width:600px)
"
]:
{
marginTop
:
"
-90px
"
,
}
,
marginTop
:
"
-90px
"
}
},
sizeFormating
:
{
[
"
@media (max-width:600px)
"
]:
{
[
"
@media (max-width:430px)
"
]:
{
marginLeft
:
"
1%
"
,
width
:
"
95%
"
,
width
:
"
95%
"
},
marginLeft
:
"
2%
"
,
}
,
}
,
marginLeft
:
"
2%
"
}
}
}));
/** CSS style used through Material Ui. */
const
theme
=
createMuiTheme
({
...
...
@@ -57,19 +57,19 @@ const theme = createMuiTheme({
MuiInput
:
{
underline
:
{
"
&:before
"
:
{
borderBottom
:
"
1px solid #35c7fc
"
,
borderBottom
:
"
1px solid #35c7fc
"
},
"
&:after
"
:
{
borderBottom
:
"
1px solid #3f51b5
"
,
}
,
}
,
borderBottom
:
"
1px solid #3f51b5
"
}
}
},
MuiButton
:
{
label
:
{
color
:
"
white
"
,
}
,
}
,
}
,
color
:
"
white
"
}
}
}
});
/** Main function that returns the children that composes the form creation or edition page. */
function
DisplayForm
()
{
...
...
@@ -90,6 +90,10 @@ function DisplayForm() {
*/
useEffect
(()
=>
{
setValidToSend
(
verifyError
(
form
));
window
.
onbeforeunload
=
confirmExit
;
function
confirmExit
()
{
return
"
show warning
"
;
}
},
[
form
]);
return
(
<
MuiThemeProvider
theme
=
{
theme
}
>
...
...
This diff is collapsed.
Click to expand it.
src/pages/AnswerForm.js
+
4
−
0
View file @
62022323
...
...
@@ -222,6 +222,10 @@ function AnwserForm() {
/** First thing the page does is getting the form from the API. */
useEffect
(()
=>
{
getForm
(
id
);
window
.
onbeforeunload
=
confirmExit
;
function
confirmExit
()
{
return
"
show warning
"
;
}
},
[]);
return
(
...
...
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