refactor: Replace Class.extend with native class
diff --git a/erpnext/stock/dashboard/item_dashboard.js b/erpnext/stock/dashboard/item_dashboard.js
index 95cb92b..30e0b76 100644
--- a/erpnext/stock/dashboard/item_dashboard.js
+++ b/erpnext/stock/dashboard/item_dashboard.js
@@ -1,11 +1,11 @@
frappe.provide('erpnext.stock');
-erpnext.stock.ItemDashboard = Class.extend({
- init: function(opts) {
+erpnext.stock.ItemDashboard = class ItemDashboard {
+ constructor(opts) {
$.extend(this, opts);
this.make();
- },
- make: function() {
+ }
+ make() {
var me = this;
this.start = 0;
if(!this.sort_by) {
@@ -73,8 +73,8 @@
me.refresh();
});
- },
- refresh: function() {
+ }
+ refresh() {
if(this.before_refresh) {
this.before_refresh();
}
@@ -98,8 +98,8 @@
me.render(r.message);
}
});
- },
- render: function(data) {
+ }
+ render(data) {
if (this.start===0) {
this.max_count = 0;
this.result.empty();
@@ -135,9 +135,9 @@
$(`<div class='text-muted' style='margin: 20px 5px;'>
${message} </div>`).appendTo(this.result);
}
- },
+ }
- get_item_dashboard_data: function(data, max_count, show_item) {
+ get_item_dashboard_data(data, max_count, show_item) {
if(!max_count) max_count = 0;
if(!data) data = [];
@@ -164,9 +164,9 @@
can_write:can_write,
show_item: show_item || false
};
- },
+ }
- get_capacity_dashboard_data: function(data) {
+ get_capacity_dashboard_data(data) {
if (!data) data = [];
data.forEach(function(d) {
@@ -183,7 +183,7 @@
can_write: can_write,
};
}
-});
+};
erpnext.stock.move_item = function(item, source, target, actual_qty, rate, callback) {
var dialog = new frappe.ui.Dialog({