openfun / richie

:pencil: An opensource CMS to build education portals
https://richie.education
MIT License
256 stars 80 forks source link

🐛(frontend) fix ProductCertificateFooter state issue #2440

Closed jbpenrath closed 2 weeks ago

jbpenrath commented 2 weeks ago

Purpose

Currently, if the learner has a submitted or pending order, the label displayed is the one as it has a validated order. Instead for submitted order, we want to prevent that the user tries to purchase again the product and with pending order the learner should be able to retry to purchase the certificate.

jbpenrath commented 2 weeks ago

Seems ok to me. Just an idea: could we abstract the order state usage away by using something like order?.hasCertificate instead of order?.state === OrderState.VALIDATED ? I'm thinking of the incoming order state refactoring here.

Good idea, I get it for the coming refactoring