Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RPG
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
Model registry
Operate
Environments
Terraform modules
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
julien.debray
RPG
Commits
0bd467e8
Commit
0bd467e8
authored
2 years ago
by
julien.debray
Browse files
Options
Downloads
Patches
Plain Diff
Reglage détails
parent
1eb411ab
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
frontend/src/Inscription.js
+2
-2
2 additions, 2 deletions
frontend/src/Inscription.js
frontend/src/components/CreneauCard.js
+4
-3
4 additions, 3 deletions
frontend/src/components/CreneauCard.js
frontend/src/components/RendezVousPro.js
+1
-45
1 addition, 45 deletions
frontend/src/components/RendezVousPro.js
with
7 additions
and
50 deletions
frontend/src/Inscription.js
+
2
−
2
View file @
0bd467e8
import
{
useEffect
,
useState
}
from
"
react
"
import
{
useState
}
from
"
react
"
import
{
Link
}
from
'
react-router-dom
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
emailjs
from
'
emailjs-com
'
;
import
emailjs
from
'
emailjs-com
'
;
...
@@ -129,7 +129,7 @@ const Inscription = () => {
...
@@ -129,7 +129,7 @@ const Inscription = () => {
if
(
res
.
status
===
200
)
{
if
(
res
.
status
===
200
)
{
emailjs
.
send
(
"
service_kwla1nj
"
,
"
template_mm87l15
"
,
data
,
"
gkKZTWtimj8jnpE9G
"
)
emailjs
.
send
(
"
service_kwla1nj
"
,
"
template_mm87l15
"
,
data
,
"
gkKZTWtimj8jnpE9G
"
)
.
then
((
result
)
=>
{
.
then
((
result
)
=>
{
console
.
log
(
result
.
text
);
console
.
log
(
result
);
window
.
location
.
href
=
"
/
"
;
window
.
location
.
href
=
"
/
"
;
},
(
error
)
=>
{
},
(
error
)
=>
{
console
.
log
(
error
.
text
);
console
.
log
(
error
.
text
);
...
...
This diff is collapsed.
Click to expand it.
frontend/src/components/CreneauCard.js
+
4
−
3
View file @
0bd467e8
...
@@ -2,8 +2,9 @@ function BoutiqueCard({ choisirCreneau, Heure, disponible, isSelected, setIsSele
...
@@ -2,8 +2,9 @@ function BoutiqueCard({ choisirCreneau, Heure, disponible, isSelected, setIsSele
const
handleSelect
=
(
horaire
)
=>
{
const
handleSelect
=
(
horaire
)
=>
{
if
(
disponible
)
{
if
(
disponible
)
{
choisirCreneau
(
horaire
)
let
value
=
horaire
===
isSelected
?
null
:
horaire
;
setIsSelected
(
horaire
===
isSelected
?
null
:
horaire
);
choisirCreneau
(
value
);
setIsSelected
(
value
);
}
}
}
}
...
@@ -17,7 +18,7 @@ function BoutiqueCard({ choisirCreneau, Heure, disponible, isSelected, setIsSele
...
@@ -17,7 +18,7 @@ function BoutiqueCard({ choisirCreneau, Heure, disponible, isSelected, setIsSele
return
(
return
(
<
div
<
div
className
=
{
`testclass h-100 max-w-sm rounded overflow-hidden shadow-lg
${
!
disponible
?
'
opacity-50 cursor-not-allowed
'
:
'
hover:bg-blue-200
'
}
${
isSelected
===
Heure
?
'
bg-green-300
'
:
''
}
`
}
className
=
{
`testclass h-100 max-w-sm rounded overflow-hidden shadow-lg
${
disponible
?
'
hover:bg-blue-200
'
:
'
opacity-50 cursor-not-allowed
'
}
${
isSelected
===
Heure
?
'
bg-green-300
hover:bg-green-300
'
:
''
}
`
}
onClick
=
{()
=>
handleSelect
(
Heure
)}
onClick
=
{()
=>
handleSelect
(
Heure
)}
>
>
<
div
className
=
"
px-3 py-4 pt-2
"
>
<
div
className
=
"
px-3 py-4 pt-2
"
>
...
...
This diff is collapsed.
Click to expand it.
frontend/src/components/RendezVousPro.js
+
1
−
45
View file @
0bd467e8
...
@@ -2,8 +2,6 @@ import React, { useState } from 'react';
...
@@ -2,8 +2,6 @@ import React, { useState } from 'react';
function
RendezVous
({
lieu
,
date
,
heure
,
id
,
descr
,
adv
})
{
function
RendezVous
({
lieu
,
date
,
heure
,
id
,
descr
,
adv
})
{
const
[
state
,
setState
]
=
useState
(
"
Cancel
"
);
const
[
state
,
setState
]
=
useState
(
"
Cancel
"
);
const
[
description
,
setDescription
]
=
useState
(
""
);
const
[
advice
,
setAdvice
]
=
useState
(
""
);
function
getContenuRdv
()
{
function
getContenuRdv
()
{
...
@@ -73,45 +71,7 @@ function RendezVous({ lieu, date, heure, id, descr, adv }) {
...
@@ -73,45 +71,7 @@ function RendezVous({ lieu, date, heure, id, descr, adv }) {
}
}
}
}
const
updateComment
=
(
id
,
value
)
=>
{
const
data
=
{
idrdv
:
id
,
description
:
value
};
const
options
=
{
method
:
'
PUT
'
,
headers
:
{
'
Content-Type
'
:
'
application/json
'
,
},
mode
:
'
cors
'
,
body
:
JSON
.
stringify
(
data
),
};
fetch
(
'
http://127.0.0.1:3001/update-conseil
'
,
options
)
.
then
(
function
(
response
)
{
if
(
response
.
status
!==
200
)
{
const
options2
=
{
method
:
'
POST
'
,
headers
:
{
'
Content-Type
'
:
'
application/json
'
,
},
mode
:
'
cors
'
,
body
:
JSON
.
stringify
(
data
),
};
fetch
(
'
http://127.0.0.1:3001/ajouter-conseil
'
,
options2
)
.
then
(
function
(
response
)
{
if
(
response
.
status
!==
200
)
{
alert
(
"
Erreur lors de l'ajout de conseil
"
);
}
})
}
});
}
const
updateRdv
=
(
description
,
advice
)
=>
{
const
updateRdv
=
(
description
,
advice
)
=>
{
// console.log(advice)
const
data
=
{
const
data
=
{
idrdv
:
id
,
idrdv
:
id
,
description
:
description
,
description
:
description
,
...
@@ -136,13 +96,9 @@ function RendezVous({ lieu, date, heure, id, descr, adv }) {
...
@@ -136,13 +96,9 @@ function RendezVous({ lieu, date, heure, id, descr, adv }) {
}
}
function
save
()
{
function
save
()
{
setDescription
(
document
.
getElementById
(
"
desc
"
).
value
);
setAdvice
(
document
.
getElementById
(
"
advice
"
).
value
);
updateRdv
(
document
.
getElementById
(
"
desc
"
).
value
,
document
.
getElementById
(
"
advice
"
).
value
);
updateRdv
(
document
.
getElementById
(
"
desc
"
).
value
,
document
.
getElementById
(
"
advice
"
).
value
);
}
}
// Change le button entre Annuler et Modifier
function
getRightAction
(
stateAction
)
{
function
getRightAction
(
stateAction
)
{
const
stateModif
=
(
const
stateModif
=
(
<
button
type
=
"
button
"
className
=
"
btn btn-light
"
onClick
=
{()
=>
{
<
button
type
=
"
button
"
className
=
"
btn btn-light
"
onClick
=
{()
=>
{
...
...
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