Merge pull request #491 from frappe/develop
This commit is contained in:
commit
5cbc3e33d4
0
crm/fcrm/doctype/crm_dropdown_item/__init__.py
Normal file
0
crm/fcrm/doctype/crm_dropdown_item/__init__.py
Normal file
94
crm/fcrm/doctype/crm_dropdown_item/crm_dropdown_item.json
Normal file
94
crm/fcrm/doctype/crm_dropdown_item/crm_dropdown_item.json
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
{
|
||||||
|
"actions": [],
|
||||||
|
"allow_rename": 1,
|
||||||
|
"creation": "2024-12-27 17:42:33.089685",
|
||||||
|
"doctype": "DocType",
|
||||||
|
"engine": "InnoDB",
|
||||||
|
"field_order": [
|
||||||
|
"name1",
|
||||||
|
"label",
|
||||||
|
"type",
|
||||||
|
"route",
|
||||||
|
"open_in_new_window",
|
||||||
|
"hidden",
|
||||||
|
"is_standard",
|
||||||
|
"column_break_mvbq",
|
||||||
|
"icon"
|
||||||
|
],
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"fieldname": "label",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"in_list_view": 1,
|
||||||
|
"label": "Label",
|
||||||
|
"mandatory_depends_on": "eval:doc.type == 'Route'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "type",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"in_list_view": 1,
|
||||||
|
"label": "Type",
|
||||||
|
"options": "Route\nSeparator",
|
||||||
|
"read_only_depends_on": "eval:doc.is_standard"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"depends_on": "eval:doc.type == 'Route'",
|
||||||
|
"fieldname": "route",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"in_list_view": 1,
|
||||||
|
"label": "Route",
|
||||||
|
"mandatory_depends_on": "eval:doc.type == 'Route'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"fieldname": "hidden",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"in_list_view": 1,
|
||||||
|
"label": "Hidden"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"fieldname": "is_standard",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Is Standard",
|
||||||
|
"read_only": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_mvbq",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Add svg code or use feather icons e.g 'settings'",
|
||||||
|
"fieldname": "icon",
|
||||||
|
"fieldtype": "Code",
|
||||||
|
"label": "Icon"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "1",
|
||||||
|
"depends_on": "eval:doc.type == 'Route'",
|
||||||
|
"fieldname": "open_in_new_window",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Open in new window"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"depends_on": "eval:doc.is_standard",
|
||||||
|
"fieldname": "name1",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"label": "Name",
|
||||||
|
"read_only": 1,
|
||||||
|
"unique": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"index_web_pages_for_search": 1,
|
||||||
|
"istable": 1,
|
||||||
|
"links": [],
|
||||||
|
"modified": "2024-12-27 19:35:53.012508",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "FCRM",
|
||||||
|
"name": "CRM Dropdown Item",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"permissions": [],
|
||||||
|
"sort_field": "creation",
|
||||||
|
"sort_order": "DESC",
|
||||||
|
"states": []
|
||||||
|
}
|
||||||
9
crm/fcrm/doctype/crm_dropdown_item/crm_dropdown_item.py
Normal file
9
crm/fcrm/doctype/crm_dropdown_item/crm_dropdown_item.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
# import frappe
|
||||||
|
from frappe.model.document import Document
|
||||||
|
|
||||||
|
|
||||||
|
class CRMDropdownItem(Document):
|
||||||
|
pass
|
||||||
@ -5,19 +5,63 @@
|
|||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
"field_order": [
|
"field_order": [
|
||||||
"restore_defaults"
|
"defaults_tab",
|
||||||
|
"restore_defaults",
|
||||||
|
"branding_tab",
|
||||||
|
"brand_name",
|
||||||
|
"brand_logo",
|
||||||
|
"favicon",
|
||||||
|
"dropdown_items_tab",
|
||||||
|
"dropdown_items"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"fieldname": "restore_defaults",
|
"fieldname": "restore_defaults",
|
||||||
"fieldtype": "Button",
|
"fieldtype": "Button",
|
||||||
"label": "Restore Defaults"
|
"label": "Restore Defaults"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "dropdown_items",
|
||||||
|
"fieldtype": "Table",
|
||||||
|
"options": "CRM Dropdown Item"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "defaults_tab",
|
||||||
|
"fieldtype": "Tab Break",
|
||||||
|
"label": "Defaults"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "branding_tab",
|
||||||
|
"fieldtype": "Tab Break",
|
||||||
|
"label": "Branding"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "An image with 1:1 & 2:1 ratio is preferred",
|
||||||
|
"fieldname": "brand_logo",
|
||||||
|
"fieldtype": "Attach",
|
||||||
|
"label": "Logo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "dropdown_items_tab",
|
||||||
|
"fieldtype": "Tab Break",
|
||||||
|
"label": "Dropdown Items"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "brand_name",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"label": "Name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "An icon file with .ico extension. Should be 16 x 16 px. Generated using a favicon generator. [favicon-generator.org]",
|
||||||
|
"fieldname": "favicon",
|
||||||
|
"fieldtype": "Attach",
|
||||||
|
"label": "Favicon"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-09-29 13:49:07.835379",
|
"modified": "2024-12-27 22:17:52.337109",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "FCRM",
|
"module": "FCRM",
|
||||||
"name": "FCRM Settings",
|
"name": "FCRM Settings",
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
from crm.install import after_install
|
from crm.install import after_install
|
||||||
|
|
||||||
|
|
||||||
@ -10,3 +11,28 @@ class FCRMSettings(Document):
|
|||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def restore_defaults(self, force=False):
|
def restore_defaults(self, force=False):
|
||||||
after_install(force)
|
after_install(force)
|
||||||
|
|
||||||
|
|
||||||
|
def after_migrate():
|
||||||
|
sync_table("dropdown_items", "standard_dropdown_items")
|
||||||
|
|
||||||
|
|
||||||
|
def sync_table(key, hook):
|
||||||
|
crm_settings = FCRMSettings("FCRM Settings")
|
||||||
|
existing_items = {d.name1: d for d in crm_settings.get(key)}
|
||||||
|
new_standard_items = {}
|
||||||
|
|
||||||
|
# add new items
|
||||||
|
count = 0 # maintain count because list may come from seperate apps
|
||||||
|
for item in frappe.get_hooks(hook):
|
||||||
|
if item.get("name1") not in existing_items:
|
||||||
|
crm_settings.append(key, item, count)
|
||||||
|
new_standard_items[item.get("name1")] = True
|
||||||
|
count += 1
|
||||||
|
|
||||||
|
# remove unused items
|
||||||
|
items = crm_settings.get(key)
|
||||||
|
items = [item for item in items if not (item.is_standard and (item.name1 not in new_standard_items))]
|
||||||
|
crm_settings.set(key, items)
|
||||||
|
|
||||||
|
crm_settings.save()
|
||||||
|
|||||||
146
crm/hooks.py
146
crm/hooks.py
@ -57,7 +57,7 @@ add_to_apps_screen = [
|
|||||||
|
|
||||||
# website user home page (by Role)
|
# website user home page (by Role)
|
||||||
# role_home_page = {
|
# role_home_page = {
|
||||||
# "Role": "home_page"
|
# "Role": "home_page"
|
||||||
# }
|
# }
|
||||||
|
|
||||||
website_route_rules = [
|
website_route_rules = [
|
||||||
@ -75,8 +75,8 @@ website_route_rules = [
|
|||||||
|
|
||||||
# add methods and filters to jinja environment
|
# add methods and filters to jinja environment
|
||||||
# jinja = {
|
# jinja = {
|
||||||
# "methods": "crm.utils.jinja_methods",
|
# "methods": "crm.utils.jinja_methods",
|
||||||
# "filters": "crm.utils.jinja_filters"
|
# "filters": "crm.utils.jinja_filters"
|
||||||
# }
|
# }
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
@ -118,11 +118,11 @@ before_uninstall = "crm.uninstall.before_uninstall"
|
|||||||
# Permissions evaluated in scripted ways
|
# Permissions evaluated in scripted ways
|
||||||
|
|
||||||
# permission_query_conditions = {
|
# permission_query_conditions = {
|
||||||
# "Event": "frappe.desk.doctype.event.event.get_permission_query_conditions",
|
# "Event": "frappe.desk.doctype.event.event.get_permission_query_conditions",
|
||||||
# }
|
# }
|
||||||
#
|
#
|
||||||
# has_permission = {
|
# has_permission = {
|
||||||
# "Event": "frappe.desk.doctype.event.event.has_permission",
|
# "Event": "frappe.desk.doctype.event.event.has_permission",
|
||||||
# }
|
# }
|
||||||
|
|
||||||
# DocType Class
|
# DocType Class
|
||||||
@ -155,32 +155,34 @@ doc_events = {
|
|||||||
"on_update": ["crm.api.whatsapp.on_update"],
|
"on_update": ["crm.api.whatsapp.on_update"],
|
||||||
},
|
},
|
||||||
"CRM Deal": {
|
"CRM Deal": {
|
||||||
"on_update": ["crm.fcrm.doctype.erpnext_crm_settings.erpnext_crm_settings.create_customer_in_erpnext"],
|
"on_update": [
|
||||||
|
"crm.fcrm.doctype.erpnext_crm_settings.erpnext_crm_settings.create_customer_in_erpnext"
|
||||||
|
],
|
||||||
},
|
},
|
||||||
"User": {
|
"User": {
|
||||||
"before_validate": ["crm.api.demo.validate_user"],
|
"before_validate": ["crm.api.demo.validate_user"],
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
# Scheduled Tasks
|
# Scheduled Tasks
|
||||||
# ---------------
|
# ---------------
|
||||||
|
|
||||||
# scheduler_events = {
|
# scheduler_events = {
|
||||||
# "all": [
|
# "all": [
|
||||||
# "crm.tasks.all"
|
# "crm.tasks.all"
|
||||||
# ],
|
# ],
|
||||||
# "daily": [
|
# "daily": [
|
||||||
# "crm.tasks.daily"
|
# "crm.tasks.daily"
|
||||||
# ],
|
# ],
|
||||||
# "hourly": [
|
# "hourly": [
|
||||||
# "crm.tasks.hourly"
|
# "crm.tasks.hourly"
|
||||||
# ],
|
# ],
|
||||||
# "weekly": [
|
# "weekly": [
|
||||||
# "crm.tasks.weekly"
|
# "crm.tasks.weekly"
|
||||||
# ],
|
# ],
|
||||||
# "monthly": [
|
# "monthly": [
|
||||||
# "crm.tasks.monthly"
|
# "crm.tasks.monthly"
|
||||||
# ],
|
# ],
|
||||||
# }
|
# }
|
||||||
|
|
||||||
# Testing
|
# Testing
|
||||||
@ -192,14 +194,14 @@ doc_events = {
|
|||||||
# ------------------------------
|
# ------------------------------
|
||||||
#
|
#
|
||||||
# override_whitelisted_methods = {
|
# override_whitelisted_methods = {
|
||||||
# "frappe.desk.doctype.event.event.get_events": "crm.event.get_events"
|
# "frappe.desk.doctype.event.event.get_events": "crm.event.get_events"
|
||||||
# }
|
# }
|
||||||
#
|
#
|
||||||
# each overriding function accepts a `data` argument;
|
# each overriding function accepts a `data` argument;
|
||||||
# generated from the base implementation of the doctype dashboard,
|
# generated from the base implementation of the doctype dashboard,
|
||||||
# along with any modifications made in other Frappe apps
|
# along with any modifications made in other Frappe apps
|
||||||
# override_doctype_dashboards = {
|
# override_doctype_dashboards = {
|
||||||
# "Task": "crm.task.get_dashboard_data"
|
# "Task": "crm.task.get_dashboard_data"
|
||||||
# }
|
# }
|
||||||
|
|
||||||
# exempt linked doctypes from being automatically cancelled
|
# exempt linked doctypes from being automatically cancelled
|
||||||
@ -225,29 +227,87 @@ doc_events = {
|
|||||||
# --------------------
|
# --------------------
|
||||||
|
|
||||||
# user_data_fields = [
|
# user_data_fields = [
|
||||||
# {
|
# {
|
||||||
# "doctype": "{doctype_1}",
|
# "doctype": "{doctype_1}",
|
||||||
# "filter_by": "{filter_by}",
|
# "filter_by": "{filter_by}",
|
||||||
# "redact_fields": ["{field_1}", "{field_2}"],
|
# "redact_fields": ["{field_1}", "{field_2}"],
|
||||||
# "partial": 1,
|
# "partial": 1,
|
||||||
# },
|
# },
|
||||||
# {
|
# {
|
||||||
# "doctype": "{doctype_2}",
|
# "doctype": "{doctype_2}",
|
||||||
# "filter_by": "{filter_by}",
|
# "filter_by": "{filter_by}",
|
||||||
# "partial": 1,
|
# "partial": 1,
|
||||||
# },
|
# },
|
||||||
# {
|
# {
|
||||||
# "doctype": "{doctype_3}",
|
# "doctype": "{doctype_3}",
|
||||||
# "strict": False,
|
# "strict": False,
|
||||||
# },
|
# },
|
||||||
# {
|
# {
|
||||||
# "doctype": "{doctype_4}"
|
# "doctype": "{doctype_4}"
|
||||||
# }
|
# }
|
||||||
# ]
|
# ]
|
||||||
|
|
||||||
# Authentication and authorization
|
# Authentication and authorization
|
||||||
# --------------------------------
|
# --------------------------------
|
||||||
|
|
||||||
# auth_hooks = [
|
# auth_hooks = [
|
||||||
# "crm.auth.validate"
|
# "crm.auth.validate"
|
||||||
# ]
|
# ]
|
||||||
|
|
||||||
|
after_migrate = ["crm.fcrm.doctype.fcrm_settings.fcrm_settings.after_migrate"]
|
||||||
|
|
||||||
|
standard_dropdown_items = [
|
||||||
|
{
|
||||||
|
"name1": "app_selector",
|
||||||
|
"label": "Apps",
|
||||||
|
"type": "Route",
|
||||||
|
"route": "#",
|
||||||
|
"is_standard": 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name1": "support_link",
|
||||||
|
"label": "Support",
|
||||||
|
"type": "Route",
|
||||||
|
"icon": "life-buoy",
|
||||||
|
"route": "https://t.me/frappecrm",
|
||||||
|
"is_standard": 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name1": "docs_link",
|
||||||
|
"label": "Docs",
|
||||||
|
"type": "Route",
|
||||||
|
"icon": "book-open",
|
||||||
|
"route": "https://docs.frappe.io/crm",
|
||||||
|
"is_standard": 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name1": "toggle_theme",
|
||||||
|
"label": "Toggle theme",
|
||||||
|
"type": "Route",
|
||||||
|
"icon": "moon",
|
||||||
|
"route": "#",
|
||||||
|
"is_standard": 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name1": "settings",
|
||||||
|
"label": "Settings",
|
||||||
|
"type": "Route",
|
||||||
|
"icon": "settings",
|
||||||
|
"route": "#",
|
||||||
|
"is_standard": 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name1": "separator",
|
||||||
|
"label": "",
|
||||||
|
"type": "Separator",
|
||||||
|
"is_standard": 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name1": "logout",
|
||||||
|
"label": "Log out",
|
||||||
|
"type": "Route",
|
||||||
|
"icon": "log-out",
|
||||||
|
"route": "#",
|
||||||
|
"is_standard": 1,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|||||||
@ -18,6 +18,7 @@ def after_install(force=False):
|
|||||||
add_email_template_custom_fields()
|
add_email_template_custom_fields()
|
||||||
add_default_industries()
|
add_default_industries()
|
||||||
add_default_lead_sources()
|
add_default_lead_sources()
|
||||||
|
add_standard_dropdown_items()
|
||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
|
|
||||||
|
|
||||||
@ -333,3 +334,18 @@ def add_default_lead_sources():
|
|||||||
doc = frappe.new_doc("CRM Lead Source")
|
doc = frappe.new_doc("CRM Lead Source")
|
||||||
doc.source_name = source
|
doc.source_name = source
|
||||||
doc.insert()
|
doc.insert()
|
||||||
|
|
||||||
|
|
||||||
|
def add_standard_dropdown_items():
|
||||||
|
crm_settings = frappe.get_single("FCRM Settings")
|
||||||
|
|
||||||
|
# don't add dropdown items if they're already present
|
||||||
|
if crm_settings.dropdown_items:
|
||||||
|
return
|
||||||
|
|
||||||
|
crm_settings.dropdown_items = []
|
||||||
|
|
||||||
|
for item in frappe.get_hooks("standard_dropdown_items"):
|
||||||
|
crm_settings.append("dropdown_items", item)
|
||||||
|
|
||||||
|
crm_settings.save()
|
||||||
|
|||||||
12
frontend/src/components/BrandLogo.vue
Normal file
12
frontend/src/components/BrandLogo.vue
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<template>
|
||||||
|
<div v-if="brand?.logo">
|
||||||
|
<img :src="brand.logo" class="h-full w-full object-cover" />
|
||||||
|
</div>
|
||||||
|
<CRMLogo v-else class="size-8 shrink-0 rounded" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import CRMLogo from '@/components/Icons/CRMLogo.vue'
|
||||||
|
|
||||||
|
const brand = defineModel()
|
||||||
|
</script>
|
||||||
@ -71,7 +71,6 @@
|
|||||||
</Section>
|
</Section>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<TrialBanner v-if="isFCSite.data" />
|
|
||||||
<div class="m-2 flex flex-col gap-1">
|
<div class="m-2 flex flex-col gap-1">
|
||||||
<SidebarLink
|
<SidebarLink
|
||||||
:label="isSidebarCollapsed ? __('Expand') : __('Collapse')"
|
:label="isSidebarCollapsed ? __('Expand') : __('Collapse')"
|
||||||
@ -229,13 +228,4 @@ function getIcon(routeName, icon) {
|
|||||||
return PinIcon
|
return PinIcon
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const isFCSite = createResource({
|
|
||||||
url: 'frappe.integrations.frappe_providers.frappecloud_billing.is_fc_site',
|
|
||||||
cache: 'isFCSite',
|
|
||||||
auto: true,
|
|
||||||
transform: (data) => Boolean(data),
|
|
||||||
})
|
|
||||||
|
|
||||||
provide('isFCSite', isFCSite)
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -66,7 +66,6 @@
|
|||||||
</Section>
|
</Section>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<TrialBanner v-if="isFCSite.data" />
|
|
||||||
</div>
|
</div>
|
||||||
</TransitionChild>
|
</TransitionChild>
|
||||||
<TransitionChild
|
<TransitionChild
|
||||||
@ -215,13 +214,4 @@ function getIcon(routeName, icon) {
|
|||||||
return PinIcon
|
return PinIcon
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const isFCSite = createResource({
|
|
||||||
url: 'frappe.integrations.frappe_providers.frappecloud_billing.is_fc_site',
|
|
||||||
cache: 'isFCSite',
|
|
||||||
auto: true,
|
|
||||||
transform: (data) => Boolean(data),
|
|
||||||
})
|
|
||||||
|
|
||||||
provide('isFCSite', isFCSite)
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dropdown :options="dropdownOptions" v-bind="$attrs">
|
<Dropdown :options="dropdownItems" v-bind="$attrs">
|
||||||
<template v-slot="{ open }">
|
<template v-slot="{ open }">
|
||||||
<button
|
<button
|
||||||
class="flex h-12 items-center rounded-md py-2 duration-300 ease-in-out"
|
class="flex h-12 items-center rounded-md py-2 duration-300 ease-in-out"
|
||||||
@ -11,19 +11,19 @@
|
|||||||
: 'w-52 px-2 hover:bg-surface-gray-3'
|
: 'w-52 px-2 hover:bg-surface-gray-3'
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<CRMLogo class="size-8 flex-shrink-0 rounded" />
|
<BrandLogo v-model="brand" class="h-8 max-w-16 flex-shrink-0" />
|
||||||
<div
|
<div
|
||||||
class="flex flex-1 flex-col text-left duration-300 ease-in-out"
|
class="flex flex-1 flex-col text-left duration-300 ease-in-out truncate"
|
||||||
:class="
|
:class="
|
||||||
isCollapsed
|
isCollapsed
|
||||||
? 'ml-0 w-0 overflow-hidden opacity-0'
|
? 'ml-0 w-0 overflow-hidden opacity-0'
|
||||||
: 'ml-2 w-auto opacity-100'
|
: 'ml-2 w-auto opacity-100'
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div class="text-base font-medium leading-none text-ink-gray-9">
|
<div class="text-base font-medium leading-none text-ink-gray-9 truncate">
|
||||||
{{ __('CRM') }}
|
{{ __(brand.name || 'CRM') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-1 text-sm leading-none text-ink-gray-7">
|
<div class="mt-1 text-sm leading-none text-ink-gray-7 truncate">
|
||||||
{{ user.full_name }}
|
{{ user.full_name }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -47,14 +47,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import CRMLogo from '@/components/Icons/CRMLogo.vue'
|
import BrandLogo from '@/components/BrandLogo.vue'
|
||||||
import Apps from '@/components/Apps.vue'
|
import Apps from '@/components/Apps.vue'
|
||||||
import { sessionStore } from '@/stores/session'
|
import { sessionStore } from '@/stores/session'
|
||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
|
import { getSettings } from '@/stores/settings'
|
||||||
import { showSettings } from '@/composables/settings'
|
import { showSettings } from '@/composables/settings'
|
||||||
import { Dropdown } from 'frappe-ui'
|
import { Dropdown } from 'frappe-ui'
|
||||||
import { useStorage } from '@vueuse/core'
|
import { useStorage } from '@vueuse/core'
|
||||||
import { computed, ref, markRaw, inject, onMounted } from 'vue'
|
import { computed, markRaw, onMounted } from 'vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
isCollapsed: {
|
isCollapsed: {
|
||||||
@ -63,62 +64,103 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const { settings, brand } = getSettings()
|
||||||
const { logout } = sessionStore()
|
const { logout } = sessionStore()
|
||||||
const { getUser } = usersStore()
|
const { getUser } = usersStore()
|
||||||
|
|
||||||
const user = computed(() => getUser() || {})
|
const user = computed(() => getUser() || {})
|
||||||
|
|
||||||
const isFCSite = inject('isFCSite')
|
|
||||||
const theme = useStorage('theme', 'light')
|
const theme = useStorage('theme', 'light')
|
||||||
|
|
||||||
let dropdownOptions = ref([
|
const dropdownItems = computed(() => {
|
||||||
{
|
if (!settings.value?.dropdown_items) return []
|
||||||
group: 'Manage',
|
|
||||||
hideLabel: true,
|
let items = settings.value.dropdown_items
|
||||||
items: [
|
|
||||||
{
|
let _dropdownItems = [
|
||||||
|
{
|
||||||
|
group: 'Dropdown Items',
|
||||||
|
hideLabel: true,
|
||||||
|
items: [],
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
items.forEach((item) => {
|
||||||
|
if (item.hidden) return
|
||||||
|
if (item.type !== 'Separator') {
|
||||||
|
_dropdownItems[_dropdownItems.length - 1].items.push(
|
||||||
|
dropdownItemObj(item),
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
_dropdownItems.push({
|
||||||
|
group: '',
|
||||||
|
hideLabel: true,
|
||||||
|
items: [],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return _dropdownItems
|
||||||
|
})
|
||||||
|
|
||||||
|
function dropdownItemObj(item) {
|
||||||
|
let openInNewWindow = item.open_in_new_window
|
||||||
|
|
||||||
|
let icon = item.icon || 'external-link'
|
||||||
|
if (typeof icon === 'string' && icon.startsWith('<svg')) {
|
||||||
|
icon = markRaw({ template: icon })
|
||||||
|
}
|
||||||
|
item.icon = icon
|
||||||
|
|
||||||
|
if (item.is_standard) {
|
||||||
|
return getStandardItem(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
icon: item.icon,
|
||||||
|
label: __(item.label),
|
||||||
|
onClick: () => window.open(item.url, openInNewWindow ? '_blank' : ''),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getStandardItem(item) {
|
||||||
|
switch (item.name1) {
|
||||||
|
case 'app_selector':
|
||||||
|
return {
|
||||||
component: markRaw(Apps),
|
component: markRaw(Apps),
|
||||||
},
|
}
|
||||||
{
|
case 'support_link':
|
||||||
icon: 'life-buoy',
|
return {
|
||||||
label: computed(() => __('Support')),
|
icon: item.icon,
|
||||||
onClick: () => window.open('https://t.me/frappecrm', '_blank'),
|
label: __(item.label),
|
||||||
},
|
onClick: () => window.open(item.route, '_blank'),
|
||||||
{
|
}
|
||||||
icon: 'book-open',
|
case 'docs_link':
|
||||||
label: computed(() => __('Docs')),
|
return {
|
||||||
onClick: () => window.open('https://docs.frappe.io/crm', '_blank'),
|
icon: item.icon,
|
||||||
},
|
label: __(item.label),
|
||||||
],
|
onClick: () => window.open(item.route, '_blank'),
|
||||||
},
|
}
|
||||||
{
|
case 'toggle_theme':
|
||||||
group: 'Others',
|
return {
|
||||||
hideLabel: true,
|
icon: theme.value === 'dark' ? 'sun' : item.icon,
|
||||||
items: [
|
label: __(item.label),
|
||||||
{
|
|
||||||
icon: computed(() => (theme.value === 'dark' ? 'moon' : 'sun')),
|
|
||||||
label: computed(() => __('Toggle theme')),
|
|
||||||
onClick: toggleTheme,
|
onClick: toggleTheme,
|
||||||
},
|
}
|
||||||
{
|
case 'settings':
|
||||||
icon: 'credit-card',
|
return {
|
||||||
label: computed(() => __('Billing')),
|
icon: item.icon,
|
||||||
onClick: () => (window.location.href = '/billing'),
|
label: __(item.label),
|
||||||
condition: () => isFCSite.data,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: 'settings',
|
|
||||||
label: computed(() => __('Settings')),
|
|
||||||
onClick: () => (showSettings.value = true),
|
onClick: () => (showSettings.value = true),
|
||||||
},
|
}
|
||||||
{
|
case 'logout':
|
||||||
icon: 'log-out',
|
return {
|
||||||
label: computed(() => __('Log out')),
|
icon: item.icon,
|
||||||
|
label: __(item.label),
|
||||||
onClick: () => logout.submit(),
|
onClick: () => logout.submit(),
|
||||||
},
|
}
|
||||||
],
|
}
|
||||||
},
|
}
|
||||||
])
|
|
||||||
|
|
||||||
function toggleTheme() {
|
function toggleTheme() {
|
||||||
const currentTheme = document.documentElement.getAttribute('data-theme')
|
const currentTheme = document.documentElement.getAttribute('data-theme')
|
||||||
|
|||||||
@ -224,6 +224,7 @@ import GroupBy from '@/components/GroupBy.vue'
|
|||||||
import FadedScrollableDiv from '@/components/FadedScrollableDiv.vue'
|
import FadedScrollableDiv from '@/components/FadedScrollableDiv.vue'
|
||||||
import ColumnSettings from '@/components/ColumnSettings.vue'
|
import ColumnSettings from '@/components/ColumnSettings.vue'
|
||||||
import KanbanSettings from '@/components/Kanban/KanbanSettings.vue'
|
import KanbanSettings from '@/components/Kanban/KanbanSettings.vue'
|
||||||
|
import { getSettings } from '@/stores/settings'
|
||||||
import { globalStore } from '@/stores/global'
|
import { globalStore } from '@/stores/global'
|
||||||
import { viewsStore } from '@/stores/views'
|
import { viewsStore } from '@/stores/views'
|
||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
@ -260,6 +261,7 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const { brand } = getSettings()
|
||||||
const { $dialog } = globalStore()
|
const { $dialog } = globalStore()
|
||||||
const { reload: reloadView, getView } = viewsStore()
|
const { reload: reloadView, getView } = viewsStore()
|
||||||
const { isManager } = usersStore()
|
const { isManager } = usersStore()
|
||||||
@ -320,6 +322,7 @@ usePageMeta(() => {
|
|||||||
return {
|
return {
|
||||||
title: label,
|
title: label,
|
||||||
emoji: isEmoji(currentView.value.icon) ? currentView.value.icon : '',
|
emoji: isEmoji(currentView.value.icon) ? currentView.value.icon : '',
|
||||||
|
icon: brand.favicon,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -214,6 +214,7 @@ import SidePanelModal from '@/components/Modals/SidePanelModal.vue'
|
|||||||
import AddressModal from '@/components/Modals/AddressModal.vue'
|
import AddressModal from '@/components/Modals/AddressModal.vue'
|
||||||
import { formatDate, timeAgo, createToast } from '@/utils'
|
import { formatDate, timeAgo, createToast } from '@/utils'
|
||||||
import { getView } from '@/utils/view'
|
import { getView } from '@/utils/view'
|
||||||
|
import { getSettings } from '@/stores/settings'
|
||||||
import { getMeta } from '@/stores/meta'
|
import { getMeta } from '@/stores/meta'
|
||||||
import { globalStore } from '@/stores/global.js'
|
import { globalStore } from '@/stores/global.js'
|
||||||
import { usersStore } from '@/stores/users.js'
|
import { usersStore } from '@/stores/users.js'
|
||||||
@ -233,6 +234,7 @@ import {
|
|||||||
import { ref, computed, h } from 'vue'
|
import { ref, computed, h } from 'vue'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
|
|
||||||
|
const { brand } = getSettings()
|
||||||
const { $dialog, makeCall } = globalStore()
|
const { $dialog, makeCall } = globalStore()
|
||||||
|
|
||||||
const { getUser, isManager } = usersStore()
|
const { getUser, isManager } = usersStore()
|
||||||
@ -298,6 +300,7 @@ const breadcrumbs = computed(() => {
|
|||||||
usePageMeta(() => {
|
usePageMeta(() => {
|
||||||
return {
|
return {
|
||||||
title: contact.data?.full_name || contact.data?.name,
|
title: contact.data?.full_name || contact.data?.name,
|
||||||
|
icon: brand.favicon,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -363,6 +363,7 @@ import {
|
|||||||
copyToClipboard,
|
copyToClipboard,
|
||||||
} from '@/utils'
|
} from '@/utils'
|
||||||
import { getView } from '@/utils/view'
|
import { getView } from '@/utils/view'
|
||||||
|
import { getSettings } from '@/stores/settings'
|
||||||
import { globalStore } from '@/stores/global'
|
import { globalStore } from '@/stores/global'
|
||||||
import { statusesStore } from '@/stores/statuses'
|
import { statusesStore } from '@/stores/statuses'
|
||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
@ -381,6 +382,7 @@ import { ref, computed, h, onMounted, onBeforeUnmount } from 'vue'
|
|||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import { useActiveTabManager } from '@/composables/useActiveTabManager'
|
import { useActiveTabManager } from '@/composables/useActiveTabManager'
|
||||||
|
|
||||||
|
const { brand } = getSettings()
|
||||||
const { $dialog, $socket, makeCall } = globalStore()
|
const { $dialog, $socket, makeCall } = globalStore()
|
||||||
const { statusOptions, getDealStatus } = statusesStore()
|
const { statusOptions, getDealStatus } = statusesStore()
|
||||||
const { isManager } = usersStore()
|
const { isManager } = usersStore()
|
||||||
@ -540,6 +542,7 @@ const breadcrumbs = computed(() => {
|
|||||||
usePageMeta(() => {
|
usePageMeta(() => {
|
||||||
return {
|
return {
|
||||||
title: organization.data?.name || deal.data?.name,
|
title: organization.data?.name || deal.data?.name,
|
||||||
|
icon: brand.favicon,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -333,6 +333,7 @@ import {
|
|||||||
copyToClipboard,
|
copyToClipboard,
|
||||||
} from '@/utils'
|
} from '@/utils'
|
||||||
import { getView } from '@/utils/view'
|
import { getView } from '@/utils/view'
|
||||||
|
import { getSettings } from '@/stores/settings'
|
||||||
import { globalStore } from '@/stores/global'
|
import { globalStore } from '@/stores/global'
|
||||||
import { contactsStore } from '@/stores/contacts'
|
import { contactsStore } from '@/stores/contacts'
|
||||||
import { statusesStore } from '@/stores/statuses'
|
import { statusesStore } from '@/stores/statuses'
|
||||||
@ -355,6 +356,7 @@ import { ref, computed, onMounted, watch } from 'vue'
|
|||||||
import { useRouter, useRoute } from 'vue-router'
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
import { useActiveTabManager } from '@/composables/useActiveTabManager'
|
import { useActiveTabManager } from '@/composables/useActiveTabManager'
|
||||||
|
|
||||||
|
const { brand } = getSettings()
|
||||||
const { $dialog, $socket, makeCall } = globalStore()
|
const { $dialog, $socket, makeCall } = globalStore()
|
||||||
const { getContactByName, contacts } = contactsStore()
|
const { getContactByName, contacts } = contactsStore()
|
||||||
const { statusOptions, getLeadStatus } = statusesStore()
|
const { statusOptions, getLeadStatus } = statusesStore()
|
||||||
@ -485,6 +487,7 @@ const breadcrumbs = computed(() => {
|
|||||||
usePageMeta(() => {
|
usePageMeta(() => {
|
||||||
return {
|
return {
|
||||||
title: lead.data?.lead_name || lead.data?.name,
|
title: lead.data?.lead_name || lead.data?.name,
|
||||||
|
icon: brand.favicon,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -189,6 +189,7 @@ import DealsListView from '@/components/ListViews/DealsListView.vue'
|
|||||||
import AddressModal from '@/components/Modals/AddressModal.vue'
|
import AddressModal from '@/components/Modals/AddressModal.vue'
|
||||||
import { formatDate, timeAgo, createToast } from '@/utils'
|
import { formatDate, timeAgo, createToast } from '@/utils'
|
||||||
import { getView } from '@/utils/view'
|
import { getView } from '@/utils/view'
|
||||||
|
import { getSettings } from '@/stores/settings'
|
||||||
import { getMeta } from '@/stores/meta'
|
import { getMeta } from '@/stores/meta'
|
||||||
import { globalStore } from '@/stores/global.js'
|
import { globalStore } from '@/stores/global.js'
|
||||||
import { usersStore } from '@/stores/users.js'
|
import { usersStore } from '@/stores/users.js'
|
||||||
@ -208,6 +209,7 @@ import {
|
|||||||
import { ref, computed, h } from 'vue'
|
import { ref, computed, h } from 'vue'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
|
|
||||||
|
const { brand } = getSettings()
|
||||||
const { $dialog, makeCall } = globalStore()
|
const { $dialog, makeCall } = globalStore()
|
||||||
|
|
||||||
const { getUser } = usersStore()
|
const { getUser } = usersStore()
|
||||||
@ -272,6 +274,7 @@ const breadcrumbs = computed(() => {
|
|||||||
usePageMeta(() => {
|
usePageMeta(() => {
|
||||||
return {
|
return {
|
||||||
title: contact.data?.full_name || contact.data?.name,
|
title: contact.data?.full_name || contact.data?.name,
|
||||||
|
icon: brand.favicon,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -273,6 +273,7 @@ import SLASection from '@/components/SLASection.vue'
|
|||||||
import CustomActions from '@/components/CustomActions.vue'
|
import CustomActions from '@/components/CustomActions.vue'
|
||||||
import { createToast, setupAssignees, setupCustomizations } from '@/utils'
|
import { createToast, setupAssignees, setupCustomizations } from '@/utils'
|
||||||
import { getView } from '@/utils/view'
|
import { getView } from '@/utils/view'
|
||||||
|
import { getSettings } from '@/stores/settings'
|
||||||
import { globalStore } from '@/stores/global'
|
import { globalStore } from '@/stores/global'
|
||||||
import { statusesStore } from '@/stores/statuses'
|
import { statusesStore } from '@/stores/statuses'
|
||||||
import {
|
import {
|
||||||
@ -288,10 +289,12 @@ import {
|
|||||||
Tabs,
|
Tabs,
|
||||||
Breadcrumbs,
|
Breadcrumbs,
|
||||||
call,
|
call,
|
||||||
|
usePageMeta
|
||||||
} from 'frappe-ui'
|
} from 'frappe-ui'
|
||||||
import { ref, computed, h, onMounted } from 'vue'
|
import { ref, computed, h, onMounted } from 'vue'
|
||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
|
|
||||||
|
const { brand } = getSettings()
|
||||||
const { $dialog, $socket } = globalStore()
|
const { $dialog, $socket } = globalStore()
|
||||||
const { statusOptions, getDealStatus } = statusesStore()
|
const { statusOptions, getDealStatus } = statusesStore()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
@ -430,6 +433,13 @@ const breadcrumbs = computed(() => {
|
|||||||
return items
|
return items
|
||||||
})
|
})
|
||||||
|
|
||||||
|
usePageMeta(() => {
|
||||||
|
return {
|
||||||
|
title: organization.data?.name || deal.data?.name,
|
||||||
|
icon: brand.favicon,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const tabs = computed(() => {
|
const tabs = computed(() => {
|
||||||
let tabOptions = [
|
let tabOptions = [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -195,6 +195,7 @@ import SLASection from '@/components/SLASection.vue'
|
|||||||
import CustomActions from '@/components/CustomActions.vue'
|
import CustomActions from '@/components/CustomActions.vue'
|
||||||
import { createToast, setupAssignees, setupCustomizations } from '@/utils'
|
import { createToast, setupAssignees, setupCustomizations } from '@/utils'
|
||||||
import { getView } from '@/utils/view'
|
import { getView } from '@/utils/view'
|
||||||
|
import { getSettings } from '@/stores/settings'
|
||||||
import { globalStore } from '@/stores/global'
|
import { globalStore } from '@/stores/global'
|
||||||
import { contactsStore } from '@/stores/contacts'
|
import { contactsStore } from '@/stores/contacts'
|
||||||
import { statusesStore } from '@/stores/statuses'
|
import { statusesStore } from '@/stores/statuses'
|
||||||
@ -211,10 +212,12 @@ import {
|
|||||||
Switch,
|
Switch,
|
||||||
Breadcrumbs,
|
Breadcrumbs,
|
||||||
call,
|
call,
|
||||||
|
usePageMeta,
|
||||||
} from 'frappe-ui'
|
} from 'frappe-ui'
|
||||||
import { ref, computed, onMounted, watch } from 'vue'
|
import { ref, computed, onMounted, watch } from 'vue'
|
||||||
import { useRouter, useRoute } from 'vue-router'
|
import { useRouter, useRoute } from 'vue-router'
|
||||||
|
|
||||||
|
const { brand } = getSettings()
|
||||||
const { $dialog, $socket } = globalStore()
|
const { $dialog, $socket } = globalStore()
|
||||||
const { getContactByName, contacts } = contactsStore()
|
const { getContactByName, contacts } = contactsStore()
|
||||||
const { statusOptions, getLeadStatus } = statusesStore()
|
const { statusOptions, getLeadStatus } = statusesStore()
|
||||||
@ -339,6 +342,13 @@ const breadcrumbs = computed(() => {
|
|||||||
return items
|
return items
|
||||||
})
|
})
|
||||||
|
|
||||||
|
usePageMeta(() => {
|
||||||
|
return {
|
||||||
|
title: lead.data?.lead_name || lead.data?.name,
|
||||||
|
icon: brand.favicon,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const tabs = computed(() => {
|
const tabs = computed(() => {
|
||||||
let tabOptions = [
|
let tabOptions = [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -177,6 +177,7 @@ import DetailsIcon from '@/components/Icons/DetailsIcon.vue'
|
|||||||
import CameraIcon from '@/components/Icons/CameraIcon.vue'
|
import CameraIcon from '@/components/Icons/CameraIcon.vue'
|
||||||
import DealsIcon from '@/components/Icons/DealsIcon.vue'
|
import DealsIcon from '@/components/Icons/DealsIcon.vue'
|
||||||
import ContactsIcon from '@/components/Icons/ContactsIcon.vue'
|
import ContactsIcon from '@/components/Icons/ContactsIcon.vue'
|
||||||
|
import { getSettings } from '@/stores/settings'
|
||||||
import { getMeta } from '@/stores/meta'
|
import { getMeta } from '@/stores/meta'
|
||||||
import { globalStore } from '@/stores/global'
|
import { globalStore } from '@/stores/global'
|
||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
@ -205,6 +206,7 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const { brand } = getSettings()
|
||||||
const { getUser } = usersStore()
|
const { getUser } = usersStore()
|
||||||
const { $dialog } = globalStore()
|
const { $dialog } = globalStore()
|
||||||
const { getDealStatus } = statusesStore()
|
const { getDealStatus } = statusesStore()
|
||||||
@ -266,6 +268,7 @@ const breadcrumbs = computed(() => {
|
|||||||
usePageMeta(() => {
|
usePageMeta(() => {
|
||||||
return {
|
return {
|
||||||
title: props.organizationId,
|
title: props.organizationId,
|
||||||
|
icon: brand.favicon,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -212,6 +212,7 @@ import EditIcon from '@/components/Icons/EditIcon.vue'
|
|||||||
import CameraIcon from '@/components/Icons/CameraIcon.vue'
|
import CameraIcon from '@/components/Icons/CameraIcon.vue'
|
||||||
import DealsIcon from '@/components/Icons/DealsIcon.vue'
|
import DealsIcon from '@/components/Icons/DealsIcon.vue'
|
||||||
import ContactsIcon from '@/components/Icons/ContactsIcon.vue'
|
import ContactsIcon from '@/components/Icons/ContactsIcon.vue'
|
||||||
|
import { getSettings } from '@/stores/settings'
|
||||||
import { getMeta } from '@/stores/meta'
|
import { getMeta } from '@/stores/meta'
|
||||||
import { globalStore } from '@/stores/global'
|
import { globalStore } from '@/stores/global'
|
||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
@ -241,6 +242,7 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const { brand } = getSettings()
|
||||||
const { getUser, isManager } = usersStore()
|
const { getUser, isManager } = usersStore()
|
||||||
const { $dialog } = globalStore()
|
const { $dialog } = globalStore()
|
||||||
const { getDealStatus } = statusesStore()
|
const { getDealStatus } = statusesStore()
|
||||||
@ -304,6 +306,7 @@ const breadcrumbs = computed(() => {
|
|||||||
usePageMeta(() => {
|
usePageMeta(() => {
|
||||||
return {
|
return {
|
||||||
title: props.organizationId,
|
title: props.organizationId,
|
||||||
|
icon: brand.favicon,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
24
frontend/src/stores/settings.js
Normal file
24
frontend/src/stores/settings.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import { createDocumentResource } from 'frappe-ui'
|
||||||
|
import { reactive, ref } from 'vue'
|
||||||
|
|
||||||
|
const settings = ref({})
|
||||||
|
const brand = reactive({})
|
||||||
|
|
||||||
|
export function getSettings() {
|
||||||
|
createDocumentResource({
|
||||||
|
doctype: 'FCRM Settings',
|
||||||
|
name: 'FCRM Settings',
|
||||||
|
onSuccess: (data) => {
|
||||||
|
settings.value = data
|
||||||
|
brand.name = settings.value?.brand_name
|
||||||
|
brand.logo = settings.value?.brand_logo
|
||||||
|
brand.favicon = settings.value?.favicon
|
||||||
|
return data
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
settings,
|
||||||
|
brand,
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user