diff --git a/app/javascript/dashboard/components-next/Contacts/ContactsHeader/ContactListHeaderWrapper.vue b/app/javascript/dashboard/components-next/Contacts/ContactsHeader/ContactListHeaderWrapper.vue index 8b2a53b27..627addff8 100644 --- a/app/javascript/dashboard/components-next/Contacts/ContactsHeader/ContactListHeaderWrapper.vue +++ b/app/javascript/dashboard/components-next/Contacts/ContactsHeader/ContactListHeaderWrapper.vue @@ -106,10 +106,15 @@ const onImport = async file => { try { await store.dispatch('contacts/import', file); contactImportDialogRef.value?.dialogRef.close(); - useAlert(t('IMPORT_CONTACTS.SUCCESS_MESSAGE')); + useAlert( + t('CONTACTS_LAYOUT.HEADER.ACTIONS.IMPORT_CONTACT.SUCCESS_MESSAGE') + ); useTrack(CONTACTS_EVENTS.IMPORT_SUCCESS); } catch (error) { - useAlert(error.message ?? t('IMPORT_CONTACTS.ERROR_MESSAGE')); + useAlert( + error.message ?? + t('CONTACTS_LAYOUT.HEADER.ACTIONS.IMPORT_CONTACT.ERROR_MESSAGE') + ); useTrack(CONTACTS_EVENTS.IMPORT_FAILURE); } }; diff --git a/app/javascript/dashboard/components/widgets/conversation/ConversationAdvancedFilter.vue b/app/javascript/dashboard/components/widgets/conversation/ConversationAdvancedFilter.vue deleted file mode 100644 index b9d81ec4e..000000000 --- a/app/javascript/dashboard/components/widgets/conversation/ConversationAdvancedFilter.vue +++ /dev/null @@ -1,407 +0,0 @@ - - - - - diff --git a/app/javascript/dashboard/helper/specs/validations.spec.js b/app/javascript/dashboard/helper/specs/validations.spec.js index 57016cfdc..e697fbffd 100644 --- a/app/javascript/dashboard/helper/specs/validations.spec.js +++ b/app/javascript/dashboard/helper/specs/validations.spec.js @@ -1,46 +1,5 @@ import { describe, it, expect } from 'vitest'; -import { - validateConversationOrContactFilters, - validateAutomation, -} from '../validations'; - -describe('validateConversationOrContactFilters', () => { - it('should return no errors for valid filters', () => { - const validFilters = [ - { attribute_key: 'name', filter_operator: 'contains', values: 'John' }, - { attribute_key: 'email', filter_operator: 'is_present' }, - ]; - const errors = validateConversationOrContactFilters(validFilters); - expect(errors).toEqual({}); - }); - - it('should return errors for invalid filters', () => { - const invalidFilters = [ - { attribute_key: '', filter_operator: 'contains', values: 'John' }, - { attribute_key: 'email', filter_operator: '' }, - { attribute_key: 'age', filter_operator: 'equals' }, - ]; - const errors = validateConversationOrContactFilters(invalidFilters); - expect(errors).toEqual({ - filter_0: 'ATTRIBUTE_KEY_REQUIRED', - filter_1: 'FILTER_OPERATOR_REQUIRED', - filter_2: 'VALUE_REQUIRED', - }); - }); - - it('should validate days_before operator correctly', () => { - const filters = [ - { attribute_key: 'date', filter_operator: 'days_before', values: '0' }, - { attribute_key: 'date', filter_operator: 'days_before', values: '999' }, - { attribute_key: 'date', filter_operator: 'days_before', values: '500' }, - ]; - const errors = validateConversationOrContactFilters(filters); - expect(errors).toEqual({ - filter_0: 'VALUE_MUST_BE_BETWEEN_1_AND_998', - filter_1: 'VALUE_MUST_BE_BETWEEN_1_AND_998', - }); - }); -}); +import { validateAutomation } from '../validations'; describe('validateAutomation', () => { it('should return no errors for a valid automation', () => { diff --git a/app/javascript/dashboard/helper/validations.js b/app/javascript/dashboard/helper/validations.js index 4347f55aa..58f3faa1a 100644 --- a/app/javascript/dashboard/helper/validations.js +++ b/app/javascript/dashboard/helper/validations.js @@ -65,29 +65,6 @@ export const validateSingleFilter = filter => { return null; }; -/** - * Validates filters for conversations or contacts. - * - * @param {Array} filters - An array of filter objects to validate. - * @param {string} filters[].attribute_key - The key of the attribute to filter on. - * @param {string} filters[].filter_operator - The operator to use for filtering. - * @param {string|number} [filters[].values] - The value(s) to filter by (required for most operators). - * - * @returns {Object} An object containing any validation errors, keyed by filter index. - */ -export const validateConversationOrContactFilters = filters => { - const errors = {}; - - filters.forEach((filter, index) => { - const error = validateSingleFilter(filter); - if (error) { - errors[`filter_${index}`] = error; - } - }); - - return errors; -}; - // ------------------------------------------------------------------ // ---------------------- Automation Validation --------------------- // ------------------------------------------------------------------ diff --git a/app/javascript/dashboard/i18n/locale/en/contact.json b/app/javascript/dashboard/i18n/locale/en/contact.json index 3826823ed..f26c6ed46 100644 --- a/app/javascript/dashboard/i18n/locale/en/contact.json +++ b/app/javascript/dashboard/i18n/locale/en/contact.json @@ -57,46 +57,6 @@ "TITLE": "Edit contact", "DESC": "Edit contact details" }, - "CREATE_CONTACT": { - "BUTTON_LABEL": "New Contact", - "TITLE": "Create new contact", - "DESC": "Add basic information details about the contact." - }, - "IMPORT_CONTACTS": { - "BUTTON_LABEL": "Import", - "TITLE": "Import Contacts", - "DESC": "Import contacts through a CSV file.", - "DOWNLOAD_LABEL": "Download a sample csv.", - "FORM": { - "LABEL": "CSV File", - "SUBMIT": "Import", - "CANCEL": "Cancel" - }, - "SUCCESS_MESSAGE": "You will be notified via email when the import is complete.", - "ERROR_MESSAGE": "There was an error, please try again" - }, - "EXPORT_CONTACTS": { - "BUTTON_LABEL": "Export", - "TITLE": "Export Contacts", - "DESC": "Export contacts to a CSV file.", - "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", - "CONFIRM": { - "TITLE": "Export Contacts", - "MESSAGE": "Are you sure you want to export all contacts?", - "FILTERED_MESSAGE": "Are you sure you want to export all the filtered contacts?", - "YES": "Yes, Export", - "NO": "No, Cancel" - } - }, - "DELETE_NOTE": { - "CONFIRM": { - "TITLE": "Confirm Deletion", - "MESSAGE": "Are you want sure to delete this note?", - "YES": "Yes, Delete it", - "NO": "No, Keep it" - } - }, "DELETE_CONTACT": { "BUTTON_LABEL": "Delete Contact", "TITLE": "Delete contact", @@ -224,79 +184,14 @@ } }, "CONTACTS_PAGE": { - "HEADER": "Contacts", - "FIELDS": "Contact fields", - "SEARCH_BUTTON": "Search", - "SEARCH_INPUT_PLACEHOLDER": "Search for contacts", - "FILTER_CONTACTS": "Filter", - "FILTER_CONTACTS_SAVE": "Save filter", - "FILTER_CONTACTS_DELETE": "Delete filter", - "FILTER_CONTACTS_EDIT": "Edit segment", "LIST": { - "LOADING_MESSAGE": "Loading contacts...", - "404": "No contacts matches your search 🔍", - "NO_CONTACTS": "There are no available contacts", "TABLE_HEADER": { - "NAME": "Name", - "PHONE_NUMBER": "Phone Number", - "CONVERSATIONS": "Conversations", - "LAST_ACTIVITY": "Last Activity", - "CREATED_AT": "Created At", - "COUNTRY": "Country", - "CITY": "City", - "SOCIAL_PROFILES": "Social Profiles", - "COMPANY": "Company", - "EMAIL_ADDRESS": "Email Address" - }, - "VIEW_DETAILS": "View details" - } - }, - "CONTACT_PROFILE": { - "BACK_BUTTON": "Contacts", - "LOADING": "Loading contact profile..." - }, - "REMINDER": { - "ADD_BUTTON": { - "BUTTON": "Add", - "TITLE": "Shift + Enter to create a task" - }, - "FOOTER": { - "DUE_DATE": "Due date", - "LABEL_TITLE": "Set type" - } - }, - "NOTES": { - "FETCHING_NOTES": "Fetching notes...", - "NOT_AVAILABLE": "There are no notes created for this contact", - "HEADER": { - "TITLE": "Notes" - }, - "LIST": { - "LABEL": "added a note" - }, - "ADD": { - "BUTTON": "Add", - "PLACEHOLDER": "Add a note", - "TITLE": "Shift + Enter to create a note" - }, - "CONTENT_HEADER": { - "DELETE": "Delete note" - } - }, - "EVENTS": { - "HEADER": { - "TITLE": "Activities" - }, - "BUTTON": { - "PILL_BUTTON_NOTES": "notes", - "PILL_BUTTON_EVENTS": "events", - "PILL_BUTTON_CONVO": "conversations" + "SOCIAL_PROFILES": "Social Profiles" + } } }, "CUSTOM_ATTRIBUTES": { - "ADD_BUTTON_TEXT": "Add attributes", "BUTTON": "Add custom attribute", - "NOT_AVAILABLE": "There are no custom attributes available for this contact.", "COPY_SUCCESSFUL": "Copied to clipboard successfully", "SHOW_MORE": "Show all attributes", "SHOW_LESS": "Show less attributes", diff --git a/app/javascript/dashboard/modules/contact/components/AddCustomAttribute.vue b/app/javascript/dashboard/modules/contact/components/AddCustomAttribute.vue deleted file mode 100644 index ec32c5381..000000000 --- a/app/javascript/dashboard/modules/contact/components/AddCustomAttribute.vue +++ /dev/null @@ -1,109 +0,0 @@ - - - diff --git a/app/javascript/dashboard/modules/contact/components/ContactAttribute.vue b/app/javascript/dashboard/modules/contact/components/ContactAttribute.vue deleted file mode 100644 index ee8b3074b..000000000 --- a/app/javascript/dashboard/modules/contact/components/ContactAttribute.vue +++ /dev/null @@ -1,131 +0,0 @@ - - - - - diff --git a/app/javascript/dashboard/modules/contact/components/ContactFields.vue b/app/javascript/dashboard/modules/contact/components/ContactFields.vue deleted file mode 100644 index 71f92c969..000000000 --- a/app/javascript/dashboard/modules/contact/components/ContactFields.vue +++ /dev/null @@ -1,115 +0,0 @@ - - - - - diff --git a/app/javascript/dashboard/modules/contact/components/ContactPanel.vue b/app/javascript/dashboard/modules/contact/components/ContactPanel.vue deleted file mode 100644 index 568a8bf69..000000000 --- a/app/javascript/dashboard/modules/contact/components/ContactPanel.vue +++ /dev/null @@ -1,106 +0,0 @@ - - - - - diff --git a/app/javascript/dashboard/modules/notes/NotesOnContactPage.vue b/app/javascript/dashboard/modules/notes/NotesOnContactPage.vue deleted file mode 100644 index caaa9285d..000000000 --- a/app/javascript/dashboard/modules/notes/NotesOnContactPage.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - diff --git a/app/javascript/dashboard/modules/notes/components/AddNote.vue b/app/javascript/dashboard/modules/notes/components/AddNote.vue deleted file mode 100644 index 55c825695..000000000 --- a/app/javascript/dashboard/modules/notes/components/AddNote.vue +++ /dev/null @@ -1,62 +0,0 @@ - - - - - diff --git a/app/javascript/dashboard/modules/notes/components/ContactNote.vue b/app/javascript/dashboard/modules/notes/components/ContactNote.vue deleted file mode 100644 index 206154136..000000000 --- a/app/javascript/dashboard/modules/notes/components/ContactNote.vue +++ /dev/null @@ -1,139 +0,0 @@ - - - - - diff --git a/app/javascript/dashboard/modules/notes/components/NoteList.vue b/app/javascript/dashboard/modules/notes/components/NoteList.vue deleted file mode 100644 index ffbc1da83..000000000 --- a/app/javascript/dashboard/modules/notes/components/NoteList.vue +++ /dev/null @@ -1,61 +0,0 @@ - - - diff --git a/app/javascript/dashboard/routes/dashboard/contacts/components/AddReminder.vue b/app/javascript/dashboard/routes/dashboard/contacts/components/AddReminder.vue deleted file mode 100644 index 9cf017f9c..000000000 --- a/app/javascript/dashboard/routes/dashboard/contacts/components/AddReminder.vue +++ /dev/null @@ -1,140 +0,0 @@ - - -