-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
@@ -60,6 +66,9 @@ export const DateField = ({ | |||
let selected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
j'extrairais la fonction donnée au render en la nommant.
Je ne comprends pas ce qu'est readOnlyValue ni selected à la lecture de leur nom : pourrait-on leur donner un nom plus parlant ? J'ai l'impression que ce sont des dates sous différents formats, à mon niveau de compréhension je peux te proposer datetime
et formattedDateTime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, j'ai renommé en formattedSelectedDatetime et selectedDatetime.
Pour extraire et nommer la fonction render, je suis moins d'accord je trouverais ca moins lisible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personnellement je n'arrive pas à comprendre ce que fait la fonction du render et je suis incapable de dire si c'est parce que je ne suis pas assez à l'aise en REACT ou parce que j'ai besoin d'un nommage pour me retrouver.
Il me semble que c'est plus une question "pratiques de code" ici et il me semblait que le nommage de fonctions anonymes en faisait partie. Mais comme je suis moins calée sur le front, je ne sais pas trop comment trancher sur ce point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, je comprends. Les arguments pour defendre mon point sont:
- s'il fallait écrire la fonction
render={fieldProps => { const props=f(DateFieldProps, fieldProps); return renderField(props)}}
, il faudrait d'une part écrire cette fonction plus haut dans le code, ce qui perd en lecture directe de l'arbre html de tout le composant (qui dans ce cas n'est pas trop gros, comme dans tous les render des autres components de type Field). - il faut savoir écrire cette fonction const props=f(DateFieldProps, fieldProps) qui à ma sensation, est de la complexité pour pas grand chose. Donc dans mon estimation, l'augmentation de la surface d'api dans ce cas nuit plus à la lisibilité et l'expressivité du composant.
- comme c'est un component qui ne touche pas encore au metier de l'appli, dur de trouver un autre nom que
renderField
(à moins que tu aies une idée).
Dans ce cas donc, j'aimerais tenir aussi ma position. Je propose qu'on demande un troisième avis qui tranche pour nous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Petite question un peu plus générale sur les timzone :
on les construits en fonction du department du code du lieu,
'Europe/Paris' s'il n'y en a pas,
j'imagine que c'est aussi ce qu'il se passe pour les lieux numériques,
du coup est-ce que ton problème ne se reposera pas dans le cas d'un offreur numérique en Outre-Mer ?
(dans ce cas il n'y a que des bokingLimiltDatetime)
@Aliochka very good point!
|
18130fe
to
1655009
Compare
023ca30
to
c179c73
Compare
c179c73
to
076e79a
Compare
92a96cd
to
bf42096
Compare
@sofcalca ok merci, j'ai fait mes retours, quand tu as le temps, pourras-tu confirmer la PR si elle te convient, merci:) |
} | ||
|
||
let tip = | ||
"L'heure limite de réservation est à 23h59 de ce jour et ne peut pas être changée." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renommer "L'heure limite de réservation est 23h59 ce jour et ne peut pas être changée."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
let tip = | ||
"L'heure limite de réservation est à 23h59 de ce jour et ne peut pas être changée." | ||
if (venue && venue.isVirtual) { | ||
tip = `${tip}<br /><br /> Vous être sur une offre numérique, la zone horaire de cette date correspond à celle de votre structure.` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourquoi un double saut de ligne via
?
Renommer la phrase : Vous êtes sur une offre numérique, la zone horaire de cette date correspond à celle de votre structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
le saut de ligne pour avoir ça:)
bindTimeFieldWithDateField({ | ||
dateName: 'beginningDatetime', | ||
timeName: 'beginningTime', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
supprimer saut de ligne
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
import HeroSection from 'components/layout/HeroSection' | ||
|
||
const getStocksManagerButtonTitle = (isEvent, stocks) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pourquoi on sort cette fonction de la class définissant le composant ? Elle n'a pas l'air d'être utilisée à l'extérieur et n'a de sens que dans le composant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
price: 17, | ||
} | ||
|
||
describe.skip('src | components | pages | Offer | StocksManager', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
si le test est skip, on le supprime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 on garde juste le snapshot
return `${dateName || ''}${hours || ''}${minutes || ''}${timezone || ''}` | ||
} | ||
|
||
const forceDateAtSpecificHoursAndMinutes = createCachedSelector( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renommer en forceDateTimeAtSpecificHoursAndMinutes
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
dateMoment = dateMoment.tz(timezone) | ||
} | ||
|
||
const updatedDate = dateMoment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renommer en updatedDateTime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
({ timezone }) => timezone, | ||
(dateName, hours, minutes, timezone) => | ||
createDecorator({ | ||
field: dateName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dateTimeName ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
// then | ||
expect(result).toEqual('Europe/Paris') | ||
}) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Il manque un test : le cas où l'offerer est undefined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@Akhilian j'ai fait les retours tu me confirmes ? merci |
No description provided.