TimeTrex/interface/html5/dist/reports-ReportBaseViewController.bundle.js

1 line
340 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["reports-ReportBaseViewController"],{7867:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ReportBaseViewController\": () => (/* binding */ ReportBaseViewController)\n/* harmony export */ });\n/* harmony import */ var _views_BaseViewController__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(121);\n/* harmony import */ var _global_Global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9490);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\n\nclass ReportBaseViewController extends _views_BaseViewController__WEBPACK_IMPORTED_MODULE_0__.BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tview_file: '',\n\n\t\t\tpage_orientation_array: null,\n\t\t\tfont_size_array: null,\n\t\t\tauto_refresh_array: null,\n\t\t\tchart_display_mode_array: null,\n\t\t\tchart_type_array: null,\n\t\t\ttemplates_array: null,\n\t\t\tsetup_fields_array: null,\n\n\t\t\tlog_action_id_array: null,\n\n\t\t\tlog_table_name_id_array: null,\n\n\t\t\ttime_period_array: null,\n\n\t\t\tvisible_report_widgets: null,\n\n\t\t\tvisible_report_values: null,\n\n\t\t\tvisible_report_widgets_order_fix: null,\n\n\t\t\tstatus_id_array: null,\n\n\t\t\tapi_user_report: null,\n\n\t\t\tcurrent_saved_report: null, // Current saved report if any\n\n\t\t\tsaved_report_array: null,\n\n\t\t\tsub_saved_report_view_controller: null,\n\n\t\t\tsub_custom_column_view_controller: null,\n\n\t\t\tneed_refresh_display_columns: false, //When custom column changed. Set this to true.\n\n\t\t\tReportMissedField: null,\n\n\t\t\tinclude_form_setup: false,\n\n\t\t\tshow_empty_message: false,\n\n\t\t\tdo_validate_after_create_ui: false, //Do validate if there is a saved report\n\n\t\t\tform_setup_changed: false\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tpreInit( options ) {\n\t\tthis.preInitReport();\n\t}\n\n\tinit( options ) {\n\t\t//Initialize this.real_this without having to call _super,\n\t\t//this avoids Maximum stack size errors in other functions that call _super. Copied from __super.\n\t\tthis.real_this = this.constructor.__super__;\n\n\t\tthis.permission_id = 'report';\n\n\t\tLocalCacheData.current_open_report_controller = this;\n\n\t\tvar $this = this;\n\n\t\t$this.api_user_report = TTAPI.APIUserReportData;\n\t\t$this.initReport();\n\t\t// this.buildContextMenu(); // #VueContextMenu#EditOnly - Commented out as must happen after initEditViewUI\n\t\tTTPromise.resolve( 'Reports', 'openReport' );\n\t\t$this.postInitReport();\n\t}\n\n\t// Removed because the require callback in init() serves this function and calls postInitReport() at the proper time.\n\t// postInit: function(){\n\t// },\n\n\tpreInitReport( options ) {\n\t}\n\n\tinitReport( options ) {\n\t}\n\n\tpostInitReport( options ) {\n\t}\n\n\trender() {\n\t}\n\n\t// Need always override if report has filter field.\n\tprocessFilterField() {\n\t}\n\n\tgetDefaultReport( data ) {\n\t\tvar item = _.find( data, function( item ) {\n\t\t\treturn item.is_default === true;\n\t\t} );\n\t\tdata && data.length > 0 && !item && ( item = data[0] );\n\n\t\treturn item;\n\t}\n\n\t// overrides BaseViewController.getDefaultContextMenuModel()\n\tgetDefaultContextMenuModel() {\n\n\t\tvar default_context_menu_model = {\n\t\t\t// only put groups that are used in default here, others go in the relevant view controller to avoid confusion on which are obsolete.\n\t\t\tgroups: {\n\t\t\t\teditor: {\n\t\t\t\t\tlabel: $.i18n._( 'Editor' ),\n\t\t\t\t\tid: 'editor'\n\t\t\t\t},\n\t\t\t\tsaved_report: {\n\t\t\t\t\tlabel: $.i18n._( 'Saved Report' ),\n\t\t\t\t\tid: this.viewId + 'SavedReport'\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t'icons': {}\n\t\t};\n\n\t\tdefault_context_menu_model['icons']['view_html'] = {\n\t\t\tlabel: $.i18n._( 'View' ),\n\t\t\tid: 'view_html',\n\t\t\taction_group: 'view',\n\t\t\tgroup: 'editor',\n\