From 3d9acc82fc5a9be298605b5960e687e62b5d5dcc Mon Sep 17 00:00:00 2001 From: venkataakhil Date: Thu, 10 Aug 2023 14:27:14 +0530 Subject: [PATCH] remove logs and console --- smart_service/apis/v2/master.py | 12 +- .../doctype/feature_finder/feature_finder.js | 181 +++--------------- .../feature_finder/feature_finder.json | 15 +- .../feature_finder_specification_master.js | 31 ++- .../feature_finder_specification_master.json | 4 +- .../doctype/publish_test/publish_test.js | 7 +- .../doctype/publish_test/publish_test.json | 2 +- .../doctype/publish_test/publish_test.py | 20 +- .../repair_service_mapping.js | 3 +- .../repair_service_mapping.json | 4 +- .../repair_service_master_mapping.js | 32 ++-- .../special_tool_information.js | 11 +- .../special_tool_information.json | 4 +- .../training_information.js | 72 +++---- .../training_information.py | 9 +- ...raining_information_content_reference.json | 5 +- .../training_information_master.py | 8 +- 17 files changed, 168 insertions(+), 252 deletions(-) diff --git a/smart_service/apis/v2/master.py b/smart_service/apis/v2/master.py index aeff3d9..541b8df 100644 --- a/smart_service/apis/v2/master.py +++ b/smart_service/apis/v2/master.py @@ -72,13 +72,13 @@ def old_get_feature_finder(vehicle, variant, language): try: feature_finder_details = frappe.db.sql(f"""select ff.name,ff.vehicle,ff.variant,ff.language,ff.feature_name,ff.translated_feature_name, ff.feature_category,ff.feature_type,ff.display_order,ff.active_status,ffm.feature_pdf from `tabFeature Finder` ff - left join grmtest.`tabFeature Finder Master` ffm on ff.vehicle = ffm.vehicle + left join `tabFeature Finder Master` ffm on ff.vehicle = ffm.vehicle where ff.vehicle = "{vehicle}" and ff.variant = "{variant}" and ff.language = "{language}"; """, as_dict=1) for d in feature_finder_details: d['disclaimer'] = frappe.db.sql(f''' - SELECT name,content,active_status,idx as display_order FROM grmtest.`tabFeature Finder Disclaimer` + SELECT name,content,active_status,idx as display_order FROM `tabFeature Finder Disclaimer` where parent = '{d['feature_name']}'; ''', as_dict=1) @@ -101,7 +101,7 @@ def get_feature_finder(vehicle, variant, language): if language == 'en': feature_finder_details = frappe.db.sql(f"""select ff.name,ff.vehicle,ff.vehicle_id,ff.variant,ff.variant_id,ff.language, ff.features_names as feature_name,ff.feature_category,ff.display_order,ff.active_status, - ffm.feature_pdf as pdf from grmtest.`tabFeature Finder` ff left join grmtest.`tabFeature Finder Master` ffm on + ffm.feature_pdf as pdf from `tabFeature Finder` ff left join `tabFeature Finder Master` ffm on ff.features_names = ffm.feature_name where ff.vehicle = "{vehicle}" and ffm.vehicle = "{vehicle}" and ff.variant = "{variant}" and ff.language = "{language}"; @@ -109,8 +109,8 @@ def get_feature_finder(vehicle, variant, language): else: feature_finder_details = frappe.db.sql(f"""select ff.name,ff.vehicle,ff.vehicle_id,ff.variant,ff.variant_id,ff.language, ff.translated_feature_name as feature_name,ff.feature_category, - ff.display_order,ff.active_status,ffm.feature_pdf as pdf from grmtest.`tabFeature Finder` ff - left join grmtest.`tabFeature Finder Master` ffm on ff.features_names = ffm.feature_name + ff.display_order,ff.active_status,ffm.feature_pdf as pdf from `tabFeature Finder` ff + left join `tabFeature Finder Master` ffm on ff.features_names = ffm.feature_name where ff.vehicle = "{vehicle}" and ffm.vehicle = "{vehicle}" and ff.variant = "{variant}" and ff.language = "{language}"; """, as_dict=1) @@ -204,7 +204,7 @@ def new_publish(): @frappe.whitelist(methods=['POST'], allow_guest=1) def get_special_tool_information(vehicle): try: - special_tool_details = frappe.db.sql(f''' select name,vehicle,category,sub_category,display_order, my_id from grmtest.`tabSpecial Tool Information` + special_tool_details = frappe.db.sql(f''' select name,vehicle,category,sub_category,display_order, my_id from `tabSpecial Tool Information` where vehicle="{vehicle}";''', as_dict=1) for s in special_tool_details: s['tool_usage_content'] = frappe.db.sql(f'''select idx as 'display_order',image,content,video,asset_type,active_status from `tabMST Information Assets` diff --git a/smart_service/phase_2/doctype/feature_finder/feature_finder.js b/smart_service/phase_2/doctype/feature_finder/feature_finder.js index 2a4ec37..5487308 100644 --- a/smart_service/phase_2/doctype/feature_finder/feature_finder.js +++ b/smart_service/phase_2/doctype/feature_finder/feature_finder.js @@ -54,7 +54,6 @@ frappe.ui.form.on('Feature Finder', { vehicle: frm.doc.vehicle } }).then(records => { - console.log(records) if(records.length>0){ frm.doc.feature_name = records[0].name frm.doc.feature_category = records[0].feature_category @@ -81,7 +80,6 @@ frappe.ui.form.on('Feature Finder', { } }, language: function (frm) { - console.log('Language trigger'); if (frm.doc.language == "en") { frm.toggle_display('translated_feature_name', false) @@ -97,21 +95,13 @@ frappe.ui.form.on('Feature Finder', { language: frm.doc.language }, callback: function (r) { - console.log(r.message) frm.set_df_property('features_names', 'options', r.message); frm.refresh_field('features_names') } }) } }, - // feature_type: function (frm) { - // if (frm.doc.feature_type == "Post VIN Cutoff") { - // frm.toggle_display('post_vin_cutoff_id', true) - // } - // else { - // frm.toggle_display('post_vin_cutoff_id', false) - // } - // }, + validate: function (frm) { if (frm.doc.language == "en") { @@ -141,11 +131,11 @@ frappe.ui.form.on('Feature Finder', { }, 5); }); } else { - // if (frm.doc.display_order >= vehicle_count) { - // let display_vehicle_count = vehicle_count - 1; - // msgprint('There are only ' + display_vehicle_count + " " + frm.doc.doctype); - // frappe.validated = false; - // } + if (frm.doc.display_order >= vehicle_count) { + let display_vehicle_count = vehicle_count - 1; + msgprint('There are only ' + display_vehicle_count + " " + frm.doc.doctype); + frappe.validated = false; + } } }); } @@ -170,32 +160,6 @@ function show_images(frm) { } function custom_tab_html(frm) { - // $('[data-fieldname="specification"]').show() - // $('[data-fieldname="feature_finder_images"]').show() - // $('[data-fieldname="feature_finder_content"]').show() - - - // $('[data-fieldname="specification"]').css('margin-bottom','unset') - // $('[data-fieldname="specification"]').css('border-right','1px solid var(--table-border-color)') - // $('[data-fieldname="specification"]').css('border-left','1px solid var(--table-border-color)') - // $('[data-fieldname="specification"]').css('padding-right','20px') - // $('[data-fieldname="specification"]').css('padding-left','20px') - - - // $('[data-fieldname="feature_finder_images"]').css('margin-bottom','unset') - // $('[data-fieldname="feature_finder_images"]').css('border-right','1px solid var(--table-border-color)') - // $('[data-fieldname="feature_finder_images"]').css('border-left','1px solid var(--table-border-color)') - // $('[data-fieldname="feature_finder_images"]').css('padding-right','20px') - // $('[data-fieldname="feature_finder_images"]').css('padding-left','20px') - - // $('[data-fieldname="feature_finder_content"]').css('border-right','1px solid var(--table-border-color)') - // $('[data-fieldname="feature_finder_content"]').css('border-left','1px solid var(--table-border-color)') - // $('[data-fieldname="feature_finder_content"]').css('border-bottom','1px solid var(--table-border-color)') - // $('[data-fieldname="feature_finder_content"]').css('padding-right','20px') - // $('[data-fieldname="feature_finder_content"]').css('padding-left','20px') - - - var res = $(cur_frm.fields_dict.test_html.wrapper).empty(); var ret = '