Closed diego2013 closed 8 years ago
Maybe we should revisit the allowedToACK function to make sure that has the prober behavior in itself, instead of using all those ifs.
We could use a function to know if the user can ACK the scenario (Scenario is approved, user is logged in and has not already approved the scenario). Then another function would say if the current user has acked this scenario. This latter function could be an aux. function for the former fuctionality and probably would make the life easier in the HTML.
or, maybe the ACK (or ACKed) button is not showing when it should.
It seems that the feature is working well. With the data from the post we see that scenario ze77cjbew3ycdDvdf has been AKCed twice. Checking the dev database these ACKers are
IDs: kkWsjmCvsfEtnGvDN and KCC4CpHtGWfNQNSPi (which are users Enrique and Pablo). Diego can't ACK because this is his own scenario, and thus he would not be seeing a "you acked this scn" message.
The code can be refactored, though, and made smarter functions (maybe isNotScenarioOwner
should also be used to see if user is logged in?)
Review the logic to display this label. It is not showing properly (but at the same time is not allowing user to ACK).