xhiveframework.pages['organizational-chart'].on_page_load = function(wrapper) {
	xhiveframework.ui.make_app_page({
		parent: wrapper,
		title: __('Organizational Chart'),
		single_column: true
	});

	$(wrapper).bind('show', () => {
		xhiveframework.require('hierarchy-chart.bundle.js', () => {
			let organizational_chart = undefined;
			let method = 'hrms.hr.page.organizational_chart.organizational_chart.get_children';

			if (xhiveframework.is_mobile()) {
				organizational_chart = new xhiveerp.HierarchyChartMobile('Employee', wrapper, method);
			} else {
				organizational_chart = new xhiveerp.HierarchyChart('Employee', wrapper, method);
			}

			xhiveframework.breadcrumbs.add('HR');
			organizational_chart.show();
		});
	});
};
