From 350738bcd1cf6e5becfa951dd76d25c60b05a004 Mon Sep 17 00:00:00 2001 From: Bradley Hilton Date: Fri, 17 Aug 2018 17:38:12 -0500 Subject: [PATCH] [FIX] App's i18nAlert is only being displayed as "i18nAlert" (#11802) * Fix the i18nAlert not being displayed from Apps * Fix the apps http being invalid when being used as promises --- .../client/admin/appManage.html | 22 +++++++++---------- .../rocketchat-apps/server/bridges/http.js | 10 +++++---- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/packages/rocketchat-apps/client/admin/appManage.html b/packages/rocketchat-apps/client/admin/appManage.html index a1859be07917..e88bce6933c8 100644 --- a/packages/rocketchat-apps/client/admin/appManage.html +++ b/packages/rocketchat-apps/client/admin/appManage.html @@ -76,7 +76,7 @@
{{> icon block="rc-input__error-icon" icon="warning" classes="rc-input__error-icon-svg"}}
-
{{_ "i18nAlert"}}
+
{{{parseDescription i18nAlert}}}
{{/if}} @@ -97,7 +97,7 @@
{{> icon block="rc-input__error-icon" icon="warning" classes="rc-input__error-icon-svg"}}
-
{{_ "i18nAlert"}}
+
{{{parseDescription i18nAlert}}}
{{/if}} @@ -121,7 +121,7 @@
{{> icon block="rc-input__error-icon" icon="warning" classes="rc-input__error-icon-svg"}}
-
{{_ "i18nAlert"}}
+
{{{parseDescription i18nAlert}}}
{{/if}} @@ -145,7 +145,7 @@
{{> icon block="rc-input__error-icon" icon="warning" classes="rc-input__error-icon-svg"}}
-
{{_ "i18nAlert"}}
+
{{{parseDescription i18nAlert}}}
{{/if}} @@ -167,7 +167,7 @@
{{> icon block="rc-input__error-icon" icon="warning" classes="rc-input__error-icon-svg"}}
-
{{_ "i18nAlert"}}
+
{{{parseDescription i18nAlert}}}
{{/if}} @@ -191,7 +191,7 @@
{{> icon block="rc-input__error-icon" icon="warning" classes="rc-input__error-icon-svg"}}
-
{{_ "i18nAlert"}}
+
{{{parseDescription i18nAlert}}}
{{/if}} @@ -224,7 +224,7 @@
{{> icon block="rc-input__error-icon" icon="warning" classes="rc-input__error-icon-svg"}}
-
{{_ "i18nAlert"}}
+
{{{parseDescription i18nAlert}}}
{{/if}} @@ -250,7 +250,7 @@
{{> icon block="rc-input__error-icon" icon="warning" classes="rc-input__error-icon-svg"}}
-
{{_ "i18nAlert"}}
+
{{{parseDescription i18nAlert}}}
{{/if}} @@ -275,7 +275,7 @@
{{> icon block="rc-input__error-icon" icon="warning" classes="rc-input__error-icon-svg"}}
-
{{_ "i18nAlert"}}
+
{{{parseDescription i18nAlert}}}
{{/if}} @@ -325,7 +325,7 @@
{{> icon block="rc-input__error-icon" icon="warning" classes="rc-input__error-icon-svg"}}
-
{{_ "i18nAlert"}}
+
{{{parseDescription i18nAlert}}}
{{/if}} @@ -376,7 +376,7 @@
{{{parseDescription i18nDescription}}}
{{/if}} {{#if i18nAlert}} -
{{{_ i18nAlert}}}
+
{{{parseDescription i18nAlert}}}
{{/if}} diff --git a/packages/rocketchat-apps/server/bridges/http.js b/packages/rocketchat-apps/server/bridges/http.js index 6ac1c760d8ff..4d32f265950d 100644 --- a/packages/rocketchat-apps/server/bridges/http.js +++ b/packages/rocketchat-apps/server/bridges/http.js @@ -1,13 +1,15 @@ export class AppHttpBridge { - call(info) { + async call(info) { if (!info.request.content && typeof info.request.data === 'object') { info.request.content = JSON.stringify(info.request.data); } console.log(`The App ${ info.appId } is requesting from the outter webs:`, info); - return new Promise((resolve, reject) => { - HTTP.call(info.method, info.url, info.request, (e, result) => (e ? reject(e.response) : resolve(result))); - }); + try { + return HTTP.call(info.method, info.url, info.request); + } catch (e) { + return e.response; + } } }