diff --git a/app/javascript/dashboard/components-next/Contacts/ContactHeader/ContactExportDialog.vue b/app/javascript/dashboard/components-next/Contacts/ContactHeader/ContactExportDialog.vue
new file mode 100644
index 000000000..692c12001
--- /dev/null
+++ b/app/javascript/dashboard/components-next/Contacts/ContactHeader/ContactExportDialog.vue
@@ -0,0 +1,76 @@
+
+
+
+
+
diff --git a/app/javascript/dashboard/components-next/Contacts/ContactHeader/ContactImportDialog.vue b/app/javascript/dashboard/components-next/Contacts/ContactHeader/ContactImportDialog.vue
index c412b3139..ef76c9267 100644
--- a/app/javascript/dashboard/components-next/Contacts/ContactHeader/ContactImportDialog.vue
+++ b/app/javascript/dashboard/components-next/Contacts/ContactHeader/ContactImportDialog.vue
@@ -1,6 +1,6 @@
@@ -62,4 +66,5 @@ const handleContactAction = ({ action }) => {
+
diff --git a/app/javascript/dashboard/i18n/locale/en/contact.json b/app/javascript/dashboard/i18n/locale/en/contact.json
index 77a40c54f..35689afdb 100644
--- a/app/javascript/dashboard/i18n/locale/en/contact.json
+++ b/app/javascript/dashboard/i18n/locale/en/contact.json
@@ -414,6 +414,13 @@
"SUCCESS_MESSAGE": "You will be notified via email when the import is complete.",
"ERROR_MESSAGE": "There was an error, please try again"
},
+ "EXPORT_CONTACT": {
+ "TITLE": "Export contacts",
+ "DESCRIPTION": "Quickly export a csv file with comprehensive details of your contacts",
+ "CONFIRM": "Export",
+ "SUCCESS_MESSAGE": "Export is in progress. You will be notified on email when the export file is ready to download.",
+ "ERROR_MESSAGE": "There was an error, please try again"
+ },
"SORT_BY": {
"LABEL": "Sort by",
"OPTIONS": {
diff --git a/app/javascript/dashboard/store/modules/contacts/actions.js b/app/javascript/dashboard/store/modules/contacts/actions.js
index deb1c96d1..0169f2f2b 100644
--- a/app/javascript/dashboard/store/modules/contacts/actions.js
+++ b/app/javascript/dashboard/store/modules/contacts/actions.js
@@ -126,12 +126,12 @@ export const actions = {
},
import: async ({ commit }, file) => {
- commit(types.SET_CONTACT_UI_FLAG, { isCreating: true });
+ commit(types.SET_CONTACT_UI_FLAG, { isImporting: true });
try {
await ContactAPI.importContacts(file);
- commit(types.SET_CONTACT_UI_FLAG, { isCreating: false });
+ commit(types.SET_CONTACT_UI_FLAG, { isImporting: false });
} catch (error) {
- commit(types.SET_CONTACT_UI_FLAG, { isCreating: false });
+ commit(types.SET_CONTACT_UI_FLAG, { isImporting: false });
if (error.response?.data?.message) {
throw new ExceptionWithMessage(error.response.data.message);
}
@@ -139,12 +139,13 @@ export const actions = {
},
export: async ({ commit }, { payload, label }) => {
+ commit(types.SET_CONTACT_UI_FLAG, { isExporting: true });
try {
await ContactAPI.exportContacts({ payload, label });
- commit(types.SET_CONTACT_UI_FLAG, { isCreating: false });
+ commit(types.SET_CONTACT_UI_FLAG, { isExporting: false });
} catch (error) {
- commit(types.SET_CONTACT_UI_FLAG, { isCreating: false });
+ commit(types.SET_CONTACT_UI_FLAG, { isExporting: false });
if (error.response?.data?.message) {
throw new Error(error.response.data.message);
} else {
diff --git a/app/javascript/dashboard/store/modules/contacts/index.js b/app/javascript/dashboard/store/modules/contacts/index.js
index ba8d47642..eb1e92434 100644
--- a/app/javascript/dashboard/store/modules/contacts/index.js
+++ b/app/javascript/dashboard/store/modules/contacts/index.js
@@ -15,6 +15,8 @@ const state = {
isUpdating: false,
isMerging: false,
isDeleting: false,
+ isExporting: false,
+ isImporting: false,
},
sortOrder: [],
appliedFilters: [],