chore: Minor fix

This commit is contained in:
iamsivin
2024-11-13 15:55:16 +05:30
parent 78e6f995eb
commit 94142acb93
6 changed files with 74 additions and 34 deletions
@@ -1,6 +1,7 @@
<script setup>
import { computed, useSlots } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import Button from 'dashboard/components-next/button/Button.vue';
import Input from 'dashboard/components-next/input/Input.vue';
@@ -72,6 +73,7 @@ const emit = defineEmits([
const { t } = useI18n();
const slots = useSlots();
const route = useRoute();
const selectedContactName = computed(() => {
return props.selectedContact?.name;
@@ -96,6 +98,10 @@ const hasSidebar = computed(() => {
return slots.sidebar && props.isDetailView;
});
const isNotSegmentView = computed(() => {
return route.name !== 'contacts_dashboard_segments_index';
});
const handleBreadcrumbClick = () => {
emit('goToContactsList');
};
@@ -132,11 +138,12 @@ const updateCurrentPage = page => {
/>
<div class="flex items-center gap-4">
<div
v-if="!isDetailView && !isEmptyState"
v-if="!isDetailView && !isEmptyState && isNotSegmentView"
class="flex items-center gap-2"
>
<Input
:model-value="searchValue"
type="search"
:placeholder="$t('CONTACTS_LAYOUT.HEADER.SEARCH_PLACEHOLDER')"
:custom-input-class="[
'h-8 [&:not(.focus)]:!border-transparent bg-n-alpha-2 dark:bg-n-solid-1 ltr:!pl-8 !py-1 rtl:!pr-8',
@@ -245,7 +245,14 @@ const menuItems = computed(() => {
{
name: 'All Contacts',
label: t('SIDEBAR.ALL_CONTACTS'),
to: accountScopedRoute('contacts_dashboard_index'),
to: accountScopedRoute(
'contacts_dashboard_index',
{},
{
page: 1,
search: undefined,
}
),
activeOn: [
'contacts_dashboard_index',
'contacts_dashboard_edit_index',
@@ -258,9 +265,15 @@ const menuItems = computed(() => {
children: contactCustomViews.value.map(view => ({
name: `${view.name}-${view.id}`,
label: view.name,
to: accountScopedRoute('contacts_dashboard_segments_index', {
segmentId: view.id,
}),
to: accountScopedRoute(
'contacts_dashboard_segments_index',
{
segmentId: view.id,
},
{
page: 1,
}
),
activeOn: [
'contacts_dashboard_segments_index',
'contacts_dashboard_segments_edit_index',
@@ -278,9 +291,16 @@ const menuItems = computed(() => {
class: `size-[12px] ring-1 ring-n-alpha-1 dark:ring-white/20 ring-inset rounded-sm`,
style: { backgroundColor: label.color },
}),
to: accountScopedRoute('contacts_dashboard_labels_index', {
label: label.title,
}),
to: accountScopedRoute(
'contacts_dashboard_labels_index',
{
label: label.title,
},
{
page: 1,
search: undefined,
}
),
activeOn: [
'contacts_dashboard_labels_index',
'contacts_dashboard_labels_edit_index',