View Issue Details

IDProjectCategoryView StatusLast Update
0006459Talermechant backendpublic2021-09-22 18:08
ReporterChristian Grothoff Assigned Tosebasjm  
PriorityhighSeverityfeatureReproducibilityN/A
Status confirmedResolutionopen 
Platformi7OSDebian GNU/LinuxOS Versionsqueeze
Product Versiongit (master) 
Target Version0.8.5 
Summary0006459: show full contract wallet-style in merchant HTML page
DescriptionASSUMING this is easily done based on what the wallet already has, we should modify the "show_order_details.en.must" template to include (existing!) JavaScript logic to properly render the JSON contract.

If such JS does not exist, and/or also in the long run, we should instead enhance our mustach template expansion capabilities so we can iterate over all contract fields and do everything mustach-template style so we can avoid needing any JavaScript.

Assigning to Florian so he can eval if existing Wallet code can easily plug this. If not, bump to 0.8.1 and we'll take care of it then via mustach.

Location in the code is marked with a FIXME and the bug number.
TagsNo tags attached.

Activities

Florian Dold

2020-08-03 14:21

manager   ~0016556

Contracts are currently rendered via React, i.e. by client-side DOM manipulation. That's necessary in the WebExtension wallet, as in a web extension we don't have any server to render stuff for us ;-)

We could of course also use this code in the the merchant backend HTML page, but that drags in a lot of dependencies (well, mainly React.JS) that we might not want. It also wouldn't work without JavaScript anymore.

Christian Grothoff

2020-08-03 14:26

manager   ~0016557

I understand that this won't work with JS anymore, that's why I suggested this as a temporary / quick fix (which means additional dependencies can also be OK). I don't think we'll have the time to do a proper (!) and fully equivalent MUST-based rendering for 0.8, and I don't think we want to show the raw JSON or _nothing_ for 0.8. So temporarily dropping in a JS-based solution seemed like an acceptable trade-off.

Florian Dold

2020-08-20 16:37

manager   ~0016685

I don't think this is viable, because the wallet's rendering of the contract terms is very minimalist right now. The functionality we get from (temporarily!) integrating the JS code in the merchant backend HTML page isn't justified.

It would be more effective to pass the contract JSON into the mustache template. The mustac library can do this for another JSON library already (json-c): https://gitlab.com/jobol/mustach/-/blob/master/mustach-json-c.h

I'll work on making jansson work with mustach.

Florian Dold

2020-08-21 17:57

manager   ~0016686

Putting this on feedback as the following questions are open:

1. Do we really need the label mechanism in the contract terms, or can we inline labels for better rendering, and introduce a tag for a "URL location"
2. The "Location" definition seems incomplete, shouldn't we at least have additional "free form" address lines?
3. What parts of the contract terms should be rendered on the page? Should we really list auditors/exchanges and h_wire? Is the following list enough?
    * summary
    * amount
    * product list (with pictures if available)
    * merchant information
  should probably be enough?

Christian Grothoff

2020-08-21 20:52

manager   ~0016694

Last edited: 2020-08-21 20:52

I would allow seeing auditors/exchanges and locations via buttons to 'expand' certain details (similar to what we used to do in some wallets).
[That is, if JavaScript is enabled. So maybe if JS is off, show everything, if it is on, hide certain details behind buttons to 'expand'].

sebasjm

2021-08-27 17:31

developer   ~0018134

working on this.
the page should work with and without js so i will do a build time rendering.

sebasjm

2021-08-31 06:00

developer   ~0018144

there is a full react html page that mimic the same design in merchant-backoffice repository (https://git.taler.net/merchant-backoffice.git/tree/packages/backend)

we can iterate the design there and new version will be deployed with the merchant backend as the spa.html
mustache placeholders are kept for server side rendering

one last step is missing: i need help updating the Makefile.am to correctly copying from the merchant-backend submodule to the merchant distribution folder :)

Christian Grothoff

2021-08-31 11:26

manager   ~0018146

To discuss this with Belen, it would be best if you could (manually) create a full-featured contract (JSON with _all_ the optional fields set to something) and had an easy way to render this contract with your page in a browser....

belen

2021-09-22 18:08

developer   ~0018406

I've attached some design suggestions. I agree with Florian that rendering all the items in the contract terms is probably not necessary. I've kept things quite simple as a starting point.
sample_for_the_other_pages.png (49,291 bytes)   
sample_for_the_other_pages.png (49,291 bytes)   
order_details.png (83,556 bytes)   
order_details.png (83,556 bytes)   

Issue History

Date Modified Username Field Change
2020-08-03 14:17 Christian Grothoff New Issue
2020-08-03 14:17 Christian Grothoff Status new => assigned
2020-08-03 14:17 Christian Grothoff Assigned To => Florian Dold
2020-08-03 14:21 Florian Dold Note Added: 0016556
2020-08-03 14:21 Florian Dold Assigned To Florian Dold => Christian Grothoff
2020-08-03 14:24 Christian Grothoff Assigned To Christian Grothoff => Florian Dold
2020-08-03 14:26 Christian Grothoff Note Added: 0016557
2020-08-20 16:37 Florian Dold Note Added: 0016685
2020-08-21 17:57 Florian Dold Status assigned => feedback
2020-08-21 17:57 Florian Dold Note Added: 0016686
2020-08-21 20:52 Christian Grothoff Note Added: 0016694
2020-08-21 20:52 Christian Grothoff Status feedback => assigned
2020-08-21 20:52 Christian Grothoff Note Edited: 0016694
2020-09-05 13:46 Christian Grothoff Target Version 0.8 => 0.8.1
2021-08-24 20:39 Christian Grothoff Target Version => 0.8.5
2021-08-24 20:42 Christian Grothoff Assigned To Florian Dold => sebasjm
2021-08-27 17:31 sebasjm Note Added: 0018134
2021-08-27 18:02 sebasjm Status assigned => confirmed
2021-08-31 06:00 sebasjm Note Added: 0018144
2021-08-31 11:26 Christian Grothoff Note Added: 0018146
2021-09-22 18:08 belen Note Added: 0018406
2021-09-22 18:08 belen File Added: sample_for_the_other_pages.png
2021-09-22 18:08 belen File Added: order_details.png