Skip to content

Commit

Permalink
fix: removed default view code from pages
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Feb 3, 2024
1 parent 30d9ec3 commit 678f3e0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 40 deletions.
9 changes: 1 addition & 8 deletions frontend/src/pages/CallLog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,12 @@ import {
} from 'frappe-ui'
import { usersStore } from '@/stores/users'
import { contactsStore } from '@/stores/contacts'
import { viewsStore } from '@/stores/views'
import { computed, ref } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const { getUser } = usersStore()
const { contacts, getContact, getLeadContact } = contactsStore()
const { getDefaultView } = viewsStore()
const props = defineProps({
callLogId: {
Expand Down Expand Up @@ -241,12 +239,7 @@ function createLead() {
}
const breadcrumbs = computed(() => {
let defaultView = getDefaultView()
let route = { name: 'Call Logs' }
if (defaultView?.route_name == 'Call Logs' && defaultView?.is_view) {
route = { name: 'Call Logs', query: { view: defaultView.name } }
}
let items = [{ label: 'Call Logs', route: route }]
let items = [{ label: 'Call Logs', route: { name: 'Call Logs' } }]
items.push({
label: callLog.data?.caller.label,
route: { name: 'Call Log', params: { callLogId: props.callLogId } },
Expand Down
9 changes: 1 addition & 8 deletions frontend/src/pages/Contact.vue
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ import { usersStore } from '@/stores/users.js'
import { contactsStore } from '@/stores/contacts.js'
import { organizationsStore } from '@/stores/organizations.js'
import { statusesStore } from '@/stores/statuses'
import { viewsStore } from '@/stores/views'
import { ref, computed, h } from 'vue'
import { useRouter } from 'vue-router'
Expand All @@ -236,7 +235,6 @@ const { getContactByName, contacts } = contactsStore()
const { getUser } = usersStore()
const { getOrganization } = organizationsStore()
const { getDealStatus } = statusesStore()
const { getDefaultView } = viewsStore()
const props = defineProps({
contactId: {
Expand All @@ -253,12 +251,7 @@ const showContactModal = ref(false)
const detailMode = ref(false)
const breadcrumbs = computed(() => {
let defaultView = getDefaultView()
let route = { name: 'Contacts' }
if (defaultView?.route_name == 'Contacts' && defaultView?.is_view) {
route = { name: 'Contacts', query: { view: defaultView.name } }
}
let items = [{ label: 'Contacts', route: route }]
let items = [{ label: 'Contacts', route: { name: 'Contacts' } }]
items.push({
label: contact.value.full_name,
route: { name: 'Contact', params: { contactId: contact.value.name } },
Expand Down
9 changes: 1 addition & 8 deletions frontend/src/pages/Deal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ import { globalStore } from '@/stores/global'
import { contactsStore } from '@/stores/contacts'
import { organizationsStore } from '@/stores/organizations'
import { statusesStore } from '@/stores/statuses'
import { viewsStore } from '@/stores/views'
import {
createResource,
Dropdown,
Expand All @@ -333,7 +332,6 @@ const { $dialog, makeCall } = globalStore()
const { getContactByName, contacts } = contactsStore()
const { organizations, getOrganization } = organizationsStore()
const { statusOptions, getDealStatus } = statusesStore()
const { getDefaultView } = viewsStore()
const router = useRouter()
const props = defineProps({
Expand Down Expand Up @@ -422,12 +420,7 @@ function validateRequired(fieldname, value) {
}
const breadcrumbs = computed(() => {
let defaultView = getDefaultView()
let route = { name: 'Deals' }
if (defaultView?.route_name == 'Deals' && defaultView?.is_view) {
route = { name: 'Deals', query: { view: defaultView.name } }
}
let items = [{ label: 'Deals', route: route }]
let items = [{ label: 'Deals', route: { name: 'Deals' } }]
items.push({
label: organization.value?.name,
route: { name: 'Deal', params: { dealId: deal.data.name } },
Expand Down
9 changes: 1 addition & 8 deletions frontend/src/pages/Lead.vue
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ import { globalStore } from '@/stores/global'
import { contactsStore } from '@/stores/contacts'
import { organizationsStore } from '@/stores/organizations'
import { statusesStore } from '@/stores/statuses'
import { viewsStore } from '@/stores/views'
import {
createResource,
FileUploader,
Expand All @@ -298,7 +297,6 @@ const { $dialog, makeCall } = globalStore()
const { getContactByName, contacts } = contactsStore()
const { organizations } = organizationsStore()
const { statusOptions, getLeadStatus } = statusesStore()
const { getDefaultView } = viewsStore()
const router = useRouter()
const props = defineProps({
Expand Down Expand Up @@ -380,12 +378,7 @@ function validateRequired(fieldname, value) {
}
const breadcrumbs = computed(() => {
let defaultView = getDefaultView()
let route = { name: 'Leads' }
if (defaultView?.route_name == 'Leads' && defaultView?.is_view) {
route = { name: 'Leads', query: { view: defaultView.name } }
}
let items = [{ label: 'Leads', route: route }]
let items = [{ label: 'Leads', route: { name: 'Leads' } }]
items.push({
label: lead.data.lead_name,
route: { name: 'Lead', params: { leadId: lead.data.name } },
Expand Down
9 changes: 1 addition & 8 deletions frontend/src/pages/Organization.vue
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ import { globalStore } from '@/stores/global'
import { usersStore } from '@/stores/users'
import { organizationsStore } from '@/stores/organizations.js'
import { statusesStore } from '@/stores/statuses'
import { viewsStore } from '@/stores/views'
import {
dateFormat,
dateTooltipFormat,
Expand All @@ -256,7 +255,6 @@ const props = defineProps({
const { $dialog } = globalStore()
const { organizations, getOrganization } = organizationsStore()
const { getDealStatus } = statusesStore()
const { getDefaultView } = viewsStore()
const showOrganizationModal = ref(false)
const detailMode = ref(false)
Expand All @@ -265,12 +263,7 @@ const router = useRouter()
const organization = computed(() => getOrganization(props.organizationId))
const breadcrumbs = computed(() => {
let defaultView = getDefaultView()
let route = { name: 'Organizations' }
if (defaultView?.route_name == 'Organizations' && defaultView?.is_view) {
route = { name: 'Organizations', query: { view: defaultView.name } }
}
let items = [{ label: 'Organizations', route: route }]
let items = [{ label: 'Organizations', route: { name: 'Organizations' } }]
items.push({
label: props.organizationId,
route: {
Expand Down

0 comments on commit 678f3e0

Please sign in to comment.