diff --git a/app/javascript/dashboard/components/ChatList.vue b/app/javascript/dashboard/components/ChatList.vue
index 8affb6066..03e5b68bc 100644
--- a/app/javascript/dashboard/components/ChatList.vue
+++ b/app/javascript/dashboard/components/ChatList.vue
@@ -32,8 +32,20 @@
@click="resetAndFetchData"
/>
+
+
+
+
+
+
0 && this.customViewsId !== 0;
+ return this.activeCustomView && this.customViewsId !== 0;
},
hasAppliedFiltersOrActiveCustomViews() {
return this.hasAppliedFilters || this.hasActiveCustomViews;
},
savedCustomViewsValue() {
if (this.hasActiveCustomViews) {
- const payload = this.activeCustomView[0].query;
+ const payload = this.activeCustomView.query;
this.fetchSavedFilteredConversations(payload);
}
return {};
@@ -275,7 +298,7 @@ export default {
return this.$t('CHAT_LIST.MENTION_HEADING');
}
if (this.hasActiveCustomViews) {
- return this.activeCustomView[0].name;
+ return this.activeCustomView.name;
}
return this.$t('CHAT_LIST.TAB_HEADING');
},
@@ -298,11 +321,13 @@ export default {
},
activeCustomView() {
if (this.customViewsId) {
- return this.customViews.filter(
+ const activeView = this.customViews.filter(
view => view.id === Number(this.customViewsId)
);
+ const [firstValue] = activeView;
+ return firstValue;
}
- return [];
+ return undefined;
},
activeTeam() {
if (this.teamId) {
@@ -352,6 +377,12 @@ export default {
onCloseAddCustomViewsModal() {
this.showAddCustomViewsModal = false;
},
+ onClickOpenDeleteCustomViewsModal() {
+ this.showDeleteCustomViewsModal = true;
+ },
+ onCloseDeleteCustomViewsModal() {
+ this.showDeleteCustomViewsModal = false;
+ },
onToggleAdvanceFiltersModal() {
this.showAdvancedFilters = !this.showAdvancedFilters;
},
@@ -404,7 +435,7 @@ export default {
this.$store.dispatch('emptyAllConversations');
this.$store.dispatch('clearConversationFilters');
if (this.hasActiveCustomViews) {
- const payload = this.activeCustomView[0].query;
+ const payload = this.activeCustomView.query;
this.fetchSavedFilteredConversations(payload);
}
if (this.customViewsId) {
@@ -422,7 +453,7 @@ export default {
this.fetchConversations();
}
if (this.hasActiveCustomViews) {
- const payload = this.activeCustomView[0].query;
+ const payload = this.activeCustomView.query;
this.fetchSavedFilteredConversations(payload);
} else {
this.fetchFilteredConversations(this.appliedFilters);
@@ -504,4 +535,8 @@ export default {
padding: 0 0 var(--space-slab) 0 !important;
border-bottom: 1px solid var(--color-border);
}
+
+.delete-custom-view__button {
+ margin-right: var(--space-normal);
+}
diff --git a/app/javascript/dashboard/i18n/locale/en/advancedFilters.json b/app/javascript/dashboard/i18n/locale/en/advancedFilters.json
index 92a69f0b7..4dc077427 100644
--- a/app/javascript/dashboard/i18n/locale/en/advancedFilters.json
+++ b/app/javascript/dashboard/i18n/locale/en/advancedFilters.json
@@ -45,6 +45,21 @@
"SUCCESS_MESSAGE": "Custom view created successfully",
"ERROR_MESSAGE": "Error while creating custom view"
}
+ },
+ "DELETE": {
+ "DELETE_BUTTON": "Delete filter",
+ "MODAL": {
+ "CONFIRM": {
+ "TITLE": "Confirm Deletion",
+ "MESSAGE": "Are you sure to delete the filter ",
+ "YES": "Yes, Delete ",
+ "NO": "No, Keep "
+ }
+ },
+ "API": {
+ "SUCCESS_MESSAGE": "Custom view deleted successfully",
+ "ERROR_MESSAGE": "Error while deleting custom view"
+ }
}
}
}
diff --git a/app/javascript/dashboard/routes/dashboard/customviews/DeleteCustomViews.vue b/app/javascript/dashboard/routes/dashboard/customviews/DeleteCustomViews.vue
new file mode 100644
index 000000000..979a7f9bb
--- /dev/null
+++ b/app/javascript/dashboard/routes/dashboard/customviews/DeleteCustomViews.vue
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+