Sailesh Mukil has posted comments on this change. ( http://gerrit.cloudera.org:8080/9378 )
Change subject: KUDU-2309: /masters can show the wrong list of masters ...................................................................... Patch Set 4: (1 comment) http://gerrit.cloudera.org:8080/#/c/9378/4/www/masters.mustache File www/masters.mustache: http://gerrit.cloudera.org:8080/#/c/9378/4/www/masters.mustache@40 PS4, Line 40: {{^has_no_errors}} > mustache doesn't have a way to condition based on the length of the 'errors "An inverted section begins with a caret (hat) and ends with a slash. That is {{^person}} begins a "person" inverted section while {{/person}} ends it. While sections can be used to render text one or more times based on the value of the key, inverted sections may render text once based on the inverse value of the key. That is, they will be rendered if the key doesn't exist, is false, or is an empty list" https://mustache.github.io/mustache.5.html I don't think the 'has_no_errors' field is necessary. The manual says if an array is empty, it will execute the condition under {{^emptyarray}}. So I imagine you could just have a regular section after: {{#errors}} ... ... {{/errors}} {{^errors}} No errors {{/errors}} Or something similar. Alternatively, you could use Javascript to read the JSON and suppress HTML fields accordingly. -- To view, visit http://gerrit.cloudera.org:8080/9378 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I603ebc22e998bac9bd00edc939577ae339587f26 Gerrit-Change-Number: 9378 Gerrit-PatchSet: 4 Gerrit-Owner: Will Berkeley <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Sailesh Mukil <[email protected]> Gerrit-Reviewer: Todd Lipcon <[email protected]> Gerrit-Reviewer: Will Berkeley <[email protected]> Gerrit-Comment-Date: Mon, 05 Mar 2018 21:23:41 +0000 Gerrit-HasComments: Yes
