From 13f2724f6d50fab432438f3f8781170fb7ff6245 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 12 Jun 2024 13:45:57 +0530 Subject: [PATCH] fix: render twilio/whatsapp settings fields on settings modal --- crm/api/doc.py | 5 +- .../components/Settings/TwilioSettings.vue | 66 ++++++++++++++++- .../components/Settings/WhatsAppSettings.vue | 73 ++++++++++++++++++- 3 files changed, 139 insertions(+), 5 deletions(-) diff --git a/crm/api/doc.py b/crm/api/doc.py index f8e20b85..0c535e99 100644 --- a/crm/api/doc.py +++ b/crm/api/doc.py @@ -534,8 +534,10 @@ def get_assigned_users(doctype, name, default_assigned_to=None): @frappe.whitelist() -def get_fields(doctype: str): +def get_fields(doctype: str, allow_all_fieldtypes: bool = False): not_allowed_fieldtypes = list(frappe.model.no_value_fields) + ["Read Only"] + if allow_all_fieldtypes: + not_allowed_fieldtypes = [] fields = frappe.get_meta(doctype).fields _fields = [] @@ -553,6 +555,7 @@ def get_fields(doctype: str): "type": field.fieldtype, "value": field.fieldname, "options": field.options, + "mandatory": field.reqd, }) return _fields \ No newline at end of file diff --git a/frontend/src/components/Settings/TwilioSettings.vue b/frontend/src/components/Settings/TwilioSettings.vue index ba955dc3..2842d1bf 100644 --- a/frontend/src/components/Settings/TwilioSettings.vue +++ b/frontend/src/components/Settings/TwilioSettings.vue @@ -1,3 +1,65 @@ \ No newline at end of file +
+

+ {{ __('Twilio Settings') }} +

+
+ +
+
+
+
+ + diff --git a/frontend/src/components/Settings/WhatsAppSettings.vue b/frontend/src/components/Settings/WhatsAppSettings.vue index cd50fdb3..6023a2b7 100644 --- a/frontend/src/components/Settings/WhatsAppSettings.vue +++ b/frontend/src/components/Settings/WhatsAppSettings.vue @@ -1,3 +1,72 @@ \ No newline at end of file +
+

+ {{ __('WhatsApp Settings') }} +

+
+ +
+
+
+
+ +