From f8512cb4a0b2f0ce0de91397ec3e4a3811acf400 Mon Sep 17 00:00:00 2001 From: RitvikSardana Date: Thu, 24 Oct 2024 14:17:40 +0530 Subject: [PATCH 1/6] fix: custom fields in filters in customer portal --- helpdesk/api/doc.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/helpdesk/api/doc.py b/helpdesk/api/doc.py index 9369dd91c..06007ee28 100644 --- a/helpdesk/api/doc.py +++ b/helpdesk/api/doc.py @@ -68,23 +68,28 @@ def get_filterable_fields(doctype: str, show_customer_portal_fields=False): ) # for customer portal show only fields present in customer_portal_fields - if show_customer_portal_fields: from_doc_fields = from_doc_fields.where( QBDocField.fieldname.isin(customer_portal_fields) ) - from_custom_fields = from_custom_fields.where( - QBCustomField.fieldname.isin(visible_custom_fields) - ) + if len(visible_custom_fields) > 0: + from_custom_fields = from_custom_fields.where( + QBCustomField.fieldname.isin(visible_custom_fields) + ) + from_custom_fields = from_custom_fields.run(as_dict=True) + else: + from_custom_fields = [] - from_doc_fields = from_doc_fields.run(as_dict=True) - from_custom_fields = from_custom_fields.run(as_dict=True) + if not show_customer_portal_fields: + from_custom_fields = from_custom_fields.run(as_dict=True) + from_doc_fields = from_doc_fields.run(as_dict=True) # from hd ticket template get children with fieldname and hidden_from_customer res = [] res.extend(from_doc_fields) # TODO: Ritvik => till a better way we have for custom fields, just show custom fields + res.extend(from_custom_fields) if not show_customer_portal_fields: res.append( From 097bdf62ce93f27a1615808bf6e8eec0669653f0 Mon Sep 17 00:00:00 2001 From: RitvikSardana Date: Thu, 24 Oct 2024 14:35:27 +0530 Subject: [PATCH 2/6] fix(styles): article page --- desk/src/pages/KnowledgeBaseArticle.vue | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/desk/src/pages/KnowledgeBaseArticle.vue b/desk/src/pages/KnowledgeBaseArticle.vue index 6581796d7..1af81d31b 100644 --- a/desk/src/pages/KnowledgeBaseArticle.vue +++ b/desk/src/pages/KnowledgeBaseArticle.vue @@ -1,10 +1,10 @@