@@ -447,8 +329,8 @@ import FacebookReauthorize from './facebook/Reauthorize';
import PreChatFormSettings from './PreChatForm/Settings';
import WeeklyAvailability from './components/WeeklyAvailability';
import GreetingsEditor from 'shared/components/GreetingsEditor';
-import ImapSettings from './ImapSettings';
-import SmtpSettings from './SmtpSettings';
+import ConfigurationPage from './settingsPage/ConfigurationPage';
+import CollaboratorsPage from './settingsPage/CollaboratorsPage';
export default {
components: {
@@ -458,22 +340,18 @@ export default {
PreChatFormSettings,
WeeklyAvailability,
GreetingsEditor,
- ImapSettings,
- SmtpSettings,
+ ConfigurationPage,
+ CollaboratorsPage,
},
mixins: [alertMixin, configMixin, inboxMixin],
data() {
return {
avatarFile: null,
avatarUrl: '',
- selectedAgents: [],
greetingEnabled: true,
tweetsEnabled: true,
- hmacMandatory: null,
greetingMessage: '',
- autoAssignment: false,
emailCollectEnabled: false,
- isAgentListUpdating: false,
csatSurveyEnabled: false,
allowMessagesAfterResolved: true,
continuityViaEmail: true,
@@ -484,22 +362,11 @@ export default {
channelWelcomeTagline: '',
selectedFeatureFlags: [],
replyTime: '',
- autoAssignmentOptions: [
- {
- value: true,
- label: this.$t('INBOX_MGMT.EDIT.AUTO_ASSIGNMENT.ENABLED'),
- },
- {
- value: false,
- label: this.$t('INBOX_MGMT.EDIT.AUTO_ASSIGNMENT.DISABLED'),
- },
- ],
selectedTabIndex: 0,
};
},
computed: {
...mapGetters({
- agentList: 'agents/getAgents',
uiFlags: 'inboxes/getUIFlags',
}),
selectedTabKey() {
@@ -606,9 +473,6 @@ export default {
e.target.value
);
},
- handleHmacFlag() {
- this.updateInbox();
- },
toggleInput(selected, current) {
if (selected.includes(current)) {
const newSelectedFlags = selected.filter(flag => flag !== current);
@@ -626,15 +490,12 @@ export default {
this.$store.dispatch('teams/get');
this.$store.dispatch('labels/get');
this.$store.dispatch('inboxes/get').then(() => {
- this.fetchAttachedAgents();
this.avatarUrl = this.inbox.avatar_url;
this.selectedInboxName = this.inbox.name;
this.webhookUrl = this.inbox.webhook_url;
this.greetingEnabled = this.inbox.greeting_enabled || false;
this.tweetsEnabled = this.inbox.tweets_enabled || false;
- this.hmacMandatory = this.inbox.hmac_mandatory || false;
this.greetingMessage = this.inbox.greeting_message || '';
- this.autoAssignment = this.inbox.enable_auto_assignment;
this.emailCollectEnabled = this.inbox.enable_email_collect;
this.csatSurveyEnabled = this.inbox.csat_survey_enabled;
this.allowMessagesAfterResolved = this.inbox.allow_messages_after_resolved;
@@ -646,39 +507,11 @@ export default {
this.replyTime = this.inbox.reply_time;
});
},
- async fetchAttachedAgents() {
- try {
- const response = await this.$store.dispatch('inboxMembers/get', {
- inboxId: this.currentInboxId,
- });
- const {
- data: { payload: inboxMembers },
- } = response;
- this.selectedAgents = inboxMembers;
- } catch (error) {
- // Handle error
- }
- },
- async updateAgents() {
- const agentList = this.selectedAgents.map(el => el.id);
- this.isAgentListUpdating = true;
- try {
- await this.$store.dispatch('inboxMembers/create', {
- inboxId: this.currentInboxId,
- agentList,
- });
- this.showAlert(this.$t('AGENT_MGMT.EDIT.API.SUCCESS_MESSAGE'));
- } catch (error) {
- this.showAlert(this.$t('AGENT_MGMT.EDIT.API.ERROR_MESSAGE'));
- }
- this.isAgentListUpdating = false;
- },
async updateInbox() {
try {
const payload = {
id: this.currentInboxId,
name: this.selectedInboxName,
- enable_auto_assignment: this.autoAssignment,
enable_email_collect: this.emailCollectEnabled,
csat_survey_enabled: this.csatSurveyEnabled,
allow_messages_after_resolved: this.allowMessagesAfterResolved,
@@ -692,7 +525,6 @@ export default {
welcome_tagline: this.channelWelcomeTagline || '',
selectedFeatureFlags: this.selectedFeatureFlags,
reply_time: this.replyTime || 'in_a_few_minutes',
- hmac_mandatory: this.hmacMandatory,
tweets_enabled: this.tweetsEnabled,
continuity_via_email: this.continuityViaEmail,
},
@@ -733,11 +565,6 @@ export default {
required,
shouldBeUrl,
},
- selectedAgents: {
- isEmpty() {
- return !!this.selectedAgents.length;
- },
- },
},
};
diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/CollaboratorsPage.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/CollaboratorsPage.vue
new file mode 100644
index 000000000..2b3fa413f
--- /dev/null
+++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/CollaboratorsPage.vue
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/ConfigurationPage.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/ConfigurationPage.vue
new file mode 100644
index 000000000..cc8746fed
--- /dev/null
+++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/ConfigurationPage.vue
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('INBOX_MGMT.EDIT.ENABLE_HMAC.LABEL') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lib/seeders/account_seeder.rb b/lib/seeders/account_seeder.rb
index 65fe5a4e1..162bc4cd9 100644
--- a/lib/seeders/account_seeder.rb
+++ b/lib/seeders/account_seeder.rb
@@ -17,6 +17,7 @@ class Seeders::AccountSeeder
def seed!
seed_canned_responses
+ seed_inboxes
end
def seed_canned_responses(count: 50)
@@ -24,4 +25,65 @@ class Seeders::AccountSeeder
account.canned_responses.create(content: Faker::Quote.fortune_cookie, short_code: Faker::Alphanumeric.alpha(number: 10))
end
end
+
+ def seed_inboxes
+ seed_website_inbox
+ seed_facebook_inbox
+ seed_twitter_inbox
+ seed_whatsapp_inbox
+ seed_sms_inbox
+ seed_email_inbox
+ seed_api_inbox
+ seed_telegram_inbox
+ seed_line_inbox
+ end
+
+ def seed_website_inbox
+ channel = Channel::WebWidget.create!(account: account, website_url: 'https://acme.inc')
+ Inbox.create!(channel: channel, account: account, name: 'Acme Website')
+ end
+
+ def seed_facebook_inbox
+ channel = Channel::FacebookPage.create!(account: account, user_access_token: 'test', page_access_token: 'test', page_id: 'test')
+ Inbox.create!(channel: channel, account: account, name: 'Acme Facebook')
+ end
+
+ def seed_twitter_inbox
+ channel = Channel::TwitterProfile.create!(account: account, twitter_access_token: 'test', twitter_access_token_secret: 'test', profile_id: '123')
+ Inbox.create!(channel: channel, account: account, name: 'Acme Twitter')
+ end
+
+ def seed_whatsapp_inbox
+ channel = Channel::Whatsapp.create!(account: account, phone_number: '+123456789')
+ Inbox.create!(channel: channel, account: account, name: 'Acme Whatsapp')
+ end
+
+ def seed_sms_inbox
+ channel = Channel::Sms.create!(account: account, phone_number: '+123456789')
+ Inbox.create!(channel: channel, account: account, name: 'Acme SMS')
+ end
+
+ def seed_email_inbox
+ channel = Channel::Email.create!(account: account, email: 'test@acme.inc', forward_to_email: 'test_fwd@acme.inc')
+ Inbox.create!(channel: channel, account: account, name: 'Acme Email')
+ end
+
+ def seed_api_inbox
+ channel = Channel::Api.create!(account: account)
+ Inbox.create!(channel: channel, account: account, name: 'Acme API')
+ end
+
+ def seed_telegram_inbox
+ # rubocop:disable Rails/SkipsModelValidations
+ Channel::Telegram.insert({ account_id: account.id, bot_name: 'Acme', bot_token: 'test', created_at: Time.now.utc, updated_at: Time.now.utc },
+ returning: %w[id])
+ channel = Channel::Telegram.find_by(bot_token: 'test')
+ Inbox.create!(channel: channel, account: account, name: 'Acme Telegram')
+ # rubocop:enable Rails/SkipsModelValidations
+ end
+
+ def seed_line_inbox
+ channel = Channel::Line.create!(account: account, line_channel_id: 'test', line_channel_secret: 'test', line_channel_token: 'test')
+ Inbox.create!(channel: channel, account: account, name: 'Acme Line')
+ end
end