Browse Source

fix codacy

version-14
Faris Ansari 7 years ago
parent
commit
0176e202fa
6 changed files with 8 additions and 10 deletions
  1. +3
    -2
      frappe/build.js
  2. +2
    -2
      frappe/desk/doctype/calendar_view/calendar_view.js
  3. +0
    -1
      frappe/desk/doctype/calendar_view/calendar_view.py
  4. +0
    -1
      frappe/public/js/frappe/list/list_renderer.js
  5. +1
    -2
      frappe/public/js/frappe/list/list_sidebar.js
  6. +2
    -2
      frappe/public/js/frappe/views/calendar/calendar.js

+ 3
- 2
frappe/build.js View File

@@ -60,11 +60,12 @@ function watch() {
io.emit('reload_css', filename);
}
});
watch_js(function (filename) {
watch_js(//function (filename) {
// if(socket_connection) {
// io.emit('reload_js', filename);
// }
});
//}
);
watch_build_json();
});



+ 2
- 2
frappe/desk/doctype/calendar_view/calendar_view.js View File

@@ -8,7 +8,7 @@ frappe.ui.form.on('Calendar View', {
refresh: function(frm) {
if (!frm.is_new()) {
frm.add_custom_button(__('Show Calendar'),
() => frappe.set_route('List', frm.doc.reference_doctype, 'Calendar', frm.doc.name))
() => frappe.set_route('List', frm.doc.reference_doctype, 'Calendar', frm.doc.name));
}
},
reference_doctype: function(frm) {
@@ -24,7 +24,7 @@ frappe.ui.form.on('Calendar View', {

const date_options = meta.fields.filter(
df => ['Date', 'Datetime'].includes(df.fieldtype)
).map(df => df.fieldname)
).map(df => df.fieldname);

frm.set_df_property('subject_field', 'options', subject_options);
frm.set_df_property('start_date_field', 'options', date_options);


+ 0
- 1
frappe/desk/doctype/calendar_view/calendar_view.py View File

@@ -3,7 +3,6 @@
# For license information, please see license.txt

from __future__ import unicode_literals
import frappe
from frappe.model.document import Document

class CalendarView(Document):


+ 0
- 1
frappe/public/js/frappe/list/list_renderer.js View File

@@ -359,7 +359,6 @@ frappe.views.ListRenderer = Class.extend({
},

render_count: function(current_count) {
console.log(this)
const $header_right = this.list_view.list_header.find('.list-item__content--activity');

frappe.call({


+ 1
- 2
frappe/public/js/frappe/list/list_sidebar.js View File

@@ -279,8 +279,7 @@ frappe.views.ListSidebar = Class.extend({
filters: {
reference_doctype: doctype
}
})
.then(result => {
}).then(result => {
if (!result) return;
const calendar_views = result;
const $link_calendar = this.sidebar.find('.list-link[data-view="Calendar"]');


+ 2
- 2
frappe/public/js/frappe/views/calendar/calendar.js View File

@@ -74,11 +74,11 @@ frappe.views.CalendarView = frappe.views.ListRenderer.extend({

return new Promise(resolve => {
if (calendar_view === 'Default') {
Object.assign(options, frappe.views.calendar[this.doctype])
Object.assign(options, frappe.views.calendar[this.doctype]);
resolve(options);
} else {

frappe.model.with_doc('Calendar View', calendar_view, (name, r) => {
frappe.model.with_doc('Calendar View', calendar_view, () => {
const doc = frappe.get_doc('Calendar View', calendar_view);
Object.assign(options, {
field_map: {


Loading…
Cancel
Save