Closed chasenlehara closed 2 years ago
Currently, the document preview button appears when there assemble or save buttons:
https://github.com/CCALI/a2jviewer/blob/dc1d980349beed6dcfd774c0008099a3b1f006a0/src/models/tests/page-test.js#L32-L63
https://github.com/CCALI/a2jviewer/blob/8e04c349c94f6f33ac73d0420a463fb57314e3e9/src/mobile/pages/pages.stache#L83-L91
This does not take into account whether there are:
DAT handles this by returning HTML for these conditions:
https://github.com/CCALI/a2jdat/blob/6f598245364941ac387620864f5858d79ae8ec7d/src/routes/preview.js#L47-L67
https://github.com/CCALI/a2jdat/blob/6f598245364941ac387620864f5858d79ae8ec7d/src/routes/assemble-utils.js#L238
In the future, it would be good if the document preview button was only shown if a preview could be generated; that is, at least one active text template that does not have conditional logic.
To be released June 29
Currently, the document preview button appears when there assemble or save buttons:
https://github.com/CCALI/a2jviewer/blob/dc1d980349beed6dcfd774c0008099a3b1f006a0/src/models/tests/page-test.js#L32-L63
https://github.com/CCALI/a2jviewer/blob/8e04c349c94f6f33ac73d0420a463fb57314e3e9/src/mobile/pages/pages.stache#L83-L91
This does not take into account whether there are:
DAT handles this by returning HTML for these conditions:
https://github.com/CCALI/a2jdat/blob/6f598245364941ac387620864f5858d79ae8ec7d/src/routes/preview.js#L47-L67
https://github.com/CCALI/a2jdat/blob/6f598245364941ac387620864f5858d79ae8ec7d/src/routes/assemble-utils.js#L238
In the future, it would be good if the document preview button was only shown if a preview could be generated; that is, at least one active text template that does not have conditional logic.