Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kacprzak, Izabella
DRP-InAGlobe-Platform
Commits
7f771fae
Commit
7f771fae
authored
Jun 17, 2021
by
ras19
Browse files
Made edit project form pre filled in [RS]
parent
73544b24
Pipeline
#203927
passed with stage
in 51 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
frontend/src/EditProject.js
View file @
7f771fae
...
...
@@ -9,19 +9,9 @@ const EditProject = () => {
const
{
data
:
{
name
,
description
,
status
,
location
,
tag
,
files
},
error
,
isPending
}
=
useFetch
(
"
/projects/
"
+
id
)
const
[
selectUsernames
,
setSelectUsernames
]
=
useState
([]);
const
{
data
:
users
,
errorUsers
,
isPendingUsers
}
=
useFetch
(
"
/users/user_project
"
);
const
usernames
=
users
.
map
(
user
=>
user
.
username
);
const
history
=
useHistory
();
// Trying to pre fill some data
const
oldProjectDetails
=
{
name
:
"
Example project
"
,
description
:
"
This is an example description
"
,
status
:
"
Available
"
,
location
:
"
United Kingdom
"
,
tag
:
"
Social
"
,
files
:
"
https://www.google.com
"
}
const
{
register
,
handleSubmit
}
=
useForm
();
const
handleChange
=
(
e
)
=>
{
...
...
frontend/src/EditUser.js
View file @
7f771fae
...
...
@@ -46,64 +46,77 @@ const EditUser = () => {
<
label
htmlFor
=
"
firstname
"
>
Firstname
<
/label
>
<
input
{...
register
(
"
firstname
"
)}
placeholder
=
"
Input your first name here
"
defaultValue
=
{
firstname
}
/
>
<
label
htmlFor
=
"
surname
"
>
Surname
<
/label
>
<
input
{...
register
(
"
surname
"
)}
placeholder
=
"
Input surname here
"
defaultValue
=
{
surname
}
/
>
<
label
htmlFor
=
"
title
"
>
Title
<
/label
>
<
input
{...
register
(
"
title
"
)}
placeholder
=
"
State your role at InAGlobe (eg: volunteer)
"
defaultValue
=
{
title
}
/
>
<
label
htmlFor
=
"
password
"
>
Password
<
/label
>
<
label
htmlFor
=
"
password
"
>
Password
(
click
link
above
to
change
password
)
<
/label
>
<
input
{...
register
(
"
password
"
)}
disabled
placeholder
=
"
Input the password
"
defaultValue
=
{
password
}
/
>
<
label
htmlFor
=
"
email
"
>
Email
<
/label
>
<
input
{...
register
(
"
email
"
)}
placeholder
=
"
Input InAGlobe email here
"
defaultValue
=
{
email
}
/
>
<
label
htmlFor
=
"
phone_no
"
>
Phone
number
<
/label
>
<
input
{...
register
(
"
phone_no
"
)}
placeholder
=
"
Input phone number here
"
defaultValue
=
{
phone_no
}
/
>
<
label
htmlFor
=
"
bio
"
>
Bio
<
/label
>
<
input
{...
register
(
"
bio
"
)}
placeholder
=
"
Tell your colleagues a bit about yourself
"
defaultValue
=
{
bio
}
/
>
{
/* Think about changing type to force date */
}
<
label
htmlFor
=
"
joined
"
>
Joined
<
/label
>
<
input
{...
register
(
"
joined
"
)}
placeholder
=
"
Eg: 20th April 2020
"
type
=
"
date
"
defaultValue
=
{
joined
}
/
>
<
label
htmlFor
=
"
location
"
>
Location
<
/label
>
<
input
{...
register
(
"
location
"
)}
placeholder
=
"
Where are you currently based?
"
defaultValue
=
{
location
}
/
>
<
label
htmlFor
=
"
availability
"
>
Availibility
<
/label
>
<
label
htmlFor
=
"
availability
"
>
Availibility
(
hours
per
week
)
<
/label
>
<
input
{...
register
(
"
availability
"
)}
placeholder
=
"
How available are you approximately per week?
"
/>
<
label
htmlFor
=
"
partnership_opportunities
"
>
Partnership
Opportunities
<
/label
>
<
input
{...
register
(
"
partnership_opportunities
"
)}
placeholder
=
"
Eg: Department of Computing at Imperial College London
"
defaultValue
=
{
availability
}
/
>
<
label
htmlFor
=
"
interests
"
>
Interests
<
/label
>
<
input
{...
register
(
"
interests
"
)}
placeholder
=
"
What are your hobbies?
"
defaultValue
=
{
interests
}
/
>
<
label
htmlFor
=
"
partnership_opportunities
"
>
Partnership
Opportunities
<
/label
>
<
input
{...
register
(
"
partnership_opportunities
"
)}
placeholder
=
"
Eg: Department of Computing at Imperial College London
"
defaultValue
=
{
partnership_opportunities
}
/
>
<
button
type
=
"
submit
"
>
Save
user
details
<
/button
>
<
/form>
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment