Merge pull request #7142 from netchampfaris/misc-fixes-3
Miscellaneous Fixes
This commit is contained in:
commit
cd95d43d41
6 changed files with 52 additions and 39 deletions
|
|
@ -155,11 +155,14 @@ def upload_from_folder(path, is_private, dropbox_folder, dropbox_client, did_not
|
|||
|
||||
found = False
|
||||
for file_metadata in response.entries:
|
||||
if (os.path.basename(filepath) == file_metadata.name
|
||||
and os.stat(encode(filepath)).st_size == int(file_metadata.size)):
|
||||
found = True
|
||||
update_file_dropbox_status(f.name)
|
||||
break
|
||||
try:
|
||||
if (os.path.basename(filepath) == file_metadata.name
|
||||
and os.stat(encode(filepath)).st_size == int(file_metadata.size)):
|
||||
found = True
|
||||
update_file_dropbox_status(f.name)
|
||||
break
|
||||
except Exception:
|
||||
error_log.append(frappe.get_traceback())
|
||||
|
||||
if not found:
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -25,10 +25,12 @@ frappe.views.CalendarView = class CalendarView extends frappe.views.ListView {
|
|||
}
|
||||
|
||||
setup_defaults() {
|
||||
super.setup_defaults();
|
||||
this.page_title = __('{0} Calendar', [this.page_title]);
|
||||
this.calendar_settings = frappe.views.calendar[this.doctype] || {};
|
||||
this.calendar_name = frappe.get_route()[3];
|
||||
return super.setup_defaults()
|
||||
.then(() => {
|
||||
this.page_title = __('{0} Calendar', [this.page_title]);
|
||||
this.calendar_settings = frappe.views.calendar[this.doctype] || {};
|
||||
this.calendar_name = frappe.get_route()[3];
|
||||
});
|
||||
}
|
||||
|
||||
setup_view() {
|
||||
|
|
|
|||
|
|
@ -40,15 +40,17 @@ frappe.views.FileView = class FileView extends frappe.views.ListView {
|
|||
}
|
||||
|
||||
setup_defaults() {
|
||||
super.setup_defaults();
|
||||
this.page_title = __('File Manager');
|
||||
return super.setup_defaults()
|
||||
.then(() => {
|
||||
this.page_title = __('File Manager');
|
||||
|
||||
const route = frappe.get_route();
|
||||
this.current_folder = route.slice(2).join('/');
|
||||
this.filters = [['File', 'folder', '=', this.current_folder, true]];
|
||||
this.order_by = this.view_user_settings.order_by || 'file_name asc';
|
||||
const route = frappe.get_route();
|
||||
this.current_folder = route.slice(2).join('/');
|
||||
this.filters = [['File', 'folder', '=', this.current_folder, true]];
|
||||
this.order_by = this.view_user_settings.order_by || 'file_name asc';
|
||||
|
||||
this.menu_items = this.menu_items.concat(this.file_menu_items());
|
||||
this.menu_items = this.menu_items.concat(this.file_menu_items());
|
||||
});
|
||||
}
|
||||
|
||||
file_menu_items() {
|
||||
|
|
|
|||
|
|
@ -6,16 +6,18 @@ frappe.views.GanttView = class GanttView extends frappe.views.ListView {
|
|||
}
|
||||
|
||||
setup_defaults() {
|
||||
super.setup_defaults();
|
||||
this.page_title = this.page_title + ' ' + __('Gantt');
|
||||
this.calendar_settings = frappe.views.calendar[this.doctype] || {};
|
||||
if(this.calendar_settings.order_by) {
|
||||
this.sort_by = this.calendar_settings.order_by;
|
||||
this.sort_order = 'asc';
|
||||
} else {
|
||||
this.sort_by = this.view_user_settings.sort_by || this.calendar_settings.field_map.start;
|
||||
this.sort_order = this.view_user_settings.sort_order || 'asc';
|
||||
}
|
||||
return super.setup_defaults()
|
||||
.then(() => {
|
||||
this.page_title = this.page_title + ' ' + __('Gantt');
|
||||
this.calendar_settings = frappe.views.calendar[this.doctype] || {};
|
||||
if(this.calendar_settings.order_by) {
|
||||
this.sort_by = this.calendar_settings.order_by;
|
||||
this.sort_order = 'asc';
|
||||
} else {
|
||||
this.sort_by = this.view_user_settings.sort_by || this.calendar_settings.field_map.start;
|
||||
this.sort_order = this.view_user_settings.sort_order || 'asc';
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
setup_view() {
|
||||
|
|
|
|||
|
|
@ -9,8 +9,10 @@ frappe.views.ImageView = class ImageView extends frappe.views.ListView {
|
|||
}
|
||||
|
||||
setup_defaults() {
|
||||
super.setup_defaults();
|
||||
this.page_title = this.page_title + ' ' + __('Images');
|
||||
return super.setup_defaults()
|
||||
.then(() => {
|
||||
this.page_title = this.page_title + ' ' + __('Images');
|
||||
})
|
||||
}
|
||||
|
||||
setup_view() {
|
||||
|
|
|
|||
|
|
@ -27,19 +27,21 @@ frappe.views.KanbanView = class KanbanView extends frappe.views.ListView {
|
|||
}
|
||||
|
||||
setup_defaults() {
|
||||
super.setup_defaults();
|
||||
this.board_name = frappe.get_route()[3];
|
||||
this.page_title = this.board_name;
|
||||
this.card_meta = this.get_card_meta();
|
||||
return super.setup_defaults()
|
||||
.then(() => {
|
||||
this.board_name = frappe.get_route()[3];
|
||||
this.page_title = this.board_name;
|
||||
this.card_meta = this.get_card_meta();
|
||||
|
||||
this.menu_items.push({
|
||||
label: __('Save filters'),
|
||||
action: () => {
|
||||
this.save_kanban_board_filters();
|
||||
}
|
||||
});
|
||||
this.menu_items.push({
|
||||
label: __('Save filters'),
|
||||
action: () => {
|
||||
this.save_kanban_board_filters();
|
||||
}
|
||||
});
|
||||
|
||||
return this.get_board();
|
||||
return this.get_board();
|
||||
});
|
||||
}
|
||||
|
||||
get_board() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue