public_html/layouts/basic/modules/Project/resources/GanttController.min.js.map
{"version":3,"file":"GanttController.min.js","sources":["GanttController.js"],"sourcesContent":["/* {[The file is published on the basis of YetiForce Public License 6.5 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */\n'use strict';\n\n$.Class(\n\t'Project_Gantt_Js',\n\t{},\n\t{\n\t\tfilterSelectElement: false,\n\t\tgetFilterSelectElement: function () {\n\t\t\tif (this.filterSelectElement == false) {\n\t\t\t\tthis.filterSelectElement = jQuery('#customFilter');\n\t\t\t}\n\t\t\treturn this.filterSelectElement;\n\t\t},\n\t\tgetDefaultParams: function () {\n\t\t\tvar params = {\n\t\t\t\tmodule: app.getModuleName(),\n\t\t\t\taction: 'GanttData'\n\t\t\t};\n\t\t\tif (app.getParentModuleName()) {\n\t\t\t\tparams.parent = app.getParentModuleName();\n\t\t\t}\n\t\t\treturn params;\n\t\t},\n\t\tgetCurrentCvId: function () {\n\t\t\treturn jQuery('#customFilter').find('option:selected').data('id');\n\t\t},\n\t\tgetGanttData(urlParams) {\n\t\t\tlet aDeferred = $.Deferred();\n\t\t\tif (typeof urlParams === 'undefined') {\n\t\t\t\turlParams = {};\n\t\t\t}\n\t\t\tlet defaultParams = this.getDefaultParams();\n\t\t\turlParams = $.extend(defaultParams, urlParams);\n\t\t\tconst progressInstance = jQuery.progressIndicator({\n\t\t\t\tblockInfo: {\n\t\t\t\t\tenabled: true,\n\t\t\t\t\tonBlock: () => {\n\t\t\t\t\t\tAppConnector.request(urlParams)\n\t\t\t\t\t\t\t.done(function (data) {\n\t\t\t\t\t\t\t\tprogressInstance.progressIndicator({ mode: 'hide' });\n\t\t\t\t\t\t\t\taDeferred.resolve(data);\n\t\t\t\t\t\t\t\tapp.notifyPostAjaxReady();\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.fail(function (textStatus, errorThrown) {\n\t\t\t\t\t\t\t\taDeferred.reject(textStatus, errorThrown);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn aDeferred.promise();\n\t\t},\n\t\t/**\n\t\t * load gantt\n\t\t */\n\t\tloadGantt(container = '.js-gantt__container', ganttData = false) {\n\t\t\tcontainer = $(container);\n\t\t\tthis.gantt = new Gantt(container);\n\t\t\tconst projectId = container.parent().find('input[name=\"projectId\"]').val();\n\t\t\tif (!ganttData) {\n\t\t\t\tthis.gantt.loadProjectFromAjax({\n\t\t\t\t\tmodule: app.getModuleName(),\n\t\t\t\t\taction: 'GanttData',\n\t\t\t\t\tprojectId: projectId\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * reload gantt with new data\n\t\t * @param data\n\t\t */\n\t\treloadData(data) {\n\t\t\tthis.gantt.reloadData(data);\n\t\t},\n\t\t/*\n\t\t * Function to register the event for changing the custom Filter\n\t\t */\n\t\tregisterChangeCustomFilterEvent: function () {\n\t\t\tvar thisInstance = this;\n\t\t\tthis.getFilterSelectElement().on('change', function (event) {\n\t\t\t\t$(`.nav-item[data-cvid='${thisInstance.getCurrentCvId()}'] .nav-link`).tab('show');\n\t\t\t\tvar currentTarget = jQuery(event.currentTarget);\n\t\t\t\tvar selectOption = currentTarget.find(':selected');\n\t\t\t\tapp.setMainParams('pageNumber', '1');\n\t\t\t\tapp.setMainParams('pageToJump', '1');\n\t\t\t\tapp.setMainParams('orderBy', selectOption.data('orderby'));\n\t\t\t\tapp.setMainParams('sortOrder', selectOption.data('sortorder'));\n\t\t\t\tthisInstance\n\t\t\t\t\t.getGanttData({\n\t\t\t\t\t\tviewname: jQuery(this).val()\n\t\t\t\t\t})\n\t\t\t\t\t.done(function (data) {\n\t\t\t\t\t\tthisInstance.reloadData(data.result);\n\t\t\t\t\t});\n\t\t\t\tevent.stopPropagation();\n\t\t\t});\n\t\t},\n\t\tgetSelectOptionFromChosenOption: function (liElement) {\n\t\t\tvar id = liElement.attr('id');\n\t\t\tvar idArr = id.split('-');\n\t\t\tvar currentOptionId = '';\n\t\t\tif (idArr.length > 0) {\n\t\t\t\tcurrentOptionId = idArr[idArr.length - 1];\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn jQuery('#filterOptionId_' + currentOptionId);\n\t\t},\n\t\tchangeCustomFilterElementView: function () {\n\t\t\tconst self = this,\n\t\t\t\tfilterSelectElement = this.getFilterSelectElement();\n\t\t\tif (filterSelectElement.length > 0 && filterSelectElement.is('select')) {\n\t\t\t\tApp.Fields.Picklist.showSelect2ElementView(filterSelectElement, {\n\t\t\t\t\ttemplateSelection: function (data) {\n\t\t\t\t\t\tconst resultContainer = document.createElement('span'),\n\t\t\t\t\t\t\tspan = document.createElement('span'),\n\t\t\t\t\t\t\timage = $('.filterImage').clone();\n\t\t\t\t\t\timage.removeAttr('style');\n\t\t\t\t\t\tspan.innerText = data.text;\n\t\t\t\t\t\tresultContainer.appendChild(image.get(0));\n\t\t\t\t\t\tresultContainer.appendChild(span);\n\t\t\t\t\t\treturn resultContainer;\n\t\t\t\t\t},\n\t\t\t\t\tcustomSortOptGroup: true,\n\t\t\t\t\tcloseOnSelect: true\n\t\t\t\t});\n\t\t\t\tconst select2Instance = filterSelectElement.data('select2');\n\t\t\t\tjQuery('.filterActionsDiv')\n\t\t\t\t\t.appendTo(select2Instance.$dropdown.find('.select2-dropdown:last'))\n\t\t\t\t\t.removeClass('d-none')\n\t\t\t\t\t.on('click', function (e) {\n\t\t\t\t\t\tself.registerCreateFilterClickEvent(e);\n\t\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tregisterEvents: function () {\n\t\t\tthis.changeCustomFilterElementView();\n\t\t\tthis.registerChangeCustomFilterEvent();\n\t\t\tVtiger_Helper_Js.showHorizontalTopScrollBar();\n\t\t\tthis.loadGantt();\n\t\t}\n\t}\n);\n"],"names":["$","Class","filterSelectElement","getFilterSelectElement","jQuery","getDefaultParams","params","module","app","getModuleName","action","getParentModuleName","parent","getCurrentCvId","find","data","getGanttData","urlParams","aDeferred","Deferred","defaultParams","extend","progressInstance","progressIndicator","blockInfo","enabled","onBlock","AppConnector","request","done","mode","resolve","notifyPostAjaxReady","fail","textStatus","errorThrown","reject","promise","loadGantt","container","arguments","length","ganttData","gantt","Gantt","projectId","val","loadProjectFromAjax","reloadData","registerChangeCustomFilterEvent","thisInstance","on","event","concat","tab","currentTarget","selectOption","setMainParams","viewname","result","stopPropagation","getSelectOptionFromChosenOption","liElement","id","attr","idArr","split","currentOptionId","changeCustomFilterElementView","self","is","App","Fields","Picklist","showSelect2ElementView","templateSelection","resultContainer","document","createElement","span","image","clone","removeAttr","innerText","text","appendChild","get","customSortOptGroup","closeOnSelect","select2Instance","appendTo","$dropdown","removeClass","e","registerCreateFilterClickEvent","registerEvents","Vtiger_Helper_Js","showHorizontalTopScrollBar"],"mappings":";;AAAA,kKACA,YAAY,CAEZA,CAAC,CAACC,KAAK,CACN,kBAAkB,CAClB,EAAE,CACF,CACCC,mBAAmB,CAAO,CAAA,CAAA,CAC1BC,sBAAsB,CAAE,SAAAA,sBAAAA,EAAY,CAInC,OAHI,CAAA,CAAA,EAAA,IAAI,CAACD,mBAA4B,GACpC,IAAI,CAACA,mBAAmB,CAAGE,MAAM,CAAC,eAAe,CAAC,CAAA,CAE5C,IAAI,CAACF,mBACb,CAAC,CACDG,gBAAgB,CAAE,SAAAA,gBAAA,EAAY,CAC7B,IAAIC,MAAM,CAAG,CACZC,MAAM,CAAEC,GAAG,CAACC,aAAa,EAAE,CAC3BC,MAAM,CAAE,WACT,CAAC,CAID,OAHIF,GAAG,CAACG,mBAAmB,EAAE,GAC5BL,MAAM,CAACM,MAAM,CAAGJ,GAAG,CAACG,mBAAmB,EAAE,CAAA,CAEnCL,MACR,CAAC,CACDO,cAAc,CAAE,SAAAA,cAAA,EAAY,CAC3B,OAAOT,MAAM,CAAC,eAAe,CAAC,CAACU,IAAI,CAAC,iBAAiB,CAAC,CAACC,IAAI,CAAC,IAAI,CACjE,CAAC,CACDC,YAAY,CAAAA,SAAAA,YAAAA,CAACC,SAA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