TimeTrex/interface/html5/dist/wizard-dashlet-DashletWizardController.bundle.js

1 line
73 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["wizard-dashlet-DashletWizardController"],{9022:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"DashletWizardController\": () => (/* binding */ DashletWizardController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass DashletWizardController extends BaseWizardController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '.wizard-bg',\n\t\t\tuser_generic_data_api: null,\n\t\t\tapi_user_report: null,\n\t\t\tnumArray: [\n\t\t\t\t{ label: $.i18n._( 'Default' ), value: 0 },\n\t\t\t\t{ label: 5, value: 5 },\n\t\t\t\t{ label: 10, value: 10 },\n\t\t\t\t{ label: 15, value: 15 },\n\t\t\t\t{ label: 20, value: 20 },\n\t\t\t\t{ label: 25, value: 25 },\n\t\t\t\t{ label: 50, value: 50 },\n\t\t\t\t{ label: 100, value: 100 },\n\t\t\t\t{ label: 250, value: 250 },\n\t\t\t\t{ label: 500, value: 500 },\n\t\t\t\t{ label: 1000, value: 1000 }\n\t\t\t]\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\t\t//this._super('initialize', options );\n\t\tthis.title = $.i18n._( 'Dashlet Wizard' );\n\t\tthis.steps = 2;\n\t\tthis.current_step = 1;\n\t\tthis.user_generic_data_api = TTAPI.APIUserGenericData;\n\t\tthis.api_user_report = TTAPI.APIUserReportData;\n\t\tthis.render();\n\t}\n\n\trender() {\n\t\tsuper.render();\n\t\tthis.initCurrentStep();\n\t}\n\n\t//Create each page UI\n\tbuildCurrentStepUI() {\n\t\tvar $this = this;\n\t\tthis.stepsWidgetDic[this.current_step] = {};\n\t\tthis.content_div.empty();\n\t\tvar combobox;\n\n\t\tswitch ( this.current_step ) {\n\t\t\tcase 1:\n\t\t\t\tvar label = this.getLabel();\n\t\t\t\tlabel.text( $.i18n._( 'Choose the type of dashlet' ) );\n\t\t\t\tthis.content_div.append( label );\n\t\t\t\tcombobox = this.getComboBox( 'dashlet_type', false );\n\t\t\t\tcombobox.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t\t$this.stepsDataDic[2] = null;\n\t\t\t\t\t$this.stepsWidgetDic[2] = null;\n\t\t\t\t} );\n\t\t\t\tcombobox.off( 'change' ).on( 'change', function( e ) {\n\t\t\t\t\t$this.step1ComboboxChanged( $( e.target ).val() );\n\t\t\t\t} );\n\t\t\t\tthis.content_div.append( combobox );\n\t\t\t\tthis.stepsWidgetDic[this.current_step][combobox.getField()] = combobox;\n\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tlabel = this.getLabel();\n\t\t\t\tvar step_1_data = this.stepsDataDic[1];\n\t\t\t\tvar form_item;\n\t\t\t\tvar form_item_label;\n\t\t\t\tvar form_item_input_div;\n\t\t\t\tvar textInput;\n\n\t\t\t\tif ( step_1_data.dashlet_type == 'custom_list' ) {\n\t\t\t\t\tlabel.text( $.i18n._( 'Choose a list view and layout to display in the dashlet' ) );\n\t\t\t\t\tthis.content_div.append( label );\n\n\t\t\t\t\t// Choose view\n\t\t\t\t\tform_item = $( Global.loadWidget( 'global/widgets/wizard_form_item/WizardFormItem.html' ) );\n\t\t\t\t\tform_item_label = form_item.find( '.form-item-label' );\n\t\t\t\t\tform_item_input_div = form_item.find( '.form-item-input-div' );\n\t\t\t\t\tcombobox = this.getComboBox( 'script', false );\n\t\t\t\t\tcombobox.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t\t\t$this.setLayout( $this.getScriptNameByAPIViewKey( target.getValue() ) );\n\t\t\t\t\t\t$this.setDefaultName( step_1_data.dashlet_type );\n\t\t\t\t\t} );\n\t\t\t\t\tform_item_label.text( $.i18n._( 'List View' ) );\n\t\t\t\t\tform_item_input_div.append( combobox );\n\t\t\t\t\tthis.content_div.append( form_item );\n\t\t\t\t\tthis.stepsWidgetDic[this.current_step][combobox.getField()] = combobox;\n\n\t\t\t\t\t//Dashlet Title\n\t\t\t\t\tform_item = $( Global.loadWidget( 'global/widgets/wizard_form_item/WizardFormItem.html' ) );\n\t\t\t\t\tform_item_label = form_item.find( '.form-item-label' );\n\t\t\t\t\tform_item_input_div = form_item.find( '.form-item-input-div' );\n\t\t\t\t\ttextInput = this.getT