From 684ab8871e7323664c2b79f5d635ec884c035ddd Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Sun, 4 Feb 2024 18:22:24 +0530 Subject: [PATCH] feat: added view controls on notes view --- crm/fcrm/doctype/crm_note/crm_note.py | 12 ++++++- frontend/src/components/ViewControls.vue | 12 +++++-- frontend/src/pages/Notes.vue | 40 +++++++++++++++--------- 3 files changed, 47 insertions(+), 17 deletions(-) diff --git a/crm/fcrm/doctype/crm_note/crm_note.py b/crm/fcrm/doctype/crm_note/crm_note.py index b042398a..3aa65aa3 100644 --- a/crm/fcrm/doctype/crm_note/crm_note.py +++ b/crm/fcrm/doctype/crm_note/crm_note.py @@ -6,4 +6,14 @@ from frappe.model.document import Document class CRMNote(Document): - pass + @staticmethod + def default_list_data(): + rows = [ + "name", + "title", + "content", + "reference_doctype", + "reference_docname", + "modified", + ] + return {'columns': [], 'rows': rows} diff --git a/frontend/src/components/ViewControls.vue b/frontend/src/components/ViewControls.vue index c59aafa9..680ed93c 100644 --- a/frontend/src/components/ViewControls.vue +++ b/frontend/src/components/ViewControls.vue @@ -41,6 +41,7 @@ /> { let _view = getView(route.query.view) return { - label: _view?.label || 'List View', + label: _view?.label || props.options?.defaultViewName || 'List View', icon: _view?.icon || 'list', } }) @@ -232,7 +240,7 @@ function reload() { const defaultViews = [ { - label: 'List View', + label: props.options?.defaultViewName || 'List View', icon: 'list', onClick() { viewUpdated.value = false diff --git a/frontend/src/pages/Notes.vue b/frontend/src/pages/Notes.vue index 96652d63..1041be15 100644 --- a/frontend/src/pages/Notes.vue +++ b/frontend/src/pages/Notes.vue @@ -9,12 +9,21 @@ +
@@ -61,6 +70,16 @@
+