chore: API fixes (#3014)

- Minor API fixes
- Configuration screen for LINE inbox
This commit is contained in:
Sojan Jose
2021-09-14 22:44:53 +05:30
committed by GitHub
parent 946a09928e
commit 2396b59f11
11 changed files with 76 additions and 16 deletions

View File

@@ -195,6 +195,10 @@
"SUBMIT_BUTTON": "Create LINE Channel",
"API": {
"ERROR_MESSAGE": "We were not able to save the LINE channel"
},
"API_CALLBACK": {
"TITLE": "Callback URL",
"SUBTITLE": "You have to configure the webhook URL in LINE application with the URL mentioned here."
}
},
"TELEGRAM_CHANNEL": {

View File

@@ -88,7 +88,7 @@ export default {
const selectedAgents = this.selectedAgents.map(x => x.id);
try {
await InboxMembersAPI.create({ inboxId, agentList: selectedAgents });
await InboxMembersAPI.update({ inboxId, agentList: selectedAgents });
router.replace({
name: 'settings_inbox_finish',
params: {

View File

@@ -17,7 +17,7 @@
<woot-code
v-if="isATwilioInbox"
lang="html"
:script="currentInbox.webhook_url"
:script="currentInbox.callback_webhook_url"
>
</woot-code>
</div>
@@ -25,7 +25,7 @@
<woot-code
v-if="isALineInbox"
lang="html"
:script="currentInbox.webhook_url"
:script="currentInbox.callback_webhook_url"
>
</woot-code>
</div>
@@ -93,6 +93,12 @@ export default {
)}`;
}
if (this.isALineInbox) {
return `${this.$t('INBOX_MGMT.FINISH.MESSAGE')}. ${this.$t(
'INBOX_MGMT.ADD.LINE_CHANNEL.API_CALLBACK.SUBTITLE'
)}`;
}
if (this.isAEmailInbox) {
return this.$t('INBOX_MGMT.ADD.EMAIL_CHANNEL.FINISH_MESSAGE');
}

View File

@@ -51,6 +51,9 @@
<span v-if="item.channel_type === 'Channel::Telegram'">
Telegram
</span>
<span v-if="item.channel_type === 'Channel::Line'">
Line
</span>
<span v-if="item.channel_type === 'Channel::Api'">
{{ globalConfig.apiChannelName || 'API' }}
</span>

View File

@@ -259,7 +259,21 @@
:title="$t('INBOX_MGMT.ADD.TWILIO.API_CALLBACK.TITLE')"
:sub-title="$t('INBOX_MGMT.ADD.TWILIO.API_CALLBACK.SUBTITLE')"
>
<woot-code :script="twilioCallbackURL" lang="html"></woot-code>
<woot-code
:script="inbox.callback_webhook_url"
lang="html"
></woot-code>
</settings-section>
</div>
<div v-else-if="isALineChannel" class="settings--content">
<settings-section
:title="$t('INBOX_MGMT.ADD.LINE_CHANNEL.API_CALLBACK.TITLE')"
:sub-title="$t('INBOX_MGMT.ADD.LINE_CHANNEL.API_CALLBACK.SUBTITLE')"
>
<woot-code
:script="inbox.callback_webhook_url"
lang="html"
></woot-code>
</settings-section>
</div>
<div v-else-if="isAWebWidgetInbox">
@@ -398,7 +412,12 @@ export default {
];
}
if (this.isATwilioChannel || this.isAPIInbox || this.isAnEmailChannel) {
if (
this.isATwilioChannel ||
this.isALineChannel ||
this.isAPIInbox ||
this.isAnEmailChannel
) {
return [
...visibleToAllChannelTabs,
{

View File

@@ -5,6 +5,7 @@ export const INBOX_TYPES = {
TWILIO: 'Channel::TwilioSms',
API: 'Channel::Api',
EMAIL: 'Channel::Email',
LINE: 'Channel::Line',
};
export default {
@@ -27,6 +28,9 @@ export default {
isATwilioChannel() {
return this.channelType === INBOX_TYPES.TWILIO;
},
isALineChannel() {
return this.channelType === INBOX_TYPES.LINE;
},
isAnEmailChannel() {
return this.channelType === INBOX_TYPES.EMAIL;
},