diff --git a/Gemfile.lock b/Gemfile.lock index 853cba537..30c6c022a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -363,6 +363,8 @@ GEM connection_pool (~> 2.2) netrc (0.11.0) nio4r (2.5.7) + nokogiri (1.11.7-arm64-darwin) + racc (~> 1.4) nokogiri (1.11.7-x86_64-darwin) racc (~> 1.4) nokogiri (1.11.7-x86_64-linux) @@ -626,6 +628,7 @@ GEM zeitwerk (2.4.2) PLATFORMS + arm64-darwin-20 x86_64-darwin-21 x86_64-linux diff --git a/app/javascript/dashboard/components/widgets/InboxIconWithName.vue b/app/javascript/dashboard/components/widgets/InboxIconWithName.vue new file mode 100644 index 000000000..5c8163589 --- /dev/null +++ b/app/javascript/dashboard/components/widgets/InboxIconWithName.vue @@ -0,0 +1,38 @@ + + + + diff --git a/app/javascript/dashboard/i18n/default-sidebar.js b/app/javascript/dashboard/i18n/default-sidebar.js index 03d93b491..75a0675cc 100644 --- a/app/javascript/dashboard/i18n/default-sidebar.js +++ b/app/javascript/dashboard/i18n/default-sidebar.js @@ -47,6 +47,13 @@ export const getSidebarItems = accountId => ({ toState: frontendURL(`accounts/${accountId}/reports`), toStateName: 'settings_account_reports', }, + campaigns: { + icon: 'ion-speakerphone', + label: 'CAMPAIGNS', + hasSubMenu: false, + toState: frontendURL(`accounts/${accountId}/campaigns`), + toStateName: 'settings_account_campaigns', + }, settings: { icon: 'ion-settings', label: 'SETTINGS', @@ -105,6 +112,32 @@ export const getSidebarItems = accountId => ({ }, }, }, + campaigns: { + routes: ['settings_account_campaigns', 'one_off'], + menuItems: { + back: { + icon: 'ion-ios-arrow-back', + label: 'HOME', + hasSubMenu: false, + toStateName: 'home', + toState: frontendURL(`accounts/${accountId}/dashboard`), + }, + ongoingCampaigns: { + icon: 'ion-arrow-swap', + label: 'ONGOING', + hasSubMenu: false, + toState: frontendURL(`accounts/${accountId}/campaigns/ongoing`), + toStateName: 'settings_account_campaigns', + }, + onOffCampaigns: { + icon: 'ion-radio-waves', + label: 'ONE_OFF', + hasSubMenu: false, + toState: frontendURL(`accounts/${accountId}/campaigns/one_off`), + toStateName: 'one_off', + }, + }, + }, settings: { routes: [ 'agent_list', diff --git a/app/javascript/dashboard/i18n/locale/en/campaign.json b/app/javascript/dashboard/i18n/locale/en/campaign.json index 95ed4d199..a348f2bb3 100644 --- a/app/javascript/dashboard/i18n/locale/en/campaign.json +++ b/app/javascript/dashboard/i18n/locale/en/campaign.json @@ -2,7 +2,10 @@ "CAMPAIGN": { "HEADER": "Campaigns", "SIDEBAR_TXT": "Proactive messages allow the customer to send outbound messages to their contacts which would trigger more conversations. Click on Add Campaign to create a new campaign. You can also edit or delete an existing campaign by clicking on the Edit or Delete button.", - "HEADER_BTN_TXT": "Create a campaign", + "HEADER_BTN_TXT": { + "ONE_OFF": "Create a one off campaign", + "ONGOING": "Create a ongoing campaign" + }, "ADD": { "TITLE": "Create a campaign", "DESC": "Proactive messages allow the customer to send outbound messages to their contacts which would trigger more conversations.", @@ -25,6 +28,11 @@ "PLACEHOLDER": "Select the customer labels", "ERROR": "Audience is required" }, + "INBOX": { + "LABEL": "Select Inbox", + "PLACEHOLDER": "Select Inbox", + "ERROR": "Inbox is required" + }, "MESSAGE": { "LABEL": "Message", "PLACEHOLDER": "Please enter the message of campaign", @@ -80,6 +88,7 @@ "TABLE_HEADER": { "TITLE": "Title", "MESSAGE": "Message", + "INBOX": "Inbox", "STATUS": "Status", "SENDER": "Sender", "URL": "URL", @@ -101,6 +110,16 @@ "SENDER": { "BOT": "Bot" } + }, + "ONE_OFF": { + "HEADER": "One off campaigns", + "404": "There are no one off campaigns created", + "INBOXES_NOT_FOUND": "Please create an sms inbox and start adding campaigns" + }, + "ONGOING": { + "HEADER": "Ongoing campaigns", + "404": "There are no ongoing campaigns created", + "INBOXES_NOT_FOUND": "Please create an website inbox and start adding campaigns" } } } diff --git a/app/javascript/dashboard/i18n/locale/en/settings.json b/app/javascript/dashboard/i18n/locale/en/settings.json index 34ce3e4d4..6bbd35e32 100644 --- a/app/javascript/dashboard/i18n/locale/en/settings.json +++ b/app/javascript/dashboard/i18n/locale/en/settings.json @@ -127,8 +127,8 @@ "SIDEBAR": { "CONVERSATIONS": "Conversations", "REPORTS": "Reports", - "CONTACTS": "Contacts", "SETTINGS": "Settings", + "CONTACTS": "Contacts", "HOME": "Home", "AGENTS": "Agents", "INBOXES": "Inboxes", @@ -142,7 +142,10 @@ "ALL_CONTACTS": "All Contacts", "TAGGED_WITH": "Tagged with", "REPORTS_OVERVIEW": "Overview", - "CSAT": "CSAT" + "CSAT": "CSAT", + "CAMPAIGNS": "Campaigns", + "ONGOING": "Ongoing", + "ONE_OFF": "One off" }, "CREATE_ACCOUNT": { "NO_ACCOUNT_WARNING": "Uh oh! We could not find any Chatwoot accounts. Please create a new account to continue.", diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/components/AddCampaign.vue b/app/javascript/dashboard/routes/dashboard/settings/campaigns/AddCampaign.vue similarity index 78% rename from app/javascript/dashboard/routes/dashboard/settings/inbox/components/AddCampaign.vue rename to app/javascript/dashboard/routes/dashboard/settings/campaigns/AddCampaign.vue index 498c5c099..cf56f66e9 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/inbox/components/AddCampaign.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/campaigns/AddCampaign.vue @@ -44,14 +44,16 @@ -