Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mango: support multiple server-side warnings #1245

Merged
merged 2 commits into from
Jan 10, 2020
Merged

Conversation

willholley
Copy link
Member

Overview

Changes the handling of mango warnings to support multiple warnings
delimited by a newline, as added in apache/couchdb#2410.

This also removes the client-side warning for too many docs scanned as that is now generated on the server.

Testing recommendations

When apache/couchdb#2410 is merged, run some Mango queries with bad / no indexes to generate warnings.

GitHub issue number

Related Pull Requests

Checklist

  • Code is written and works correctly;
  • Changes are covered by tests;
  • Documentation reflects the changes;
  • Update rebar.config.script with the correct tag once a new Fauxton release is made

}
getWarning(warning) {
if (warning) {
return warning.split('\n').join('<br>');
Copy link
Contributor

@Antonio-Maranhao Antonio-Maranhao Jan 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will print <br> instead of adding a line break. You can use this instead:

getWarning(warnings) {
    if (warnings) {
      const lines = warnings.split('\n').map((warnText, i) => {
        return <React.Fragment key={i}>{warnText}<br/></React.Fragment>;
      });
      return <span>{lines}</span>;
    }
  }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @Antonio-Maranhao - updated with those changes

Changes the handling of mango warnings to support multiple warnings
delimited by a newline, as added in apache/couchdb#2410
@willholley
Copy link
Member Author

hmm - looks like CI against couchdb:dev is broken...

@willholley willholley merged commit 113c4d6 into master Jan 10, 2020
@willholley willholley deleted the mango_warning_server branch January 10, 2020 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants