"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["home-dashboard-HomeViewController"],{7657:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"HomeViewController\": () => (/* binding */ HomeViewController)\n/* harmony export */ });\n/* harmony import */ var jquery_bridget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8831);\n/* harmony import */ var jquery_bridget__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery_bridget__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var masonry_layout__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8751);\n/* harmony import */ var masonry_layout__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(masonry_layout__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6739);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\n\n\nclass HomeViewController extends _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_2__.TTBackboneView {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '.home-view',\n\n\t\t\t// _required_files: ['jquery.masonry', 'jquery-bridget'],\n\t\t\tuser_generic_data_api: null,\n\t\t\tcontext_menu_array: null,\n\t\t\tviewId: null,\n\t\t\tdashletControllerArray: null,\n\t\t\tinitMasonryDone: false,\n\t\t\tdashboard_container: false,\n\t\t\torder_data: false,\n\t\t\tcurrent_scroll_position: false,\n\t\t\tcurrent_mouse_position: null\n\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\t/**\n\t * When changing this function, you need to look for all occurences of this function because it was needed in several bases\n\t * BaseViewController, HomeViewController, BaseWizardController, QuickPunchBaseViewControler\n\t *\n\t * @returns {Array}\n\t */\n\t// filterRequiredFiles() {\n\t// \tvar retval = [];\n\t// \tvar required_files = this._required_files;\n\t//\n\t// \tif ( required_files && required_files[0] ) {\n\t// \t\tretval = required_files;\n\t// \t} else {\n\t// \t\tfor ( var edition_id in required_files ) {\n\t// \t\t\tif ( Global.getProductEdition() >= edition_id ) {\n\t// \t\t\t\tretval = retval.concat( required_files[edition_id] );\n\t// \t\t\t}\n\t// \t\t}\n\t// \t}\n\t//\n\t// \tDebug.Arr( retval, 'RETVAL', 'BaseViewController.js', 'BaseViewController', 'filterRequiredFiles', 10 );\n\t// \treturn retval;\n\t// }\n\n\tinitialize( options ) {\n\t\tGlobal.setUINotready();\n\t\tTTPromise.add( 'init', 'init' );\n\t\tTTPromise.wait();\n\t\tvar $this = this;\n\n\t\tsuper.initialize( options );\n\n\t\t// require( this.filterRequiredFiles(), function( Masonry, jQueryBridget ) {\n\n\t\t$this.viewId = 'Home';\n\t\tLocalCacheData.current_open_primary_controller = $this;\n\t\t$this.user_generic_data_api = TTAPI.APIUserGenericData;\n\t\t$this.api_dashboard = TTAPI.APIDashboard;\n\n\t\tjquery_bridget__WEBPACK_IMPORTED_MODULE_0___default()( 'masonry', (masonry_layout__WEBPACK_IMPORTED_MODULE_1___default()), $ );\n\t\t$this.dashboard_container = $( '.dashboard-container' );\n\t\t$this.initMasonryDone = false;\n\t\t$this.initContextMenu();\n\t\t$this.initDashBoard();\n\t\t$this.autoOpenEditOnlyViewIfNecessary();\n\n\t\tTTPromise.resolve( 'BaseViewController', 'initialize' );\n\t\t// } );\n\t}\n\n\tautoOpenEditOnlyViewIfNecessary() {\n\t\tif ( LocalCacheData.getAllURLArgs() && LocalCacheData.getAllURLArgs().sm && !LocalCacheData.current_open_edit_only_controller ) {\n\t\t\tif ( LocalCacheData.getAllURLArgs().sm.indexOf( 'Report' ) < 0 ) {\n\t\t\t\tIndexViewController.openEditView( this, LocalCacheData.getAllURLArgs().sm, LocalCacheData.getAllURLArgs().sid );\n\t\t\t} else {\n\t\t\t\tIndexViewController.openReport( this, LocalCacheData.getAllURLArgs().sm );\n\t\t\t\tif ( LocalCacheData.getAllURLArgs().sid ) {\n\t\t\t\t\tLocalCacheData.default_edit_id_for_next_open_edit_view = LocalCacheData.getAllURLArgs().sid;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tinitContextMenu() {\n\t\tvar $this = this;\n\t\tthis.buildContextMenu();\n\t\tthis.setDefaultMenu();\n\t\t$( this.el ).unbind( 'click' ).bind( 'click', function() {\n\t\t\t$this.setDefaultMenu();\n\t\t} );\n\t}\n\n\tdetermineContextMenuMountAttributes() {\n\t\treturn {\n\t\t\tid: ContextMenuManager.generateMenuId( 'main_context', 'home_view' ),\n\t\t\tparent_mount_point: $( this.el )\n\t\t};\n\t}\n\n\tunmountContextMenu() {\n\t\t// This should be able to handle various menu's as the determine menu id function will identify the right menu (view, edit etc)\n\t\tContextMenuManager.unmountContextMenu( this.determineContextMenuMountAttributes().id );\n\t}\n\n\tbuildContextMenu() {\n\t\tLocalCacheData.current_open_sub_controller = null;\n\n\t\t// Vue Context Menu initialization\n\t\tvar menu_attributes = this.determineContextMenuMountAttributes();\n\n\t\tif( ContextMenuManager.getMenu( menu_attributes.id ) === undefined ) { // Prevents multiple context borders and menu builds .e.g. when a subview is closed and parent menu is rebuilt.\n\t\t\tContextMenuManager.createAndMountMenu( menu_attributes.id, menu_attributes.parent_mount_point, this ); // #VueContextMenu# Initialize Vue ContextMenuManager here so that each view has their own unique one.\n\n\t\t\t// #VueContextMenu#context-border creation to put a border around a context menu and the contents it relates to. This will help users understand which context menu belongs to what if there is more than one menu on the page.\n\t\t\tvar context_parent = menu_attributes.parent_mount_point; // $('.edit-view-tab-bar');\n\t\t\tvar context_label = 'Dashboard'; // this.context_menu_name;\n\n\t\t\tcontext_parent.prepend(''+ context_label +'');\n\t\t\tcontext_parent.wrapInner('
');\n\t\t}\n\n\t\tthis.buildContextMenuModels();\n\t}\n\n\tonContextMenuClick( context_btn, menu_name ) {\n\t\tvar $this = this;\n\t\tvar id;\n\n\t\tif ( Global.isSet( menu_name ) ) {\n\t\t\tid = menu_name;\n\t\t} else {\n\t\t\tif ( context_btn.disabled ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tswitch ( id ) {\n\t\t\tcase 'add':\n\t\t\t\tProgressBar.showOverlay();\n\t\t\t\tthis.onAddClick();\n\t\t\t\tbreak;\n\t\t\tcase 'refresh_all':\n\t\t\t\tProgressBar.showOverlay();\n\t\t\t\tfor ( var i = 0; i < $this.dashletControllerArray.length; i++ ) {\n\t\t\t\t\t$( $this.dashletControllerArray[i].el ).find( '.refresh-btn' ).trigger( 'click' );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'auto_arrange':\n\t\t\t\tTAlertManager.showConfirmAlert( Global.auto_arrange_dashlet_confirm_message, null, function( result ) {\n\t\t\t\t\tif ( result ) {\n\t\t\t\t\t\tProgressBar.showOverlay();\n\n\t\t\t\t\t\t$this.initDashBoard( true );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tProgressBar.closeOverlay();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 'reset_all':\n\t\t\t\tTAlertManager.showConfirmAlert( Global.rese_all_dashlet_confirm_message, null, function( result ) {\n\t\t\t\t\tif ( result ) {\n\t\t\t\t\t\tProgressBar.showOverlay();\n\t\t\t\t\t\tvar ids = [];\n\t\t\t\t\t\tfor ( var i = 0; i < $this.dashlet_list.length; i++ ) {\n\t\t\t\t\t\t\tids.push( $this.dashlet_list[i].id );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( ids.length > 0 ) {\n\t\t\t\t\t\t\t$this.user_generic_data_api.deleteUserGenericData( ids, {\n\t\t\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\t\t\tif ( result.isValid() ) {\n\t\t\t\t\t\t\t\t\t\tdoResetAllNext();\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tTAlertManager.showErrorAlert( result );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdoResetAllNext();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction doResetAllNext() {\n\t\t\t\t\t\t\tif ( $this.order_data ) {\n\t\t\t\t\t\t\t\t$this.user_generic_data_api.deleteUserGenericData( $this.order_data.id, {\n\t\t\t\t\t\t\t\t\tonResult: function() {\n\t\t\t\t\t\t\t\t\t\t$this.initDashBoard();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this.initDashBoard();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tProgressBar.closeOverlay();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 'in_out':\n\t\t\tcase 'timesheet':\n\t\t\tcase 'schedule':\n\t\t\tcase 'request':\n\t\t\tcase 'pay_stub':\n\t\t\t\tthis.onNavigationClick( id );\n\t\t\t\tbreak;\n\t\t}\n\t\tGlobal.triggerAnalyticsContextMenuClick( context_btn );\n\t}\n\n\tonNavigationClick( iconName ) {\n\t\tswitch ( iconName ) {\n\t\t\tcase 'in_out':\n\t\t\t\tIndexViewController.openEditView( LocalCacheData.current_open_primary_controller, 'InOut' );\n\t\t\t\tbreak;\n\t\t\tcase 'timesheet':\n\t\t\t\tIndexViewController.goToView( 'TimeSheet' );\n\t\t\t\tbreak;\n\t\t\tcase 'schedule':\n\t\t\t\tIndexViewController.goToView( 'Schedule' );\n\t\t\t\tbreak;\n\t\t\tcase 'request':\n\t\t\t\tIndexViewController.goToView( 'Request' );\n\t\t\t\tbreak;\n\t\t\tcase 'pay_stub':\n\t\t\t\tIndexViewController.goToView( 'PayStub' );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t//Call this when select grid row\n\t//Call this when setLayout\n\tsetDefaultMenu() {\n\t\t// Copied and modified from BaseViewController, to enable the icons again after ContextMenuManager.buildContextMenuModelFromBackbone disabled them all.\n\t\tvar context_menu_array = ContextMenuManager.getMenuModelByMenuId( this.determineContextMenuMountAttributes().id );\n\t\tvar len = context_menu_array.length;\n\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\tlet context_btn = context_menu_array[i];\n\n\t\t\t// In all view controllers other than HomeView, in order to reduce flashing of icons between menu build and permission settings, all icons in Vue context menu now set to disabled (in ContextMenuManager), waiting on the BaseViewController.setDefaultMenu to enable them if needed. However, HomeView does not have the same code, hence it has been added here now below.\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t\t}\n\t}\n\n\tonAddClick() {\n\t\tvar $this = this;\n\t\tIndexViewController.openWizard( 'DashletWizard', null, function() {\n\t\t\t$this.initDashBoard();\n\t\t} );\n\t}\n\n\tremoveContentMenuByName( name ) {\n\t\tif ( !LocalCacheData.current_open_primary_controller ) {\n\t\t\treturn;\n\t\t}\n\t\tvar primary_view_id = LocalCacheData.current_open_primary_controller.viewId;\n\n\t\tif ( !Global.isSet( name ) ) {\n\t\t\tname = this.context_menu_name;\n\t\t}\n\t\tvar tab = $( '#ribbon ul a' ).filter( function() {\n\t\t\treturn $( this ).attr( 'ref' ) === name;\n\t\t} ).parent();\n\n\t\tvar index = $( 'li', $( '#ribbon' ) ).index( tab );\n\t\tif ( index >= 0 ) {\n\t\t\t$( '#ribbon_view_container' ).tabs( 'refresh' );\n\t\t}\n\t}\n\n\tbuildContextMenuModels() {\n\n\t\tvar icons = [];\n\n\t\ticons.push( {\n\t\t\tlabel: $.i18n._( 'Add Dashlet' ),\n\t\t\tid: 'add',\n\t\t\t//group: editor_group,\n\t\t\tvue_icon: 'tticon tticon-add_black_24dp',\n\t\t\tsort_order: 1010,\n\t\t\tpermission_result: true,\n\t\t\tpermission: null\n\t\t} );\n\n\t\ticons.push( {\n\t\t\tlabel: $.i18n._( 'Jump To' ),\n\t\t\tid: 'jump_to_header',\n\t\t\tmenu_align: 'right',\n\t\t\taction_group: 'jump_to',\n\t\t\taction_group_header: true,\n\t\t\tpermission_result: false // to hide it in legacy context menu and avoid errors in legacy parsers.\n\t\t} );\n\n\t\ticons.push( {\n\t\t\tlabel: $.i18n._( 'TimeSheet' ),\n\t\t\tid: 'timesheet',\n\t\t\tmenu_align: 'right',\n\t\t\taction_group: 'jump_to',\n\t\t\t//group: navigation_group,\n\t\t\tsort_order: 2020,\n\t\t\tpermission_result: PermissionManager.checkTopLevelPermission( 'TimeSheet' ),\n\t\t\tpermission: null\n\t\t} );\n\n\t\ticons.push( {\n\t\t\tlabel: $.i18n._( 'Schedules' ),\n\t\t\tid: 'schedule',\n\t\t\tmenu_align: 'right',\n\t\t\taction_group: 'jump_to',\n\t\t\t//group: navigation_group,\n\t\t\tsort_order: 2030,\n\t\t\tpermission_result: PermissionManager.checkTopLevelPermission( 'Schedule' ),\n\t\t\tpermission: null\n\t\t} );\n\n\t\ticons.push( {\n\t\t\tlabel: $.i18n._( 'Requests' ),\n\t\t\tid: 'request',\n\t\t\tmenu_align: 'right',\n\t\t\taction_group: 'jump_to',\n\t\t\t//group: navigation_group,\n\t\t\tsort_order: 2040,\n\t\t\tpermission_result: PermissionManager.checkTopLevelPermission( 'Request' ),\n\t\t\tpermission: null\n\t\t} );\n\n\t\ticons.push( {\n\t\t\tlabel: $.i18n._( 'Pay Stubs' ),\n\t\t\tid: 'pay_stub',\n\t\t\tmenu_align: 'right',\n\t\t\taction_group: 'jump_to',\n\t\t\t//group: navigation_group,\n\t\t\tsort_order: 2050,\n\t\t\tpermission_result: PermissionManager.checkTopLevelPermission( 'PayStub' ),\n\t\t\tpermission: null\n\t\t} );\n\n\t\ticons.push (\n\t\t\t{\n\t\t\t\tlabel: '', //Empty label. vue_icon is displayed instead of text.\n\t\t\t\tid: 'other_header',\n\t\t\t\tmenu_align: 'right',\n\t\t\t\taction_group: 'other',\n\t\t\t\taction_group_header: true,\n\t\t\t\tvue_icon: 'tticon tticon-more_vert_black_24dp',\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: $.i18n._( 'Auto Arrange' ),\n\t\t\t\tid: 'auto_arrange',\n\t\t\t\tmenu_align: 'right',\n\t\t\t\taction_group: 'other',\n\t\t\t\tpermission_result: true,\n\t\t\t\tpermission: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: $.i18n._( 'Refresh All Dashlets' ),\n\t\t\t\tid: 'refresh_all',\n\t\t\t\tmenu_align: 'right',\n\t\t\t\taction_group: 'other',\n\t\t\t\tpermission_result: true,\n\t\t\t\tpermission: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: $.i18n._( 'Restore Default Dashlets' ),\n\t\t\t\tid: 'reset_all',\n\t\t\t\tmenu_align: 'right',\n\t\t\t\taction_group: 'other',\n\t\t\t\tpermission_result: true,\n\t\t\t\tpermission: null\n\t\t\t}\n\t\t)\n\n\t\t ContextMenuManager.buildContextMenuModelFromBackbone( this.determineContextMenuMountAttributes().id, { icons: icons }, this );\n\t}\n\n\tunLoadCurrentDashlets() {\n\t\t//Error: TypeError: this.dashletControllerArray is null in interface/html5/framework/jquery.min.js?v=9.0.2-20151106-092147 line 2 > eval line 368\n\t\tif ( this.dashletControllerArray ) {\n\t\t\tfor ( var i = 0; i < this.dashletControllerArray.length; i++ ) {\n\t\t\t\tvar dashletController = this.dashletControllerArray[i];\n\t\t\t\tdashletController.cleanWhenUnloadView();\n\t\t\t}\n\t\t}\n\t\tthis.dashletControllerArray = [];\n\t}\n\n\tinitDashBoard( auto_arrange ) {\n\t\tvar $this = this;\n\t\tvar i = 0;\n\t\tif ( !this.dashletControllerArray ) {\n\t\t\tthis.dashletControllerArray = [];\n\t\t} else {\n\t\t\tthis.unLoadCurrentDashlets();\n\t\t}\n\n\t\tif ( this.initMasonryDone ) {\n\t\t\tthis.dashboard_container = $( '.dashboard-container' );\n\t\t\tthis.dashboard_container.masonry(); //#2353 - fix js exception on auto arrange \"masonry is not initialized\"\n\t\t\tthis.dashboard_container.masonry( 'destroy' );\n\t\t\tthis.dashboard_container.sortable( 'destroy' );\n\t\t\tthis.dashboard_container.empty();\n\t\t\tthis.initMasonryDone = false;\n\t\t}\n\t\t$this.dashlet_controller_dic = {};\n\t\tthis.user_generic_data_api.getUserGenericData( {\n\t\t\tfilter_data: {\n\t\t\t\tscript: 'global_dashboard',\n\t\t\t\tdeleted: false\n\t\t\t}\n\t\t}, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar dashlet_list = result.getResult();\n\t\t\t\tif ( !Global.isArray( dashlet_list ) || dashlet_list.length < 1 ) {\n\t\t\t\t\t$this.api_dashboard.getDefaultDashlets( {\n\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\tdashlet_list = result.getResult();\n\t\t\t\t\t\t\t$this.is_getting_default_dashlet = true;\n\t\t\t\t\t\t\tdoOrder( dashlet_list );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tdoOrder( dashlet_list );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\tfunction doOrder( dashlet_list ) {\n\t\t\t$this.removeNoResultCover();\n\t\t\t$this.user_generic_data_api.getUserGenericData( {\n\t\t\t\tfilter_data: {\n\t\t\t\t\tscript: 'global_dashboard_order',\n\t\t\t\t\tname: 'order_data',\n\t\t\t\t\tdeleted: false\n\t\t\t\t}\n\t\t\t}, {\n\t\t\t\tonResult: function( order_result ) {\n\t\t\t\t\torder_result = order_result.getResult();\n\t\t\t\t\tif ( Global.isArray( order_result ) && order_result.length == 1 ) {\n\t\t\t\t\t\t$this.order_data = order_result[0];\n\t\t\t\t\t\tif ( $this.is_getting_default_dashlet ) {\n\t\t\t\t\t\t\t$this.order_data.data = [];\n\t\t\t\t\t\t\t$this.addMissedDashLetToOrder( dashlet_list );\n\t\t\t\t\t\t\t$this.is_getting_default_dashlet = false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//Error: Uncaught TypeError: $this.order_data.data.push is not a function in interface/html5/#!m=Home line 550\n\t\t\t\t\t\t\tif ( !$this.order_data.data || !Global.isArray( $this.order_data.data ) ) {\n\t\t\t\t\t\t\t\t$this.order_data.data = [];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this.addMissedDashLetToOrder( dashlet_list );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this.dashlet_list = [];\n\t\t\t\t\t\tfor ( var y = 0, yy = $this.order_data.data.length; y < yy; y++ ) {\n\t\t\t\t\t\t\tvar order_id = $this.order_data.data[y];\n\t\t\t\t\t\t\tvar found = false;\n\t\t\t\t\t\t\tfor ( var j = 0, jj = dashlet_list.length; j < jj; j++ ) {\n\t\t\t\t\t\t\t\tvar dashlet = dashlet_list[j];\n\t\t\t\t\t\t\t\tif ( dashlet.id.toString() === order_id.toString() ) {\n\t\t\t\t\t\t\t\t\t$this.dashlet_list.push( dashlet );\n\t\t\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this.dashlet_list = dashlet_list;\n\t\t\t\t\t}\n\t\t\t\t\tif ( $this.dashlet_list.length > 0 ) {\n\t\t\t\t\t\tloadPage( $this.dashlet_list[i] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tfunction loadPage( dashlet_data ) {\n\t\t\tGlobal.loadScript( 'views/home/dashlet/DashletController.js', function() {\n\t\t\t\tvar id = 'dashlet_' + dashlet_data.id;\n\t\t\t\tvar dash_let = $( '' +\n\t\t\t\t\t'
' +\n\t\t\t\t\t'
' +\n\t\t\t\t\t'
' +\n\t\t\t\t\t'' +\n\t\t\t\t\t'' +\n\t\t\t\t\t'' +\n\t\t\t\t\t'' +\n\t\t\t\t\t'
' +\n\t\t\t\t\t'
' +\n\t\t\t\t\t'
' +\n\t\t\t\t\t'
' +\n\t\t\t\t\t'
' +\n\t\t\t\t\t'
' +\n\t\t\t\t\t'
' +\n\t\t\t\t\t'
' +\n\t\t\t\t\t'
' );\n\t\t\t\tif ( !dashlet_data.data.height || auto_arrange ) {\n\t\t\t\t\tdashlet_data.data.height = 200;\n\t\t\t\t}\n\t\t\t\tif ( !dashlet_data.data.width || auto_arrange ) {\n\t\t\t\t\tif ( dashlet_data.data.dashlet_type === 'custom_report' ) {\n\t\t\t\t\t\tdashlet_data.data.width = 99;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdashlet_data.data.width = 33;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//Dashlet resizing changed in Vue to \"snap to\" certain values. Making sure users coming from legacy ui have a smooth\n\t\t\t\t//transition to the new \"snap to\" dashlet sizes. For example an old dashlet height of 257px will be set to 260px.\n\t\t\t\t//If we do not change old values then \"snap to\" functionality will not work due to mismatch.\n\t\t\t\tif ( dashlet_data.data.height % 10 !== 0 ) {\n\t\t\t\t\tdashlet_data.data.height = Math.round( dashlet_data.data.height / 10 ) * 10;\n\t\t\t\t}\n\t\t\t\tif ( dashlet_data.data.width % 1 !== 0 ) {\n\t\t\t\t\tdashlet_data.data.width = Math.round( dashlet_data.data.width );\n\t\t\t\t}\n\n\t\t\t\tdash_let.css( 'height', dashlet_data.data.height + 'px' );\n\t\t\t\tdash_let.css( 'width', dashlet_data.data.width + '%' );\n\t\t\t\t$this.dashboard_container.append( dash_let );\n\t\t\t\tdash_let.find( '.tticon' ).unbind( 'click' ).bind( 'click', function( e ) {\n\t\t\t\t\tvar target = e.target;\n\t\t\t\t\tvar container = $( target ).parent().parent().parent();\n\t\t\t\t\t// Error: Uncaught TypeError: Cannot read property 'split' of undefined in interface/html5/#!m=Home line 490\n\t\t\t\t\tif ( !container.attr( 'id' ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tvar dashlet_id = container.attr( 'id' ).split( '_' )[1];\n\n\t\t\t\t\tif ( $( target ).hasClass( 'delete-btn' ) ) {\n\t\t\t\t\t\t$this.deleteDashlet( dashlet_id, $( container ) );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $( target ).hasClass( 'modify-btn' ) ) {\n\t\t\t\t\t\t$this.modifyDashlet( dashlet_id );\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\t\t\t\tvar dashlet_controller = new DashletController();\n\t\t\t\t$this.dashletControllerArray.push( dashlet_controller );\n\t\t\t\tdashlet_controller.el = '#' + id;\n\t\t\t\tdashlet_controller.data = dashlet_data;\n\t\t\t\tdashlet_controller.homeViewController = $this;\n\t\t\t\tdashlet_controller.initContent();\n\t\t\t\t// Update width and height to default one if doing auto arrange\n\t\t\t\tif ( auto_arrange ) {\n\t\t\t\t\t$this.user_generic_data_api.setUserGenericData( dashlet_data, {\n\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\ti = i + 1;\n\t\t\t\tif ( i < $this.dashlet_list.length ) {\n\t\t\t\t\tloadPage( $this.dashlet_list[i] );\n\t\t\t\t} else {\n\t\t\t\t\t$this.updateLayout();\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t//BUG#2070 - Break sortable for mobile because it negatively impacts usability\n\t\tif ( Global.detectMobileBrowser() ) {\n\t\t\tthis.dashboard_container.sortable( { disabled: true } );\n\t\t}\n\t}\n\n\tshowNoResultCover() {\n\t\tthis.removeNoResultCover();\n\t\tthis.no_result_box = Global.loadWidgetByName( WidgetNamesDic.NO_RESULT_BOX );\n\t\tthis.no_result_box.NoResultBox( {\n\t\t\trelated_view_controller: this,\n\t\t\tis_new: true,\n\t\t\tmessage: $.i18n._( 'No Dashlets Found' ),\n\t\t\ticonLabel: $.i18n._( 'Add' )\n\t\t} );\n\t\tthis.no_result_box.attr( 'id', '#dashboard_' + this.viewId + '_no_result_box' );\n\t\t$( this.el ).find( '.container' ).append( this.no_result_box );\n\t}\n\n\tremoveNoResultCover() {\n\t\tif ( this.no_result_box && this.no_result_box.length > 0 ) {\n\t\t\tthis.no_result_box.remove();\n\t\t}\n\t\tthis.no_result_box = null;\n\t}\n\n\taddMissedDashLetToOrder( dashlet_list ) {\n\t\tvar $this = this;\n\t\t//Error: Uncaught TypeError: $this.order_data.data.push is not a function in interface/html5/#!m=Home line 546\n\t\tif ( !$this.order_data || !$this.order_data.data ) {\n\t\t\treturn;\n\t\t}\n\t\tfor ( var j = 0, jj = dashlet_list.length; j < jj; j++ ) {\n\t\t\tvar dashlet = dashlet_list[j];\n\t\t\tvar found = false;\n\t\t\tfor ( var y = 0, yy = $this.order_data.data.length; y < yy; y++ ) {\n\t\t\t\tvar order_id = $this.order_data.data[y];\n\t\t\t\tif ( dashlet.id.toString() === order_id.toString() ) {\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( !found ) {\n\t\t\t\t$this.order_data.data.push( dashlet.id.toString() );\n\t\t\t}\n\t\t\tif ( this.is_getting_default_dashlet ) {\n\t\t\t\t$this.order_data.data.sort();\n\t\t\t}\n\n\t\t}\n\t}\n\n\tupdateLayout() {\n\t\tvar $this = this;\n\n\t\tthis.saveScrollPosition();\n\t\tif ( this.initMasonryDone ) {\n\t\t\tthis.dashboard_container.masonry( 'destroy' );\n\t\t\tthis.dashboard_container.sortable( 'destroy' );\n\t\t} else {\n\t\t\tthis.initMasonryDone = true;\n\t\t}\n\t\tthis.dashboard_container.masonry( {\n\t\t\t'columnWidth': 1,\n\t\t\titemSelector: '.dashlet-container'\n\t\t} );\n\n\t\tthis.dashboard_container.on( 'mouseup', function() {\n\t\t\t$( '.dashlet-cover--display-red' ).removeClass( 'dashlet-cover--display-red' );\n\t\t\t$( '.dashlet-cover--display-green' ).removeClass( 'dashlet-cover--display-green' );\n\t\t} );\n\n\t\tthis.dashboard_container.on( 'mousemove', function( e ) {\n\t\t\tvar x = e.pageX;\n\t\t\tvar y = e.pageY;\n\t\t\t$this.current_mouse_position = { x: x, y: y };\n\t\t} );\n\n\t\tthis.dashboard_container.sortable( {\n\t\t\tforceHelperSize: true,\n\t\t\tforcePlaceholderSize: true,\n\t\t\tgrid: [3, 10],\n\t\t\tcontainment: '.container',\n\t\t\tchange: function( e, ui ) {\n\t\t\t\t$( '.dashlet-cover--display-red' ).removeClass( 'dashlet-cover--display-red' );\n\t\t\t\t$( '.dashlet-cover--display-green' ).removeClass( 'dashlet-cover--display-green' );\n\t\t\t\t// //#2353 custom code to maintain the hover ui hint\n\t\t\t\tvar placeholder_index = $( '.ui-sortable-placeholder' ).index();\n\n\t\t\t\tif ( placeholder_index != -1 ) {\n\t\t\t\t\tvar dashlets_to_loop = $( '.dashlet-container' );\n\t\t\t\t\tfor ( var x = 0; x < dashlets_to_loop.length; x++ ) {\n\t\t\t\t\t\tif ( $( dashlets_to_loop[x] ).attr( 'id' ) != ui.item.attr( 'id' ) ) {\n\t\t\t\t\t\t\t//ensure collision and on one side of placeholder or the other\n\t\t\t\t\t\t\tif ( ( $( dashlets_to_loop[x] ).index() == ( placeholder_index + 1 ) || $( dashlets_to_loop[x] ).index() == ( placeholder_index - 1 ) ) && checkCollision( $( dashlets_to_loop[x] ), $this.current_mouse_position ) ) {\n\t\t\t\t\t\t\t\t//mouseover the right half.\n\t\t\t\t\t\t\t\tvar direction;\n\t\t\t\t\t\t\t\tif ( $this.current_mouse_position.x >= ( $( dashlets_to_loop[x] ).offset().left + ( $( dashlets_to_loop[x] ).width() / 2 ) ) && $this.current_mouse_position.x <= ( $( dashlets_to_loop[x] ).offset().left + ( $( dashlets_to_loop[x] ).width() ) ) ) {\n\t\t\t\t\t\t\t\t\tdirection = 'RIGHT';\n\t\t\t\t\t\t\t\t\t$( dashlets_to_loop[x] ).find( '.dashlet-right-cover' ).addClass( 'dashlet-cover--display-green' );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tdirection = 'LEFT';\n\t\t\t\t\t\t\t\t\t$( dashlets_to_loop[x] ).find( '.dashlet-left-cover' ).addClass( 'dashlet-cover--display-green' );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tstop: function( e, ui ) {\n\t\t\t\t$this.saveNewOrder();\n\t\t\t\t$this.updateLayout();\n\t\t\t\tvar draggingTargetId = ui.item.attr( 'id' ).split( '_' )[1];\n\t\t\t\tfor ( var j = 0, jj = $this.dashletControllerArray.length; j < jj; j++ ) {\n\t\t\t\t\tvar dashlet = $this.dashletControllerArray[j];\n\t\t\t\t\tif ( draggingTargetId == dashlet.data.id ) {\n\t\t\t\t\t\tdashlet.refreshIfNecessary();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this.dashboard_container.masonry( 'reloadItems' );\n\t\t\t}\n\t\t} );\n\n\t\tfunction checkCollision( el, mouse_coords ) {\n\t\t\tel = $( el );\n\n\t\t\tif ( el.offset().left <= mouse_coords.x && ( el.offset().left + el.width() ) >= mouse_coords.x\n\t\t\t\t&& el.offset().top <= mouse_coords.y && el.offset().top + el.height() >= mouse_coords.y\n\t\t\t) {\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.recoverCurrentScrollPosition();\n\n\t\tTTPromise.resolve( 'init', 'init' );\n\t}\n\n\tsaveNewOrder( callBack ) {\n\t\tvar $this = this;\n\t\tvar dashlets = $( this.el ).find( '.dashlet-container:not(.ui-sortable-placeholder)' );\n\t\tvar new_order = [];\n\t\tfor ( var i = 0, ii = dashlets.length; i < ii; i++ ) {\n\t\t\tvar dashlet = $( dashlets[i] );\n\t\t\tvar id = dashlet.attr( 'id' ).split( '_' )[1];\n\t\t\tnew_order.push( id );\n\t\t}\n\t\tvar arg = {};\n\t\tif ( this.order_data ) {\n\t\t\tthis.order_data.data = new_order;\n\t\t\targ = this.order_data;\n\t\t} else {\n\t\t\targ.name = 'order_data';\n\t\t\targ.script = 'global_dashboard_order';\n\t\t\targ.is_default = true;\n\t\t\targ.data = new_order;\n\t\t}\n\n\t\tthis.user_generic_data_api.setUserGenericData( arg, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar result_data = result.getResult();\n\t\t\t\tif ( result_data != true && TTUUID.isUUID( result_data ) && result_data != TTUUID.zero_id && result_data != TTUUID.not_exist_id ) {\n\t\t\t\t\t$this.order_data = { id: result_data };\n\t\t\t\t\t$this.order_data.data = new_order;\n\t\t\t\t\tif ( callBack ) {\n\t\t\t\t\t\tcallBack();\n\t\t\t\t\t}\n\t\t\t\t} else if ( result_data === true ) {\n\t\t\t\t\tif ( callBack ) {\n\t\t\t\t\t\tcallBack();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\tcleanWhenUnloadView() {\n\t\tthis.unLoadCurrentDashlets();\n\t}\n\n\tmodifyDashlet( id ) {\n\t\tvar $this = this;\n\t\tIndexViewController.openWizard( 'DashletWizard', { saved_dashlet_id: id }, function() {\n\t\t\t$this.initDashBoard();\n\t\t} );\n\t}\n\n\tdeleteDashlet( id, target ) {\n\t\tvar $this = this;\n\t\tTAlertManager.showConfirmAlert( Global.delete_dashlet_confirm_message, null, function( result ) {\n\t\t\tif ( result ) {\n\t\t\t\tProgressBar.showOverlay();\n\t\t\t\t$this.user_generic_data_api.deleteUserGenericData( id, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\ttarget.remove();\n\t\t\t\t\t\t$this.removeDeletedDashletsData( id );\n\t\t\t\t\t\tif ( $( $this.el ).find( '.dashboard-container' ).children().length < 1 ) {\n\t\t\t\t\t\t\t$this.showNoResultCover();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this.saveNewOrder( function() {\n\t\t\t\t\t\t\t\t$this.updateLayout();\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tProgressBar.closeOverlay();\n\t\t\t}\n\t\t} );\n\t}\n\n\tremoveDeletedDashletsData( id ) {\n\t\tfor ( var i = 0, ii = this.dashlet_list.length; i < ii; i++ ) {\n\t\t\tif ( this.dashlet_list[i].id.toString() === id ) {\n\t\t\t\tthis.dashlet_list.splice( i, 1 );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tsaveScrollPosition() {\n\t\tthis.current_scroll_position = this.dashboard_container.parent().scrollTop();\n\t}\n\n\trecoverCurrentScrollPosition() {\n\t\tif ( this.current_scroll_position > 0 ) {\n\t\t\tthis.dashboard_container.parent().scrollTop( this.current_scroll_position );\n\t\t}\n\t}\n\n}\n\nHomeViewController.html_template = `\n\t\n`;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzY1Ny5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7OztBQUEyQztBQUNOO0FBQ21COztBQUVqRCxpQ0FBaUMsaUVBQWM7QUFDdEQsMkJBQTJCO0FBQzNCLEVBQUUsQ0FBQztBQUNIOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBLElBQUk7O0FBRUo7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGNBQWM7QUFDZDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLE9BQU87QUFDUDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBLEVBQUUscURBQWEsYUFB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