Skip to content

Commit

Permalink
Merge pull request #114 from 8848digital/category
Browse files Browse the repository at this point in the history
fix: Case Study
  • Loading branch information
shyam-kumar8848 authored Nov 29, 2024
2 parents df23e18 + 73500f6 commit b79e246
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ def get_case_study_listing(**kwargs):
page_no = 0
start = page_no * limit

print("limit:", limit)
print("page_no:", page_no)

response = []
filters = {"publish_on_site": 1}

Expand All @@ -28,12 +25,10 @@ def get_case_study_listing(**kwargs):
tab_list = get_tab_details()

total_count = frappe.db.count("Case Study", filters=filters)
print("total_count:", total_count)

case_study_doctypes_list = frappe.get_all(
"Case Study", filters=filters, pluck="name", limit=limit, start=start
)
print("case_study_doctypes_list:", case_study_doctypes_list)

if case_study_doctypes_list:
for doctype in case_study_doctypes_list:
Expand Down
8 changes: 3 additions & 5 deletions digital_8848/digital_8848/doctype/case_study/case_study.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,12 @@
{
"fieldname": "cta_btn_url",
"fieldtype": "Data",
"label": "Cta Btn URL",
"mandatory_depends_on": "eval: doc.cta_btn_text"
"label": "Cta Btn URL"
},
{
"fieldname": "cta_btn_text",
"fieldtype": "Data",
"label": "Cta Btn Text",
"mandatory_depends_on": "eval: doc.cta_btn_url"
"label": "Cta Btn Text"
},
{
"fieldname": "btn_description",
Expand All @@ -338,7 +336,7 @@
"index_web_pages_for_search": 1,
"links": [],
"make_attachments_public": 1,
"modified": "2024-11-26 18:48:23.726523",
"modified": "2024-11-29 11:02:59.339420",
"modified_by": "Administrator",
"module": "digital_8848",
"name": "Case Study",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,18 +214,19 @@ def get_case_study_details(expertise_doctype):
return {"case_study_details": []} # Return an empty dictionary under case_study_details key

case_study_doc = frappe.get_doc("Case Study", case_study_title)
final_url = case_study_doc.get("button_url") if case_study_doc.get("use_button_url") else case_study_doc.get("url")
case_study_doctype_details = {
"title": case_study_doc.get("title") or None,
"image": case_study_doc.get("image") or None,
"short_description": case_study_doc.get("short_description") or None,
"truncate_text": case_study_doc.get("truncate_text_1") or None,
"slug": case_study_doc.get("slug") or None,
"url": case_study_doc.get("url") or None,
"url": final_url, # Use the determined URL
"type": case_study_doc.get("type") or None,
"tag_detail": get_tag_details(case_study_doc) or []
}
# Return under the single key case_study_details
return {"case_study_details": [case_study_doctype_details]}



def get_faq_details(expertise_doctype):
Expand Down
8 changes: 3 additions & 5 deletions digital_8848/digital_8848/doctype/expertise/expertise.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,14 +358,12 @@
{
"fieldname": "cta_btn_url",
"fieldtype": "Data",
"label": "Cta Btn URL",
"mandatory_depends_on": "eval: doc.cta_btn_text"
"label": "Cta Btn URL"
},
{
"fieldname": "cta_btn_text",
"fieldtype": "Data",
"label": "Cta Btn Text",
"mandatory_depends_on": "eval: doc.cta_btn_url"
"label": "Cta Btn Text"
},
{
"fieldname": "section_break_lkyc",
Expand All @@ -380,7 +378,7 @@
"index_web_pages_for_search": 1,
"links": [],
"make_attachments_public": 1,
"modified": "2024-11-26 18:49:37.408616",
"modified": "2024-11-29 11:03:36.189476",
"modified_by": "Administrator",
"module": "digital_8848",
"name": "Expertise",
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) 2024, digital_8848 and contributors
// For license information, please see license.txt

// frappe.ui.form.on("Google Analytics", {
// refresh(frm) {

// },
// });
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"actions": [],
"allow_rename": 1,
"creation": "2024-11-28 18:16:45.093879",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"google_analytics_id"
],
"fields": [
{
"fieldname": "google_analytics_id",
"fieldtype": "Data",
"label": "Google Analytics ID"
}
],
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2024-11-28 18:17:18.770209",
"modified_by": "Administrator",
"module": "digital_8848",
"name": "Google Analytics",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"print": 1,
"read": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2024, digital_8848 and contributors
# For license information, please see license.txt

# import frappe
from frappe.model.document import Document


class GoogleAnalytics(Document):
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2024, digital_8848 and Contributors
# See license.txt

# import frappe
from frappe.tests.utils import FrappeTestCase


class TestGoogleAnalytics(FrappeTestCase):
pass

0 comments on commit b79e246

Please sign in to comment.