You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/01/08 22:55:52 UTC

[GitHub] [couchdb-fauxton] Antonio-Maranhao commented on a change in pull request #1245: Mango: support multiple server-side warnings

Antonio-Maranhao commented on a change in pull request #1245: Mango: support multiple server-side warnings
URL: https://github.com/apache/couchdb-fauxton/pull/1245#discussion_r364484568
 
 

 ##########
 File path: app/addons/documents/mango/components/ExecutionStats.js
 ##########
 @@ -37,18 +35,10 @@ export default class ExecutionStats extends React.Component {
     return [minutes, ' ', minuteText, ', ', seconds, ' ', secondsText].join('');
   }
 
-  getWarning(executionStats, warning) {
-    if (!executionStats) { return warning; }
-
-    // warn if many documents scanned in relation to results returned
-    if (!warning && executionStats.results_returned) {
-      const docsExamined = executionStats.total_docs_examined || executionStats.total_quorum_docs_examined;
-      if (docsExamined / executionStats.results_returned > 10) {
-        return TOO_MANY_DOCS_SCANNED_WARNING;
-      }
+  getWarning(warning) {
+    if (warning) {
+      return warning.split('\n').join('<br>');
 
 Review comment:
   This will print `<br>` instead of adding a line break. You can use this instead:
   ```
   getWarning(warnings) {
       if (warnings) {
         return (
           <span>
             {warnings.split('\n').map(warnText => <>{warnText}<br/></>)}
           </span>
         );
       }
     }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services