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

[Fix] Store Outgoing Integration Result as String in Mongo #8413

Merged
merged 3 commits into from
Nov 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ <h2>
<div class="input-line double-col">
<label>{{_ "Integration_Outgoing_WebHook_History_Error_Stacktrace"}}</label>
<div>
<pre><code class="code-colors hljs json">{{{ hljsStack history.errorStack }}}</code></pre>
<pre><code class="code-colors hljs json">{{{ jsonStringify history.errorStack }}}</code></pre>
</div>
</div>
{{/if}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,12 @@ Template.integrationsOutgoingHistory.helpers({
},

jsonStringify(data) {
return data ? hljs.highlight('json', JSON.stringify(data, null, 2)).value : '';
},

hljsStack(errorStack) {
if (!errorStack) {
if (!data) {
return '';
} else if (typeof errorStack === 'object') {
return hljs.highlight('json', JSON.stringify(errorStack, null, 2)).value;
} else if (typeof data === 'object') {
return hljs.highlight('json', JSON.stringify(data, null, 2)).value;
} else {
return hljs.highlight('json', errorStack).value;
return hljs.highlight('json', data).value;
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ RocketChat.integrations.triggerHandler = new class RocketChatIntegrationHandler
}

if (typeof httpResult !== 'undefined') {
history.httpResult = httpResult;
history.httpResult = JSON.stringify(httpResult, null, 2);
}

if (typeof error !== 'undefined') {
Expand Down