ci: add prettier to pre-commit (backport #40206) (#40362)

* ci: add prettier to pre-commit

(cherry picked from commit 2c16036ef3)

* style: format js files

---------

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
mergify[bot]
2024-03-11 10:47:18 +05:30
committed by GitHub
parent 5f789d9abe
commit 7d3d2eb928
572 changed files with 24271 additions and 21331 deletions

View File

@@ -1,17 +1,16 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
frappe.ui.form.on("Rename Tool", {
onload: function(frm) {
onload: function (frm) {
return frappe.call({
method: "erpnext.utilities.doctype.rename_tool.rename_tool.get_doctypes",
callback: function(r) {
callback: function (r) {
frm.set_df_property("select_doctype", "options", r.message);
}
},
});
},
refresh: function(frm) {
refresh: function (frm) {
frm.disable_save();
frm.get_field("file_to_rename").df.options = {
@@ -22,14 +21,14 @@ frappe.ui.form.on("Rename Tool", {
if (!frm.doc.file_to_rename) {
frm.get_field("rename_log").$wrapper.html("");
}
frm.page.set_primary_action(__("Rename"), function() {
frm.page.set_primary_action(__("Rename"), function () {
frm.get_field("rename_log").$wrapper.html("<p>Renaming...</p>");
frappe.call({
method: "erpnext.utilities.doctype.rename_tool.rename_tool.upload",
args: {
select_doctype: frm.doc.select_doctype
select_doctype: frm.doc.select_doctype,
},
callback: function(r) {
callback: function (r) {
let html = r.message.join("<br>");
if (r.exc) {
@@ -40,8 +39,8 @@ frappe.ui.form.on("Rename Tool", {
}
frm.get_field("rename_log").$wrapper.html(html);
}
},
});
});
}
})
},
});

View File

@@ -1,8 +1,6 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('SMS Log', {
refresh: function(frm) {
}
frappe.ui.form.on("SMS Log", {
refresh: function (frm) {},
});

View File

@@ -1,7 +1,7 @@
// Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Video', {
frappe.ui.form.on("Video", {
refresh: function (frm) {
frm.events.toggle_youtube_statistics_section(frm);
frm.add_custom_button(__("Watch Video"), () => frappe.help.show_video(frm.doc.url, frm.doc.title));
@@ -9,9 +9,9 @@ frappe.ui.form.on('Video', {
toggle_youtube_statistics_section: (frm) => {
if (frm.doc.provider === "YouTube") {
frappe.db.get_single_value("Video Settings", "enable_youtube_tracking").then( val => {
frappe.db.get_single_value("Video Settings", "enable_youtube_tracking").then((val) => {
frm.toggle_display("youtube_tracking_section", val);
});
}
}
},
});

View File

@@ -1,7 +1,7 @@
frappe.listview_settings["Video"] = {
onload: (listview) => {
listview.page.add_menu_item(__("Video Settings"), function() {
frappe.set_route("Form","Video Settings", "Video Settings");
listview.page.add_menu_item(__("Video Settings"), function () {
frappe.set_route("Form", "Video Settings", "Video Settings");
});
}
}
},
};

View File

@@ -1,8 +1,7 @@
// Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.ui.form.on('Video Settings', {
frappe.ui.form.on("Video Settings", {
// refresh: function(frm) {
// }
});

View File

@@ -1,9 +1,8 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.query_reports["YouTube Interactions"] = {
"filters": [
filters: [
{
fieldname: "from_date",
label: __("From Date"),
@@ -11,10 +10,10 @@ frappe.query_reports["YouTube Interactions"] = {
default: frappe.datetime.add_months(frappe.datetime.now_date(), -12),
},
{
fieldname:"to_date",
fieldname: "to_date",
label: __("To Date"),
fieldtype: "Date",
default: frappe.datetime.now_date(),
}
]
},
],
};

View File

@@ -1,3 +1,3 @@
frappe.ready(function() {
frappe.ready(function () {
// bind events here
})
});