diff --git a/app/javascript/dashboard/api/campaigns.js b/app/javascript/dashboard/api/campaigns.js new file mode 100644 index 000000000..1c73a3360 --- /dev/null +++ b/app/javascript/dashboard/api/campaigns.js @@ -0,0 +1,9 @@ +import ApiClient from './ApiClient'; + +class CampaignsAPI extends ApiClient { + constructor() { + super('campaigns', { accountScoped: true }); + } +} + +export default new CampaignsAPI(); diff --git a/app/javascript/dashboard/i18n/locale/en/campaign.json b/app/javascript/dashboard/i18n/locale/en/campaign.json index 675fe0cd8..0d111b265 100644 --- a/app/javascript/dashboard/i18n/locale/en/campaign.json +++ b/app/javascript/dashboard/i18n/locale/en/campaign.json @@ -1,9 +1,49 @@ { "CAMPAIGN": { "HEADER": "Campaigns", - "HEADER_BTN_TXT": "Create Campaign", + "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", "LIST": { - "404": "There are no campaigns attached to this inbox" + "404": "There are no campaigns created for this inbox." + }, + "ADD": { + "TITLE": "Create a campaign", + "DESC": "Proactive messages allow the customer to send outbound messages to their contacts which would trigger more conversations.", + "CANCEL_BUTTON_TEXT": "Cancel", + "CREATE_BUTTON_TEXT": "Create", + "FORM": { + "TITLE": { + "LABEL": "Title", + "PLACEHOLDER": "Please enter the title of campaign", + "ERROR": "Title is required" + }, + "MESSAGE": { + "LABEL": "Message", + "PLACEHOLDER": "Please enter the message of campaign", + "ERROR": "Message is required" + }, + "SENT_BY": { + "LABEL": "Sent by", + "PLACEHOLDER": "Please select the the content of campaign", + "ERROR": "Sender is required" + }, + "END_POINT": { + "LABEL": "URL", + "PLACEHOLDER": "Please enter the URL", + "ERROR": "Please enter a valid URL" + }, + "TIME_ON_PAGE": { + "LABEL": "Time on page(Seconds)", + "PLACEHOLDER": "Please enter the time", + "ERROR": "Time on page is required" + }, + "ENABLED": "Enable campaign", + "SUBMIT": "Add Campaign" + }, + "API": { + "SUCCESS_MESSAGE": "Campaign created successfully", + "ERROR_MESSAGE": "There was an error. Please try again." + } } } } diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue index 2105101bb..69d4fe205 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/Settings.vue @@ -335,10 +335,10 @@ export default { if (this.isAWebWidgetInbox) { return [ ...visibleToAllChannelTabs, - { - key: 'campaign', - name: this.$t('INBOX_MGMT.TABS.CAMPAIGN'), - }, + // { + // key: 'campaign', + // name: this.$t('INBOX_MGMT.TABS.CAMPAIGN'), + // }, { key: 'preChatForm', name: this.$t('INBOX_MGMT.TABS.PRE_CHAT_FORM'), diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/components/AddCampaign.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/components/AddCampaign.vue new file mode 100644 index 000000000..47a6af4ba --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/components/AddCampaign.vue @@ -0,0 +1,205 @@ +