Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
laboite
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
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
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
apps.education
laboite
Commits
597ec33a
Commit
597ec33a
authored
2 years ago
by
Luc Bourdot
Browse files
Options
Downloads
Plain Diff
Merge branch 'dev' into 'testing'
Merge Dev into Testing See merge request
!523
parents
d6ca8949
4b99e4fd
No related branches found
Branches containing commit
Tags
release/5.0.0
Tags containing commit
1 merge request
!523
Merge Dev into Testing
Pipeline
#13334
passed
2 years ago
Stage: initial-checks
Stage: deps
Stage: test
Stage: release
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/imports/ui/pages/system/Contact.jsx
+21
-8
21 additions, 8 deletions
app/imports/ui/pages/system/Contact.jsx
with
21 additions
and
8 deletions
app/imports/ui/pages/system/Contact.jsx
+
21
−
8
View file @
597ec33a
import
React
,
{
useState
}
from
'
react
'
;
import
Button
from
'
@material-ui/core/Button
'
;
import
PropTypes
from
'
prop-types
'
;
import
CssBaseline
from
'
@material-ui/core/CssBaseline
'
;
import
TextField
from
'
@material-ui/core/TextField
'
;
import
Grid
from
'
@material-ui/core/Grid
'
;
...
...
@@ -12,9 +13,11 @@ import i18n from 'meteor/universe:i18n';
import
{
useHistory
}
from
'
react-router-dom
'
;
import
validate
from
'
validate.js
'
;
import
FormHelperText
from
'
@material-ui/core/FormHelperText
'
;
import
{
withTracker
}
from
'
meteor/react-meteor-data
'
;
import
CustomSelect
from
'
../../components/admin/CustomSelect
'
;
import
{
structureOptions
}
from
'
../../../api/users/structures
'
;
import
{
mainPagesTracker
,
useFormStateValidator
}
from
'
./SignIn
'
;
import
{
useFormStateValidator
}
from
'
./SignIn
'
;
import
Structures
from
'
../../../api/structures/structures
'
;
import
Spinner
from
'
../../components/system/Spinner
'
;
validate
.
options
=
{
fullMessages
:
false
,
...
...
@@ -84,7 +87,8 @@ const rndmNr1 = Math.floor(Math.random() * 100);
const
rndmNr2
=
Math
.
floor
(
Math
.
random
()
*
10
);
const
totalNr
=
rndmNr1
+
rndmNr2
;
const
Contact
=
()
=>
{
const
Contact
=
({
structures
,
loading
})
=>
{
if
(
loading
)
return
<
Spinner
full
/>;
const
history
=
useHistory
();
const
classes
=
useStyles
();
const
[
formState
,
handleChange
]
=
useFormStateValidator
(
schema
);
...
...
@@ -200,7 +204,7 @@ const Contact = () => {
error
=
{
hasError
(
'
structureSelect
'
)
}
onChange
=
{
handleChange
}
labelWidth
=
{
labelWidth
}
options
=
{
structure
Options
}
options
=
{
structure
s
.
map
((
opt
)
=>
({
value
:
opt
.
name
,
label
:
opt
.
name
}))
}
/>
<
FormHelperText
className
=
{
hasError
(
'
structureSelect
'
)
?
'
Mui-error
'
:
''
}
>
{
hasError
(
'
structureSelect
'
)
}
...
...
@@ -261,8 +265,17 @@ const Contact = () => {
);
};
export
default
mainPagesTracker
(
'
introduction
'
,
Contact
);
Contact
.
defaultProps
=
{
introduction
:
''
,
Contact
.
propTypes
=
{
structures
:
PropTypes
.
arrayOf
(
PropTypes
.
object
).
isRequired
,
loading
:
PropTypes
.
bool
.
isRequired
,
};
export
default
withTracker
(()
=>
{
const
structuresHandle
=
Meteor
.
subscribe
(
'
structures.all
'
);
const
loading
=
!
structuresHandle
.
ready
();
const
structures
=
Structures
.
find
({},
{
sort
:
{
name
:
1
}
}).
fetch
();
return
{
structures
,
loading
,
};
})(
Contact
);
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