<commit_before>frappe.provide('frappe.views');

frappe.views.GanttView = class GanttView extends frappe.views.ListView {
	get view_name() {
		return 'Gantt';
	}

	setup_defaults() {
		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() {

	}

	prepare_data(data) {
		super.prepare_data(data);<commit_msg>feat(Gantt View): allow overriding calendar settings<commit_after>frappe.provide('frappe.views');

frappe.views.GanttView = class GanttView extends frappe.views.ListView {
	get view_name() {
		return 'Gantt';
	}

	setup_defaults() {
		return super.setup_defaults()
			.then(() => {
				this.page_title = this.page_title + ' ' + __('Gantt');
				this.calendar_settings = frappe.views.calendar[this.doctype] || {};

				if (typeof this.calendar_settings.gantt == 'object') {
					Object.assign(this.calendar_settings, this.calendar_settings.gantt);
				}

				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() {

	}

	prepare_data(data) {
		super.prepare_data(data);
{'fraction_non_alphanumeric': 0.1426893716970053, 'fraction_numerical': 0.0, 'mean_word_length': 3.8547008547008548, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4620209', 'n_tokens_mistral': 703, 'n_tokens_neox': 608, 'n_words': 79}