Skip to content

Commit

Permalink
feat: added erpnext crm settings in crm settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Sep 12, 2024
1 parent 49082be commit b4ec5b0
Show file tree
Hide file tree
Showing 9 changed files with 105 additions and 1 deletion.
Empty file.
8 changes: 8 additions & 0 deletions crm/fcrm/doctype/erpnext_crm_settings/erpnext_crm_settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt

// frappe.ui.form.on("ERPNext CRM Settings", {
// refresh(frm) {

// },
// });
41 changes: 41 additions & 0 deletions crm/fcrm/doctype/erpnext_crm_settings/erpnext_crm_settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2024-09-11 12:05:10.521334",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"enabled"
],
"fields": [
{
"default": "0",
"fieldname": "enabled",
"fieldtype": "Check",
"label": "Enabled"
}
],
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2024-09-11 12:05:24.904254",
"modified_by": "Administrator",
"module": "FCRM",
"name": "ERPNext CRM Settings",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"print": 1,
"read": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"sort_field": "creation",
"sort_order": "DESC",
"states": []
}
9 changes: 9 additions & 0 deletions crm/fcrm/doctype/erpnext_crm_settings/erpnext_crm_settings.py
Original file line number Diff line number Diff line change
@@ -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 ERPNextCRMSettings(Document):
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt

# import frappe
from frappe.tests.utils import FrappeTestCase


class TestERPNextCRMSettings(FrappeTestCase):
pass
20 changes: 20 additions & 0 deletions frontend/src/components/Icons/ERPNextIcon.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<template>
<svg
width="18"
height="18"
viewBox="0 0 18 18"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M1 5C1 2.79086 2.79086 1 5 1H13C15.2091 1 17 2.79086 17 5V13C17 15.2091 15.2091 17 13 17H5C2.79086 17 1 15.2091 1 13V5Z"
stroke="currentColor"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M11.7819 6.27142H11.5136H8.02453H6.28001V4.84002H11.7819V6.27142ZM8.02451 9.62623V11.5944H11.8267V13.0258H6.27999V8.19484H8.02451H11.5135V9.62623H8.02451Z"
fill="currentColor"
/>
</svg>
</template>
6 changes: 6 additions & 0 deletions frontend/src/components/Settings/ERPNextSettings.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<template>
<SettingsPage doctype="ERPNext CRM Settings" :label="__('ERPNext Settings')" class="p-8" />
</template>
<script setup>
import SettingsPage from '@/components/Settings/SettingsPage.vue'
</script>
7 changes: 7 additions & 0 deletions frontend/src/components/Settings/SettingsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@
<script setup>
import ContactsIcon from '@/components/Icons/ContactsIcon.vue'
import WhatsAppIcon from '@/components/Icons/WhatsAppIcon.vue'
import ERPNextIcon from '@/components/Icons/ERPNextIcon.vue'
import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
import InviteMemberPage from '@/components/Settings/InviteMemberPage.vue'
import ProfileSettings from '@/components/Settings/ProfileSettings.vue'
import WhatsAppSettings from '@/components/Settings/WhatsAppSettings.vue'
import ERPNextSettings from '@/components/Settings/ERPNextSettings.vue'
import TwilioSettings from '@/components/Settings/TwilioSettings.vue'
import SidebarLink from '@/components/SidebarLink.vue'
import { isWhatsappInstalled } from '@/composables/settings'
Expand Down Expand Up @@ -83,6 +85,11 @@ const tabs = computed(() => {
component: markRaw(WhatsAppSettings),
condition: () => isWhatsappInstalled.value,
},
{
label: __('ERPNext'),
icon: ERPNextIcon,
component: markRaw(ERPNextSettings),
},
],
},
]
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/components/Settings/SettingsPage.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="flex h-full flex-col gap-8">
<h2 class="flex gap-2 text-xl font-semibold leading-none h-5">
<div>{{ __(doctype) }}</div>
<div>{{ __(label || doctype) }}</div>
<Badge
v-if="data.isDirty"
:label="__('Not Saved')"
Expand Down Expand Up @@ -44,6 +44,10 @@ const props = defineProps({
type: String,
required: true,
},
label: {
type: String,
default: '',
},
})
const fields = createResource({
Expand Down

0 comments on commit b4ec5b0

Please sign in to comment.