cronapp-framework-js 2.8.25 → 2.8.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/crn-chart.components.json +1 -0
- package/components/crn-cron-grid.components.json +24 -34
- package/components/crn-dynamic-menu.components.json +1 -0
- package/components/crn-ordered-sub-list.components.json +1 -2
- package/components/crn-textinputbutton.components.json +8 -0
- package/components/crn-vertical-container.components.json +3 -3
- package/components/templates/cron-autocomplete.designtime.html +33 -1
- package/components/templates/cron-dynamic-combobox.template.html +3 -4
- package/components/templates/grid-vertical.template.html +2 -2
- package/components/templates/navbar.template.html +5 -5
- package/components/templates/textinputbutton.template.html +12 -5
- package/css/app.css +15 -0
- package/css/modalTemplate.css +6 -1
- package/css/themes/custom/material/custom-material.css +0 -4
- package/dist/components/css/font-size.css +1 -0
- package/dist/components/css/image.css +1 -0
- package/dist/components/templates/cron-autocomplete.designtime.html +26 -1
- package/dist/components/templates/cron-dynamic-combobox.template.html +1 -1
- package/dist/components/templates/grid-vertical.template.html +1 -1
- package/dist/components/templates/navbar.template.html +1 -1
- package/dist/components/templates/textinputbutton.template.html +1 -1
- package/dist/css/animate.css +1 -0
- package/dist/css/app.css +1 -1
- package/dist/css/fonts/glyphicons-halflings-regular.eot +0 -0
- package/dist/css/fonts/glyphicons-halflings-regular.svg +1 -0
- package/dist/css/fonts/glyphicons-halflings-regular.ttf +0 -0
- package/dist/css/fonts/glyphicons-halflings-regular.woff +0 -0
- package/dist/css/fonts/glyphicons-halflings-regular.woff2 +0 -0
- package/dist/css/modalTemplate.css +1 -0
- package/dist/css/themes/cerulean.min.css +1 -0
- package/dist/css/themes/cosmo.min.css +1 -0
- package/dist/css/themes/custom/cerulean/custom-cerulean.min.css +13 -0
- package/dist/css/themes/custom/cosmo/custom-cosmo.min.css +13 -0
- package/dist/css/themes/custom/cyborg/custom-cyborg.min.css +13 -0
- package/dist/css/themes/custom/darkly/custom-darkly.min.css +13 -0
- package/dist/css/themes/custom/flatly/custom-flatly.min.css +13 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/_media-print.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/alert.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/animations.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/badge.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/basics.css +11 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/blockquote.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/breadcrumb.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/btn.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/carousel.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/close.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/col.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/collapse.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/container.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/dropdown.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/embed-responsive.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/fade.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/figure_img.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/form-control.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/glyphicon.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/import_bootswatch.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/input-group.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/input.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/jumbotron.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/label.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/list-group.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/media.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/modal.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/nav.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/navbar.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/pager.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/pagination.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/panel.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/popover.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/progress.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/table.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/text.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/thumbnail.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/tooltip.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/visible.css +1 -0
- package/dist/css/themes/custom/fuse/_bootswatch-v3.3.7/well.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/alert.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/badge.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/blockquote.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/breadcrumb.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/btn.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/carousel.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/close.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/embed-responsive.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/form.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/glyphicon.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/hidden.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/import_components_css.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/list-group.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/media.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/modal.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/navbar.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/pager.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/pagination.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/panel.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/popover.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/progress.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/table.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/thumbnail.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/tooltip.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/type_bootstrap.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/visible.css +1 -0
- package/dist/css/themes/custom/fuse/components_css/well.css +1 -0
- package/dist/css/themes/custom/fuse/custom-fuse.min.css +1 -0
- package/dist/css/themes/custom/fuse/font/Inter-roman.var.woff2 +0 -0
- package/dist/css/themes/custom/fuse/font/font.css +1 -0
- package/dist/css/themes/custom/journal/custom-journal.min.css +12 -0
- package/dist/css/themes/custom/lumen/custom-lumen.min.css +13 -0
- package/dist/css/themes/custom/material/components_css/crn-button.css +1 -0
- package/dist/css/themes/custom/material/components_css/crn-carousel.css +1 -0
- package/dist/css/themes/custom/material/components_css/crn-cron-calendar.css +1 -0
- package/dist/css/themes/custom/material/components_css/crn-cron-grid.css +1 -0
- package/dist/css/themes/custom/material/components_css/crn-enterprise.css +1 -0
- package/dist/css/themes/custom/material/components_css/crn-navbar.css +1 -0
- package/dist/css/themes/custom/material/components_css/crn-scheduler.css +1 -0
- package/dist/css/themes/custom/material/components_css/login.css +1 -0
- package/dist/css/themes/custom/material/components_css/ui-notification.css +1 -0
- package/dist/css/themes/custom/material/custom-material.css +1 -0
- package/dist/css/themes/custom/navigator/custom-navigator.css +1 -0
- package/dist/css/themes/custom/paper/custom-paper.min.css +13 -0
- package/dist/css/themes/custom/readable/custom-readable.min.css +13 -0
- package/dist/css/themes/custom/sandstone/custom-sandstone.min.css +13 -0
- package/dist/css/themes/custom/simplex/custom-simplex.min.css +13 -0
- package/dist/css/themes/custom/slate/custom-slate.min.css +13 -0
- package/dist/css/themes/custom/spacelab/custom-spacelab.min.css +13 -0
- package/dist/css/themes/custom/superhero/custom-superhero.min.css +13 -0
- package/dist/css/themes/custom/united/custom-united.min.css +13 -0
- package/dist/css/themes/custom/yeti/custom-yeti.min.css +13 -0
- package/dist/css/themes/cyborg.min.css +1 -0
- package/dist/css/themes/darkly.min.css +1 -0
- package/dist/css/themes/flatly.min.css +1 -0
- package/dist/css/themes/fuse.min.css +1 -0
- package/dist/css/themes/journal.min.css +1 -0
- package/dist/css/themes/lumen.min.css +1 -0
- package/dist/css/themes/material.min.css +1 -0
- package/dist/css/themes/paper.min.css +1 -0
- package/dist/css/themes/readable.min.css +1 -0
- package/dist/css/themes/sandstone.min.css +1 -0
- package/dist/css/themes/simplex.min.css +1 -0
- package/dist/css/themes/slate.min.css +1 -0
- package/dist/css/themes/spacelab.min.css +1 -0
- package/dist/css/themes/superhero.min.css +1 -0
- package/dist/css/themes/united.min.css +1 -0
- package/dist/css/themes/yeti.min.css +1 -0
- package/dist/img/barcode.png +0 -0
- package/dist/img/cronGrid.png +0 -0
- package/dist/img/cronRichEditor.png +0 -0
- package/dist/img/cronapp-logo-login.png +0 -0
- package/dist/img/logo.png +0 -0
- package/dist/img/placehold-100x100.png +0 -0
- package/dist/img/placehold-900x500.png +0 -0
- package/dist/img/qrcode.png +0 -0
- package/dist/img/selectFile.png +0 -0
- package/dist/img/switch.png +0 -0
- package/dist/js/app.js +1 -1
- package/dist/js/controllers.js +1 -1
- package/dist/js/directives.js +1 -1
- package/dist/js/reports/reports.service.js +1 -1
- package/dist/js/upload.service.js +1 -1
- package/gulpfile.js +1 -1
- package/js/app.js +57 -23
- package/js/controllers.js +20 -26
- package/js/directives.js +31 -11
- package/js/reports/reports.service.js +3 -0
- package/js/upload.service.js +7 -3
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){angular.module("report.services",[]).service("ReportService",["$http","$compile","$modal","$translate","$window","$rootScope",function(a,b,c,d,e,f){var g=$("body"),i=angular.element(g.get(0)).scope(),j=["node_modules/cronapp-lib-js/dist/js/stimulsoft/stimulsoft-all.js","node_modules/cronapp-lib-js/dist/js/stimulsoft/stimulsoft-helper.js"],k=[];this.getReport=function(b){var c={url:"api/rest/report",method:"POST",data:angular.toJson({reportName:b})};return a(c)},this.getPDF=function(b){var c={url:"api/rest/report/pdf",method:"POST",responseType:"arraybuffer",data:angular.toJson(b)};return a(c)},this.getPDFAsFile=function(b){var c={url:"api/rest/report/pdfasfile",method:"POST",data:angular.toJson(b)};return a(c)},this.getContentAsString=function(b){var c={url:"api/rest/report/contentasstring",method:"POST",data:angular.toJson(b)};return a(c)},this.getDataSourcesParams=function(b){var c={url:"api/rest/report/getdatasourcesparams",method:"POST",data:angular.toJson(b)};return a(c)},this.openURLContent=function(a){var c=$("#reportViewContext");c.get(0)||(console.log("include[#reportViewContext]"),g.append("<div id=\"reportViewContext\" ng-include=\"'node_modules/cronapp-framework-js/components/reports/reports.view.html'\"></div>"),b(g)(i),c=$("#reportViewContext"));var d=function(){var b=$("<iframe/>");b.attr("frameborder",0);var e=parseInt($(window).height());b.attr("height",e-200),b.attr("width","100%"),b.attr("src",a+"?download=false");var f=$("#reportView .modal-body");f.get(0)?(f.html(b),$("#reportViewContext .modal-dialog").css("width","95%"),setTimeout(function(){console.log("open[#reportViewContext]"),$("body").append(c),$("#reportView").modal()},100)):(console.log("wait[#reportViewContext]"),setTimeout(d,200))};setTimeout(d,200)},this.initializeStimulsoft=function(a){if(!Stimulsoft.Base.StiLicense.Key){stimulsoftHelper.setLanguage(a);var b=stimulsoftHelper.getLocalization();Stimulsoft.Base.Localization.StiLocalization.loadLocalization(b.xml),Stimulsoft.Base.Localization.StiLocalization.cultureName=b.cultureName,Stimulsoft.Base.StiLicense.Key=stimulsoftHelper.getKey()}},this.openStimulsoftReport=function(a,c,d,e){var j=$("#reportViewContext");j.get(0)||(g.append("<div id=\"reportViewContext\" ng-include=\"'node_modules/cronapp-framework-js/components/reports/reports.view.html'\"></div>"),b(g)(i),j=$("#reportViewContext"));var k=parseInt($(window).height()),h=k-200+"px",l="StiViewer"+app.common.generateId(),m=new Stimulsoft.Report.StiReport;f.reportTitle=a.ReportAlias,m.load(a),d||(d=stimulsoftHelper.getDatasourcesInBand(m)),c&&c.forEach(function(a){d.datasources.forEach(function(b){for(var c=0;c<b.fieldParams.length;c++)if(b.fieldParams[c].param==a.originalName){b.fieldParams[c].value=a.value;break}})}),stimulsoftHelper.setParamsInFilter(m.dictionary.dataSources,d.datasources);var n=()=>{var a=new Stimulsoft.Viewer.StiViewerOptions;a.toolbar.showAboutButton=!1,e?(a.toolbar.visible=e.showToolbar,a.appearance.scrollbarsMode=e.showScrollbar,null!=e.height&&(a.height=e.height+"px")):(a.appearance.scrollbarsMode=!0,a.height=h);var b=new Stimulsoft.Viewer.StiViewer(a,l,!1);return b.report=m,b};if(e&&e.$element)n(e).renderHtml(e.$element[0]);else{function b(){var a,b,c,d,e,f=setInterval(function(){var g=$("#"+l);g.length?!a&&(a=g.parent(),b=a.parent(),c=b.parent(),d=c.parent(),e=d.parent()):(console.log("cleared interval: "+l),clearInterval(f))},100)}function d(c){var d=setInterval(function(){var f=$("<div/>");f.attr("id","contentReport"),f.attr("width","100%");var g=$("#reportView .modal-body");g.get(0)&&(g.html(f),$("#reportViewContext .modal-dialog").css("width","95%"),setTimeout(function(){console.log("open[#reportViewContext]"),$("body").append(j),cronapi.screen.showModal("reportView"),a.reportConfig&&"HTML"===a.reportConfig.renderType?n(e).renderHtml("contentReport"):$("#contentReport").html("<iframe src=\""+c+"\" width=\"100%\" height=\""+h+"\"></iframe>"),setTimeout(function(){b()},100)},100),clearInterval(d))},200)}if(!a.reportConfig||"PDFSERVER"===a.reportConfig.renderType)this.getPDF({reportName:a.reportName,parameters:c}).then(function(a){var b=new Blob([new Uint8Array(a.data)],{type:"application/pdf"}),c=URL.createObjectURL(b);d(c)}.bind(this));else{var o=new Stimulsoft.Report.Export.StiPdfExportSettings,p=new Stimulsoft.Report.Export.StiPdfExportService,q=new Stimulsoft.System.IO.MemoryStream;m.renderAsync(function(){a.reportConfig&&"PDF"!==a.reportConfig.renderType&&a.reportConfig.renderType!==void 0?d(null):p.exportToAsync(function(){var a=q.toArray(),b=new Blob([new Uint8Array(a)],{type:"application/pdf"}),c=URL.createObjectURL(b);d(c)},m,q,o)},!1)}}$(`#${l}`).find("img").attr("alt",""),$(`#${l}`).find("input").attr("aria-label",l)},this.showParameters=function(a){var b=a.parameters,d=[],e=0,f=function(a){return a.replace(/([.*+?^=!:()|\[\]\/\\])/g,"\\$1")},g=function(a,b,c){return a.replace(new RegExp(f(b),"g"),c)},h=function(){if(e<b.length){var f=b[e++];$.get("node_modules/cronapp-framework-js/components/reports/"+f.type+".parameter.html").done(function(a){d.push(g(a,"_field_",f.name)),h()})}else 0<d.length&&c.open({templateUrl:"node_modules/cronapp-framework-js/components/reports/reports.parameters.html",controller:"ParameterController",resolve:{report:function(){return JSON.parse(JSON.stringify(a))},htmlParameters:function(){return JSON.parse(JSON.stringify(d))}}})}.bind(this);h()},this.mergeParam=function(a,b){var c=function(a,b){for(var c in Object.keys(b)){var d=Object.keys(b[c])[0];if(a==d)return Object.values(b[c])[0]}};for(var d in Object.keys(a)){var e=a[d].name,f=a[d].value,g=c(e,b);g&&(a[d].value=g)}return a},this.setVariablesBasedOnParams=function(a,b){for(var c in b){var d=Object.keys(b[c])[0],e=b[c][d];for(var f in a)if(a[f]&&a[f].Name&&a[f].Name===d){a[f].Value=e;break}}},this.hasParameterWithOutValue=function(a){for(var b in Object.keys(a))if(!a[b].value)return!0;return!1},this.getDatasourcesInBand=function(a){var b=new Stimulsoft.Report.StiReport;b.load(a);var c=stimulsoftHelper.getDatasourcesInBand(b);return c},this.loadSriptsStimulsoft=function(a){var b=!0,c=j.length,d=0;Pace.options.initialRate=.7,Pace.options.minTime=1750,Pace.options.maxProgressPerFrame=1,Pace.options.ghostTime=12e4;let e=setInterval(()=>Pace.restart(),2500);j.forEach(function(f){this.loadScript(f,function(f){d++,f||(b=!1),d==c&&(clearInterval(e),Pace.options.initialRate=.03,Pace.options.minTime=250,Pace.options.maxProgressPerFrame=20,Pace.options.ghostTime=10,Pace.stop(),a(b))})}.bind(this))},this.loadScript=function(a,b){if(0<=$.inArray(a,k))return void(b&&b(!0));if(-1!=a.indexOf(".css")){var c=document.createElement("link");c.rel="stylesheet",c.type="text/css",c.href=a,c.media="all",c.onload=function(){k.push(a),b&&b(!0)},c.onerror=function(){b&&b(!1)};try{document.getElementsByTagName("head")[0].appendChild(c)}catch(a){console.log(a)}}else{var d=document.createElement("script");d.type="text/javascript",d.readyState?d.onreadystatechange=function(){("loaded"==d.readyState||"complete"==d.readyState)&&(d.onreadystatechange=null,k.push(a),b&&b(!0))}:d.onload=function(){k.push(a),b&&b(!0)},d.src=a,document.getElementsByTagName("head")[0].appendChild(d)}},this.openReport=function(a,b,c){this.getReport(a).then(function(a){a&&a.data&&(a.data.reportName.endsWith(".report")?this.loadSriptsStimulsoft(function(e){e?(this.initializeStimulsoft(d.use()),this.getContentAsString(a.data).then(function(e){var f=this.getDatasourcesInBand(e.data);this.getDataSourcesParams(f).then(function(g){f=g.data,a.data.parameters=stimulsoftHelper.parseToGroupedParam(f.datasources),a.data.contentData=e.data,a.data.datasourcesInBand=f,b&&(a.data.parameters=this.mergeParam(a.data.parameters,b),a.data.contentData.Dictionary=a.data.contentData.Dictionary||{},this.setVariablesBasedOnParams(a.data.contentData.Dictionary.Variables,b)),this.hasParameterWithOutValue(a.data.parameters)&&!c?(a.data.parameters.forEach(function(a){a.name=d.instant(a.name)}),this.showParameters(JSON.parse(JSON.stringify(a.data)))):this.openStimulsoftReport(e.data,a.data.parameters,a.data.datasourcesInBand,c)}.bind(this))}.bind(this),function(a){var b=cronapi.internal.getErrorMessage(a,a.statusText);i.Notification.error(b)}.bind(this))):i.Notification.error("Error loading report script")}.bind(this)):0==a.data.parameters.length||1==a.data.parameters.length&&"DATA_LIMIT"==a.data.parameters[0].name?this.getPDFAsFile(a.data.reportName).then(function(a){this.openURLContent(a.data)}.bind(this),function(a){var b=cronapi.internal.getErrorMessage(a,a.statusText);i.Notification.error(b)}.bind(this)):(b&&(a.data.parameters=this.mergeParam(a.data.parameters,b)),this.hasParameterWithOutValue(a.data.parameters)?this.showParameters(JSON.parse(JSON.stringify(a.data))):this.getPDFAsFile(a.data).then(function(a){this.openURLContent(a.data)}.bind(this))))}.bind(this))}}])})(app);
|
|
1
|
+
(function(){angular.module("report.services",[]).service("ReportService",["$http","$compile","$modal","$translate","$window","$rootScope",function(a,b,c,d,e,f){var g=$("body"),i=angular.element(g.get(0)).scope(),j=["node_modules/cronapp-lib-js/dist/js/stimulsoft/stimulsoft-all.js","node_modules/cronapp-lib-js/dist/js/stimulsoft/stimulsoft-helper.js"],k=[];this.getReport=function(b){var c={url:"api/rest/report",method:"POST",data:angular.toJson({reportName:b})};return a(c)},this.getPDF=function(b){var c={url:"api/rest/report/pdf",method:"POST",responseType:"arraybuffer",data:angular.toJson(b)};return a(c)},this.getPDFAsFile=function(b){var c={url:"api/rest/report/pdfasfile",method:"POST",data:angular.toJson(b)};return a(c)},this.getContentAsString=function(b){var c={url:"api/rest/report/contentasstring",method:"POST",data:angular.toJson(b)};return a(c)},this.getDataSourcesParams=function(b){var c={url:"api/rest/report/getdatasourcesparams",method:"POST",data:angular.toJson(b)};return a(c)},this.openURLContent=function(a){var c=$("#reportViewContext");c.get(0)||(console.log("include[#reportViewContext]"),g.append("<div id=\"reportViewContext\" ng-include=\"'node_modules/cronapp-framework-js/components/reports/reports.view.html'\"></div>"),b(g)(i),c=$("#reportViewContext"));var d=function(){var b=$("<iframe/>");b.attr("frameborder",0);var e=parseInt($(window).height());b.attr("height",e-200),b.attr("width","100%"),b.attr("src",a+"?download=false");var f=$("#reportView .modal-body");f.get(0)?(f.html(b),$("#reportViewContext .modal-dialog").css("width","95%"),setTimeout(function(){console.log("open[#reportViewContext]"),$("body").append(c),$("#reportView").modal()},100)):(console.log("wait[#reportViewContext]"),setTimeout(d,200))};setTimeout(d,200)},this.initializeStimulsoft=function(a){if(!Stimulsoft.Base.StiLicense.Key){stimulsoftHelper.setLanguage(a);var b=stimulsoftHelper.getLocalization();Stimulsoft.Base.Localization.StiLocalization.loadLocalization(b.xml),Stimulsoft.Base.Localization.StiLocalization.cultureName=b.cultureName,Stimulsoft.Base.StiLicense.Key=stimulsoftHelper.getKey()}},this.openStimulsoftReport=function(a,c,d,e){var j=$("#reportViewContext");j.get(0)||(g.append("<div id=\"reportViewContext\" ng-include=\"'node_modules/cronapp-framework-js/components/reports/reports.view.html'\"></div>"),b(g)(i),j=$("#reportViewContext"));var k=parseInt($(window).height()),h=k-200+"px",l="StiViewer"+app.common.generateId(),m=new Stimulsoft.Report.StiReport;f.reportTitle=a.ReportAlias,m.load(a),d||(d=stimulsoftHelper.getDatasourcesInBand(m)),c&&c.forEach(function(a){d.datasources.forEach(function(b){for(var c=0;c<b.fieldParams.length;c++)if(b.fieldParams[c].param==a.originalName){b.fieldParams[c].value=a.value;break}})}),stimulsoftHelper.setParamsInFilter(m.dictionary.dataSources,d.datasources);var n=()=>{var a=new Stimulsoft.Viewer.StiViewerOptions;a.toolbar.showAboutButton=!1,e?(a.toolbar.visible=e.showToolbar,a.appearance.scrollbarsMode=e.showScrollbar,null!=e.height&&(a.height=e.height+"px")):(a.appearance.scrollbarsMode=!0,a.height=h);var b=new Stimulsoft.Viewer.StiViewer(a,l,!1);return b.report=m,StiJsViewer.prototype.IsTouchDevice()&&(b.options.appearance.interfaceType=Stimulsoft.Viewer.StiInterfaceType.Touch),b};if(e&&e.$element)n(e).renderHtml(e.$element[0]);else{function b(){var a,b,c,d,e,f=setInterval(function(){var g=$("#"+l);g.length?!a&&(a=g.parent(),b=a.parent(),c=b.parent(),d=c.parent(),e=d.parent()):(console.log("cleared interval: "+l),clearInterval(f))},100)}function d(c){var d=setInterval(function(){var f=$("<div/>");f.attr("id","contentReport"),f.attr("width","100%");var g=$("#reportView .modal-body");g.get(0)&&(g.html(f),$("#reportViewContext .modal-dialog").css("width","95%"),setTimeout(function(){console.log("open[#reportViewContext]"),$("body").append(j),cronapi.screen.showModal("reportView"),a.reportConfig&&"HTML"===a.reportConfig.renderType?n(e).renderHtml("contentReport"):$("#contentReport").html("<iframe src=\""+c+"\" width=\"100%\" height=\""+h+"\"></iframe>"),setTimeout(function(){b()},100)},100),clearInterval(d))},200)}if(!a.reportConfig||"PDFSERVER"===a.reportConfig.renderType)this.getPDF({reportName:a.reportName,parameters:c}).then(function(a){var b=new Blob([new Uint8Array(a.data)],{type:"application/pdf"}),c=URL.createObjectURL(b);d(c)}.bind(this));else{var o=new Stimulsoft.Report.Export.StiPdfExportSettings,p=new Stimulsoft.Report.Export.StiPdfExportService,q=new Stimulsoft.System.IO.MemoryStream;m.renderAsync(function(){a.reportConfig&&"PDF"!==a.reportConfig.renderType&&a.reportConfig.renderType!==void 0?d(null):p.exportToAsync(function(){var a=q.toArray(),b=new Blob([new Uint8Array(a)],{type:"application/pdf"}),c=URL.createObjectURL(b);d(c)},m,q,o)},!1)}}$(`#${l}`).find("img").attr("alt",""),$(`#${l}`).find("input").attr("aria-label",l)},this.showParameters=function(a){var b=a.parameters,d=[],e=0,f=function(a){return a.replace(/([.*+?^=!:()|\[\]\/\\])/g,"\\$1")},g=function(a,b,c){return a.replace(new RegExp(f(b),"g"),c)},h=function(){if(e<b.length){var f=b[e++];$.get("node_modules/cronapp-framework-js/components/reports/"+f.type+".parameter.html").done(function(a){d.push(g(a,"_field_",f.name)),h()})}else 0<d.length&&c.open({templateUrl:"node_modules/cronapp-framework-js/components/reports/reports.parameters.html",controller:"ParameterController",resolve:{report:function(){return JSON.parse(JSON.stringify(a))},htmlParameters:function(){return JSON.parse(JSON.stringify(d))}}})}.bind(this);h()},this.mergeParam=function(a,b){var c=function(a,b){for(var c in Object.keys(b)){var d=Object.keys(b[c])[0];if(a==d)return Object.values(b[c])[0]}};for(var d in Object.keys(a)){var e=a[d].name,f=a[d].value,g=c(e,b);g&&(a[d].value=g)}return a},this.setVariablesBasedOnParams=function(a,b){for(var c in b){var d=Object.keys(b[c])[0],e=b[c][d];for(var f in a)if(a[f]&&a[f].Name&&a[f].Name===d){a[f].Value=e;break}}},this.hasParameterWithOutValue=function(a){for(var b in Object.keys(a))if(!a[b].value)return!0;return!1},this.getDatasourcesInBand=function(a){var b=new Stimulsoft.Report.StiReport;b.load(a);var c=stimulsoftHelper.getDatasourcesInBand(b);return c},this.loadSriptsStimulsoft=function(a){var b=!0,c=j.length,d=0;Pace.options.initialRate=.7,Pace.options.minTime=1750,Pace.options.maxProgressPerFrame=1,Pace.options.ghostTime=12e4;let e=setInterval(()=>Pace.restart(),2500);j.forEach(function(f){this.loadScript(f,function(f){d++,f||(b=!1),d==c&&(clearInterval(e),Pace.options.initialRate=.03,Pace.options.minTime=250,Pace.options.maxProgressPerFrame=20,Pace.options.ghostTime=10,Pace.stop(),a(b))})}.bind(this))},this.loadScript=function(a,b){if(0<=$.inArray(a,k))return void(b&&b(!0));if(-1!=a.indexOf(".css")){var c=document.createElement("link");c.rel="stylesheet",c.type="text/css",c.href=a,c.media="all",c.onload=function(){k.push(a),b&&b(!0)},c.onerror=function(){b&&b(!1)};try{document.getElementsByTagName("head")[0].appendChild(c)}catch(a){console.log(a)}}else{var d=document.createElement("script");d.type="text/javascript",d.readyState?d.onreadystatechange=function(){("loaded"==d.readyState||"complete"==d.readyState)&&(d.onreadystatechange=null,k.push(a),b&&b(!0))}:d.onload=function(){k.push(a),b&&b(!0)},d.src=a,document.getElementsByTagName("head")[0].appendChild(d)}},this.openReport=function(a,b,c){this.getReport(a).then(function(a){a&&a.data&&(a.data.reportName.endsWith(".report")?this.loadSriptsStimulsoft(function(e){e?(this.initializeStimulsoft(d.use()),this.getContentAsString(a.data).then(function(e){var f=this.getDatasourcesInBand(e.data);this.getDataSourcesParams(f).then(function(g){f=g.data,a.data.parameters=stimulsoftHelper.parseToGroupedParam(f.datasources),a.data.contentData=e.data,a.data.datasourcesInBand=f,b&&(a.data.parameters=this.mergeParam(a.data.parameters,b),a.data.contentData.Dictionary=a.data.contentData.Dictionary||{},this.setVariablesBasedOnParams(a.data.contentData.Dictionary.Variables,b)),this.hasParameterWithOutValue(a.data.parameters)&&!c?(a.data.parameters.forEach(function(a){a.name=d.instant(a.name)}),this.showParameters(JSON.parse(JSON.stringify(a.data)))):this.openStimulsoftReport(e.data,a.data.parameters,a.data.datasourcesInBand,c)}.bind(this))}.bind(this),function(a){var b=cronapi.internal.getErrorMessage(a,a.statusText);i.Notification.error(b)}.bind(this))):i.Notification.error("Error loading report script")}.bind(this)):0==a.data.parameters.length||1==a.data.parameters.length&&"DATA_LIMIT"==a.data.parameters[0].name?this.getPDFAsFile(a.data.reportName).then(function(a){this.openURLContent(a.data)}.bind(this),function(a){var b=cronapi.internal.getErrorMessage(a,a.statusText);i.Notification.error(b)}.bind(this)):(b&&(a.data.parameters=this.mergeParam(a.data.parameters,b)),this.hasParameterWithOutValue(a.data.parameters)?this.showParameters(JSON.parse(JSON.stringify(a.data))):this.getPDFAsFile(a.data).then(function(a){this.openURLContent(a.data)}.bind(this))))}.bind(this))}}])})(app);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){function a(a){var b=[].slice.call(arguments,1),c=0;return a.replace(/%s/g,function(){return b[c++]})}angular.module("upload.services",[]).service("UploadService",["$http","$compile","$modal","Upload",function(a,b,c){var d=$("body"),e=angular.element(d.get(0)).scope();this.ensureProps=a=>(a.filter&&(a.filter=a.filter.replace(/\s/g,"")),a),this.upload=function(a){let b=this.ensureProps(a);c.open({templateUrl:"node_modules/cronapp-framework-js/components/upload/upload.html",controller:"UploadController",resolve:{data:function(){return b}}})}.bind(this)}]),angular.module("custom.controllers").controller("UploadController",["$scope","$http","$translate","$stateParams","$location","$http","$modalInstance","data",function(b,c,d,e,f,c,g,h){app.registerEventsCronapi(b,d),b.params=e,b.$http=c;var i=f.search();for(var j in i)i.hasOwnProperty(j)&&(b.params[j]=i[j]);b.files=[],b.uploading=!1,b.uploaded=!0,b.progress=0,b.data=h,b.message=d.instant("Upload.oneFile"),"true"==h.multiple&&(b.message=d.instant("Upload.multipleFile")),h.description&&(b.message=h.description),b.safeApply=safeApply,b.uploadFile=function(e){var f=b.data.scope,g="api/cronapi/upload/"+h.id,j=new FormData;if(0==e.length)this.Notification.error(a(d.instant("Upload.errorValidation"),h.maxSize,h.filter));else{for(var k=0;k<e.length;k++)j.append("file",e[k]),console.log(e[k].$valid);var l=JSON.parse(localStorage.getItem("_u"));this.$promise=c({method:"POST",url:(window.hostApp||"")+g,data:j,headers:{"Content-Type":void 0,"X-AUTH-TOKEN":l?l.token:""},onProgress:function(a){this.safeApply(function(){if(a.lengthComputable){var c=0|100*(a.loaded/a.total);b.progress=c}b.uploading=!0,console.log(c)})}.bind(this)}).
|
|
1
|
+
(function(){function a(a){var b=[].slice.call(arguments,1),c=0;return a.replace(/%s/g,function(){return b[c++]})}angular.module("upload.services",[]).service("UploadService",["$http","$compile","$modal","Upload",function(a,b,c){var d=$("body"),e=angular.element(d.get(0)).scope();this.ensureProps=a=>(a.filter&&(a.filter=a.filter.replace(/\s/g,"")),a),this.upload=function(a){let b=this.ensureProps(a);c.open({templateUrl:"node_modules/cronapp-framework-js/components/upload/upload.html",controller:"UploadController",resolve:{data:function(){return b}}})}.bind(this)}]),angular.module("custom.controllers").controller("UploadController",["$scope","$http","$translate","$stateParams","$location","$http","$modalInstance","data",function(b,c,d,e,f,c,g,h){app.registerEventsCronapi(b,d),b.params=e,b.$http=c;var i=f.search();for(var j in i)i.hasOwnProperty(j)&&(b.params[j]=i[j]);b.files=[],b.uploading=!1,b.uploaded=!0,b.progress=0,b.data=h,b.message=d.instant("Upload.oneFile"),"true"==h.multiple&&(b.message=d.instant("Upload.multipleFile")),h.description&&(b.message=h.description),b.safeApply=safeApply,b.uploadFile=function(e){var f=b.data.scope,g="api/cronapi/upload/"+h.id,j=new FormData;if(0==e.length)this.Notification.error(a(d.instant("Upload.errorValidation"),h.maxSize,h.filter));else{for(var k=0;k<e.length;k++)j.append("file",e[k]),console.log(e[k].$valid);var l=JSON.parse(localStorage.getItem("_u"));this.$promise=c({method:"POST",url:(window.hostApp||"")+g,data:j,headers:{"Content-Type":void 0,"X-AUTH-TOKEN":l?l.token:""},onProgress:function(a){this.safeApply(function(){if(a.lengthComputable){var c=0|100*(a.loaded/a.total);b.progress=c}b.uploading=!0,console.log(c)})}.bind(this)}).then(function(a){f.cronapi.evalInContext(JSON.stringify(a)).then(()=>{b.uploaded=!0,b.uploading=!1,b.close()})}.bind(this)).catch(function(a){let c=a.error;a&&a.data&&(c=a.data.error),this.Notification.error(c),b.uploading=!1,b.close()}.bind(this))}}.bind(b),b.close=function(){g.dismiss("cancel")}}])})(app);
|
package/gulpfile.js
CHANGED
|
@@ -20,7 +20,7 @@ gulp.task('minify-js', function() {
|
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
gulp.task('minify-css', function() {
|
|
23
|
-
return gulp.src(['css
|
|
23
|
+
return gulp.src(['css/**/*'])
|
|
24
24
|
.pipe(uglifycss())
|
|
25
25
|
.pipe(gulp.dest('dist/css/'));
|
|
26
26
|
});
|
package/js/app.js
CHANGED
|
@@ -30,6 +30,14 @@ var onloadCallback = function() {
|
|
|
30
30
|
window.grecaptcha.reset();
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
var getRequestData = data => {
|
|
34
|
+
let result = data || {};
|
|
35
|
+
if (data.data && typeof data.data === 'object') {
|
|
36
|
+
result = data.data;
|
|
37
|
+
}
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
|
|
33
41
|
var app = (function() {
|
|
34
42
|
|
|
35
43
|
return angular.module('MyApp', cronappModules)
|
|
@@ -41,6 +49,9 @@ var app = (function() {
|
|
|
41
49
|
'preferredLocale': 'pt_br',
|
|
42
50
|
'urlPrefix': ''
|
|
43
51
|
})
|
|
52
|
+
.config(['$locationProvider', function($locationProvider) {
|
|
53
|
+
$locationProvider.hashPrefix('');
|
|
54
|
+
}])
|
|
44
55
|
.config([
|
|
45
56
|
'$httpProvider',
|
|
46
57
|
function($httpProvider) {
|
|
@@ -127,6 +138,8 @@ var app = (function() {
|
|
|
127
138
|
|
|
128
139
|
var locale = (window.navigator.userLanguage || window.navigator.language).replace('-', '_').toLowerCase();
|
|
129
140
|
$translateProvider.use(locale);
|
|
141
|
+
$translateProvider.preferredLanguage(locale);
|
|
142
|
+
$translateProvider.fallbackLanguage('en_us');
|
|
130
143
|
|
|
131
144
|
$translateProvider.useSanitizeValueStrategy('escaped');
|
|
132
145
|
|
|
@@ -199,7 +212,7 @@ var app = (function() {
|
|
|
199
212
|
$scope.UploadService = UploadService;
|
|
200
213
|
$scope.$state = $state;
|
|
201
214
|
|
|
202
|
-
app.registerEventsCronapi($scope, $translate);
|
|
215
|
+
app.registerEventsCronapi($scope, $translate, $location);
|
|
203
216
|
|
|
204
217
|
$("form").kendoValidator({
|
|
205
218
|
errorTemplate: '<span class="k-widget k-tooltip-validation k-x-invalid-msg-block">#=message#</span>',
|
|
@@ -246,7 +259,7 @@ var app = (function() {
|
|
|
246
259
|
|
|
247
260
|
})
|
|
248
261
|
|
|
249
|
-
.run(function($rootScope, $state, $stateParams, $timeout) {
|
|
262
|
+
.run(function($rootScope, $state, $stateParams, $timeout, $transitions) {
|
|
250
263
|
// It's very handy to add references to $state and $stateParams to the $rootScope
|
|
251
264
|
// so that you can access them from any scope within your applications.For example,
|
|
252
265
|
// <li ng-class="{ active: $state.includes('contacts.list') }"> will set the <li>
|
|
@@ -254,26 +267,27 @@ var app = (function() {
|
|
|
254
267
|
$rootScope.$state = $state;
|
|
255
268
|
$rootScope.$stateParams = $stateParams;
|
|
256
269
|
|
|
257
|
-
$
|
|
258
|
-
if (
|
|
259
|
-
|
|
260
|
-
if (
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
270
|
+
const $stateChangeError = function(error) {
|
|
271
|
+
if (error) {
|
|
272
|
+
const errorMessage = error.toString();
|
|
273
|
+
if (errorMessage.includes('=404')) {
|
|
274
|
+
$state.go('404');
|
|
275
|
+
}
|
|
276
|
+
else if (errorMessage.includes('=403')) {
|
|
277
|
+
$state.go('403');
|
|
278
|
+
}
|
|
279
|
+
else if (errorMessage.includes('=401')) {
|
|
280
|
+
localStorage.removeItem('_u');
|
|
281
|
+
$state.go('loginReturnUrl', { "returnUrl" : window.location.hash });
|
|
282
|
+
} else {
|
|
283
|
+
$state.go('404');
|
|
271
284
|
}
|
|
272
285
|
} else {
|
|
273
286
|
$state.go('404');
|
|
274
287
|
}
|
|
275
|
-
}
|
|
276
|
-
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
const $stateChangeSuccess = function(currentRoute) {
|
|
277
291
|
$timeout(() => {
|
|
278
292
|
let systemName = $('#projectName').length ? $('#projectName').val() : $('h1:first').length && $('h1:first').text().trim().length ? $('h1:first').text().trim() : '';
|
|
279
293
|
|
|
@@ -320,7 +334,11 @@ var app = (function() {
|
|
|
320
334
|
|
|
321
335
|
$rootScope.renderFinished = true;
|
|
322
336
|
});
|
|
323
|
-
}
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
$transitions.onSuccess({}, (transition) => $stateChangeSuccess(transition.to()));
|
|
340
|
+
$state.defaultErrorHandler(error => $stateChangeError(error));
|
|
341
|
+
|
|
324
342
|
});
|
|
325
343
|
|
|
326
344
|
}(window));
|
|
@@ -347,7 +365,23 @@ app.bindScope = function($scope, obj) {
|
|
|
347
365
|
return newObj;
|
|
348
366
|
};
|
|
349
367
|
|
|
350
|
-
app.registerEventsCronapi = function($scope, $translate) {
|
|
368
|
+
app.registerEventsCronapi = function($scope, $translate, $location) {
|
|
369
|
+
|
|
370
|
+
let $stateParams = $scope.params || {};
|
|
371
|
+
let queryStringParams = $location && $location.search() || {};
|
|
372
|
+
$scope.params = {};
|
|
373
|
+
|
|
374
|
+
let makeCopy = (from, to) => {
|
|
375
|
+
for (let key in from) {
|
|
376
|
+
if (from.hasOwnProperty(key)) {
|
|
377
|
+
to[key] = from[key];
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
makeCopy($stateParams, $scope.params);
|
|
382
|
+
makeCopy(queryStringParams, $scope.params);
|
|
383
|
+
|
|
384
|
+
|
|
351
385
|
for (var x in app.userEvents)
|
|
352
386
|
$scope[x] = app.userEvents[x].bind($scope);
|
|
353
387
|
|
|
@@ -419,9 +453,9 @@ app.factory('customTranslateLoader', function ($http, $q) {
|
|
|
419
453
|
].join(''),
|
|
420
454
|
method: 'GET',
|
|
421
455
|
params: ''
|
|
422
|
-
}, options.$http)).
|
|
423
|
-
deferred.resolve(data);
|
|
424
|
-
}).
|
|
456
|
+
}, options.$http)).then(function (data) {
|
|
457
|
+
deferred.resolve(getRequestData(data));
|
|
458
|
+
}).catch(function () {
|
|
425
459
|
deferred.resolve({});
|
|
426
460
|
});
|
|
427
461
|
|
package/js/controllers.js
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
$http({
|
|
7
7
|
method: 'GET',
|
|
8
8
|
url: 'auth/refresh'
|
|
9
|
-
}).
|
|
9
|
+
}).then(function (data, status, headers, config) {
|
|
10
|
+
data = getRequestData(data);
|
|
10
11
|
//Keeping the user information, the auth/refresh only has name and username info
|
|
11
12
|
if (localStorage.getItem("_u")) {
|
|
12
13
|
let currentSession = JSON.parse(localStorage.getItem("_u"));
|
|
@@ -21,7 +22,7 @@
|
|
|
21
22
|
// refresh time
|
|
22
23
|
}, (1800 * 1000));
|
|
23
24
|
success();
|
|
24
|
-
}).
|
|
25
|
+
}).catch(function () {
|
|
25
26
|
error();
|
|
26
27
|
});
|
|
27
28
|
};
|
|
@@ -51,12 +52,12 @@
|
|
|
51
52
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
52
53
|
'X-AUTH-TOKEN': $location.search().token
|
|
53
54
|
}
|
|
54
|
-
}).
|
|
55
|
+
}).then(() => {
|
|
55
56
|
Notification.info($translate.instant('ResetPasswordSuccess'));
|
|
56
57
|
passwordNew.value = "";
|
|
57
58
|
passwordConfirmation.value = "";
|
|
58
59
|
$state.go('login');
|
|
59
|
-
}).
|
|
60
|
+
}).catch(data => Notification.error(data));
|
|
60
61
|
//
|
|
61
62
|
}
|
|
62
63
|
});
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
$scope.$http = $http;
|
|
81
82
|
$scope.params = $stateParams;
|
|
82
83
|
$scope.$state = $state;
|
|
83
|
-
app.registerEventsCronapi($scope, $translate);
|
|
84
|
+
app.registerEventsCronapi($scope, $translate, $location);
|
|
84
85
|
|
|
85
86
|
$rootScope.http = $http;
|
|
86
87
|
$rootScope.Notification = Notification;
|
|
@@ -90,12 +91,6 @@
|
|
|
90
91
|
ReportService.openReport(reportName, params, config);
|
|
91
92
|
};
|
|
92
93
|
|
|
93
|
-
var queryStringParams = $location.search();
|
|
94
|
-
for (var key in queryStringParams) {
|
|
95
|
-
if (queryStringParams.hasOwnProperty(key)) {
|
|
96
|
-
$scope.params[key] = queryStringParams[key];
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
94
|
$scope.redirectToLogin = function() {
|
|
100
95
|
$scope.cronapi.social.ssoLogin();
|
|
101
96
|
};
|
|
@@ -160,7 +155,7 @@
|
|
|
160
155
|
url : 'auth',
|
|
161
156
|
data : $.param(user),
|
|
162
157
|
headers : headerValues
|
|
163
|
-
}).
|
|
158
|
+
}).then(handleSuccess).catch(handleError);
|
|
164
159
|
};
|
|
165
160
|
|
|
166
161
|
$scope.forgotPassword = function () {
|
|
@@ -181,14 +176,15 @@
|
|
|
181
176
|
headers: {
|
|
182
177
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
183
178
|
}
|
|
184
|
-
}).
|
|
179
|
+
}).then(() => {
|
|
185
180
|
Notification.info($translate.instant('ForgotPasswordSent'));
|
|
186
181
|
forgotPasswordEmail.value = "";
|
|
187
182
|
$("#forgotPasswordModal").modal("hide");
|
|
188
|
-
}).
|
|
183
|
+
}).catch(data => Notification.error(data));
|
|
189
184
|
};
|
|
190
185
|
|
|
191
186
|
function handleSuccess(data, status, headers, config) {
|
|
187
|
+
data = getRequestData(data);
|
|
192
188
|
// Store data response on session storage
|
|
193
189
|
// The local storage will be cleaned when the browser window is closed
|
|
194
190
|
if(typeof (Storage) !== "undefined") {
|
|
@@ -212,6 +208,8 @@
|
|
|
212
208
|
}
|
|
213
209
|
|
|
214
210
|
function handleError(data, status, headers, config) {
|
|
211
|
+
status = status || data.status;
|
|
212
|
+
data = getRequestData(data);
|
|
215
213
|
let error;
|
|
216
214
|
if (data !== null && data.message) {
|
|
217
215
|
let message = JSON.parse(data.message);
|
|
@@ -246,7 +244,7 @@
|
|
|
246
244
|
$scope.$http = $http;
|
|
247
245
|
$scope.params = $stateParams;
|
|
248
246
|
$scope.$state = $state;
|
|
249
|
-
app.registerEventsCronapi($scope, $translate);
|
|
247
|
+
app.registerEventsCronapi($scope, $translate, $location);
|
|
250
248
|
|
|
251
249
|
$rootScope.http = $http;
|
|
252
250
|
$rootScope.Notification = Notification;
|
|
@@ -256,13 +254,6 @@
|
|
|
256
254
|
ReportService.openReport(reportName, params, config);
|
|
257
255
|
};
|
|
258
256
|
|
|
259
|
-
var queryStringParams = $location.search();
|
|
260
|
-
for (var key in queryStringParams) {
|
|
261
|
-
if (queryStringParams.hasOwnProperty(key)) {
|
|
262
|
-
$scope.params[key] = queryStringParams[key];
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
257
|
$scope.message = {};
|
|
267
258
|
|
|
268
259
|
$scope.selecionado = {
|
|
@@ -311,9 +302,10 @@
|
|
|
311
302
|
headers : {
|
|
312
303
|
'Content-Type' : 'application/json'
|
|
313
304
|
}
|
|
314
|
-
}).
|
|
305
|
+
}).then(clean).catch(clean);
|
|
315
306
|
|
|
316
307
|
function clean(result) {
|
|
308
|
+
result = getRequestData(result);
|
|
317
309
|
$rootScope.session = {};
|
|
318
310
|
if(typeof (Storage) !== "undefined") {
|
|
319
311
|
localStorage.removeItem("_u");
|
|
@@ -343,7 +335,7 @@
|
|
|
343
335
|
headers : {
|
|
344
336
|
'Content-Type' : 'application/x-www-form-urlencoded'
|
|
345
337
|
}
|
|
346
|
-
}).
|
|
338
|
+
}).then(changeSuccess).catch(changeError);
|
|
347
339
|
}
|
|
348
340
|
|
|
349
341
|
function changeSuccess(data, status, headers, config) {
|
|
@@ -352,6 +344,8 @@
|
|
|
352
344
|
}
|
|
353
345
|
|
|
354
346
|
function changeError(data, status, headers, config) {
|
|
347
|
+
status = status || data.status;
|
|
348
|
+
data = getRequestData(data);
|
|
355
349
|
var error;
|
|
356
350
|
|
|
357
351
|
if (status === 422) {
|
|
@@ -439,7 +433,7 @@
|
|
|
439
433
|
headers : {
|
|
440
434
|
'Content-Type' : 'application/x-www-form-urlencoded'
|
|
441
435
|
}
|
|
442
|
-
}).
|
|
436
|
+
}).then(changeSuccess).catch(changeError);
|
|
443
437
|
|
|
444
438
|
function changeSuccess(data, status, headers, config) {
|
|
445
439
|
$rootScope.session.theme = theme;
|
|
@@ -448,7 +442,7 @@
|
|
|
448
442
|
}
|
|
449
443
|
|
|
450
444
|
function changeError(data, status, headers, config) {
|
|
451
|
-
var error = data;
|
|
445
|
+
var error = getRequestData(data);
|
|
452
446
|
Notification.error(error);
|
|
453
447
|
}
|
|
454
448
|
}
|
package/js/directives.js
CHANGED
|
@@ -2126,7 +2126,8 @@
|
|
|
2126
2126
|
let waitRender = setInterval(function() {
|
|
2127
2127
|
let $myElement = $('#' + componentId);
|
|
2128
2128
|
if ($myElement.length > 0) {
|
|
2129
|
-
|
|
2129
|
+
let $closeTdElemen = $myElement.closest('td');
|
|
2130
|
+
let x = angular.element($closeTdElemen || $myElement);
|
|
2130
2131
|
$compile(x)(scope);
|
|
2131
2132
|
clearInterval(waitRender);
|
|
2132
2133
|
resolve(componentId);
|
|
@@ -2722,11 +2723,16 @@
|
|
|
2722
2723
|
};
|
|
2723
2724
|
|
|
2724
2725
|
var compileListing = function(e) {
|
|
2725
|
-
if (e.sender.tbody && e.sender.tbody.length
|
|
2726
|
+
if (e.sender.tbody && e.sender.tbody.length) {
|
|
2726
2727
|
|
|
2727
2728
|
var toCompile = e.sender.tbody;
|
|
2728
|
-
if (
|
|
2729
|
-
toCompile
|
|
2729
|
+
if (!$(e.sender.tbody).find('.k-grid-edit-row').length) {
|
|
2730
|
+
if (toCompile.parent() && toCompile.parent().parent() && toCompile.parent().parent().parent() )
|
|
2731
|
+
toCompile = toCompile.parent().parent().parent();
|
|
2732
|
+
}
|
|
2733
|
+
else {
|
|
2734
|
+
toCompile = $(e.sender.tbody).find('tr:not(.k-grid-edit-row)');
|
|
2735
|
+
}
|
|
2730
2736
|
|
|
2731
2737
|
scope.safeApply(function() {
|
|
2732
2738
|
var trs = $(toCompile);
|
|
@@ -3511,6 +3517,7 @@
|
|
|
3511
3517
|
}
|
|
3512
3518
|
},
|
|
3513
3519
|
link: async function (scope, element, attrs, ngModelCtrl) {
|
|
3520
|
+
await cronapi.internal.skipIterationLoop();
|
|
3514
3521
|
var modelGetter = $parse(attrs['ngModel']);
|
|
3515
3522
|
var modelSetter = modelGetter.assign;
|
|
3516
3523
|
var select = {};
|
|
@@ -4287,6 +4294,11 @@
|
|
|
4287
4294
|
config.slide = attrs.ngSlide ? function (){scope.$eval(attrs.ngSlide)}: undefined;
|
|
4288
4295
|
var slider = $(element).kendoSlider(config).data("kendoSlider");
|
|
4289
4296
|
|
|
4297
|
+
const resizeObserver = new ResizeObserver(entries => {
|
|
4298
|
+
slider.resize();
|
|
4299
|
+
});
|
|
4300
|
+
resizeObserver.observe(slider.wrapper[0])
|
|
4301
|
+
|
|
4290
4302
|
if (attrs.ngRequired || attrs.required) {
|
|
4291
4303
|
var id = attrs.id ? ' id="input' + app.common.generateId() + '"' : '';
|
|
4292
4304
|
var name = attrs.name ? ' name="input' + app.common.generateId() + '"' : '';
|
|
@@ -4582,13 +4594,13 @@
|
|
|
4582
4594
|
|
|
4583
4595
|
if (item.menuItems.length > 0) {
|
|
4584
4596
|
templateItens = templateItens + '\
|
|
4585
|
-
<li class="dropdown-submenu" ' + hide + '> \
|
|
4597
|
+
<li class="dropdown-submenu" ' + security + hide + '> \
|
|
4586
4598
|
<a href="" ' + action + ' class="dropdown-item dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">' + iconClass + title + caret + ' </a> \
|
|
4587
4599
|
' + populateSubitems(item) + '\
|
|
4588
4600
|
</li>';
|
|
4589
4601
|
} else {
|
|
4590
4602
|
templateItens = templateItens + '\
|
|
4591
|
-
<li class="dropdown-submenu" ' + hide + '> \
|
|
4603
|
+
<li class="dropdown-submenu" ' + security + hide + '> \
|
|
4592
4604
|
<a href="" ' + action + ' class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">' + iconClass + title + caret + ' </a> \
|
|
4593
4605
|
</li>';
|
|
4594
4606
|
}
|
|
@@ -4699,14 +4711,22 @@
|
|
|
4699
4711
|
return {
|
|
4700
4712
|
restrict: 'A',
|
|
4701
4713
|
require: 'ngModel',
|
|
4702
|
-
link: function(scope, element, attrs, ngModelCtrl) {
|
|
4714
|
+
link: async function(scope, element, attrs, ngModelCtrl) {
|
|
4703
4715
|
if (attrs.ngInitialValue) {
|
|
4704
4716
|
var modelGetter = $parse(attrs['ngModel']);
|
|
4705
4717
|
var modelSetter = modelGetter.assign;
|
|
4706
4718
|
var evaluated;
|
|
4707
4719
|
|
|
4708
4720
|
try {
|
|
4709
|
-
|
|
4721
|
+
if(attrs.ngInitialValue.indexOf("cronapi.client('js.") != -1){//cronapi caller?
|
|
4722
|
+
let shortVersion = attrs.ngInitialValue.replace("cronapi.client('js.", 'blockly.js.');
|
|
4723
|
+
let blocklyPackage = shortVersion.split("').names")[0];
|
|
4724
|
+
blocklyPackage = blocklyPackage.split("').attr()")[0];
|
|
4725
|
+
let blocklyParams = shortVersion.split('.run')[1];
|
|
4726
|
+
evaluated = await scope.$eval(blocklyPackage + blocklyParams);
|
|
4727
|
+
} else {
|
|
4728
|
+
evaluated = scope.$eval(attrs.ngInitialValue);
|
|
4729
|
+
}
|
|
4710
4730
|
} catch (e) {
|
|
4711
4731
|
evaluated = attrs.ngInitialValue;
|
|
4712
4732
|
}
|
|
@@ -4766,7 +4786,7 @@
|
|
|
4766
4786
|
viewValue = null;
|
|
4767
4787
|
el.prop('indeterminate', true);
|
|
4768
4788
|
}
|
|
4769
|
-
ctrl.$setViewValue(viewValue);
|
|
4789
|
+
setTimeout(() => ctrl.$setViewValue(viewValue));
|
|
4770
4790
|
};
|
|
4771
4791
|
} else if (attrs.crnAllowNullValues == 'false') {
|
|
4772
4792
|
ctrl.$render = function () {
|
|
@@ -4776,7 +4796,7 @@
|
|
|
4776
4796
|
viewValue = false;
|
|
4777
4797
|
}
|
|
4778
4798
|
if (viewValue === falseValue) {
|
|
4779
|
-
let modelForEval = `${el.attr('ng-model')}=${
|
|
4799
|
+
let modelForEval = `${el.attr('ng-model')}=${attrs.ngFalseValue}`;
|
|
4780
4800
|
scope.$eval(modelForEval);
|
|
4781
4801
|
}
|
|
4782
4802
|
el.data('checked', viewValue);
|
|
@@ -4793,7 +4813,7 @@
|
|
|
4793
4813
|
viewValue = falseValue;
|
|
4794
4814
|
break;
|
|
4795
4815
|
}
|
|
4796
|
-
ctrl.$setViewValue(viewValue);
|
|
4816
|
+
setTimeout(() => ctrl.$setViewValue(viewValue));
|
|
4797
4817
|
};
|
|
4798
4818
|
}
|
|
4799
4819
|
el.bind('click', function () {
|
|
@@ -156,6 +156,9 @@
|
|
|
156
156
|
}
|
|
157
157
|
var viewer = new Stimulsoft.Viewer.StiViewer(options, viewerId, false);
|
|
158
158
|
viewer.report = report;
|
|
159
|
+
if(StiJsViewer.prototype.IsTouchDevice()) {
|
|
160
|
+
viewer.options.appearance.interfaceType = Stimulsoft.Viewer.StiInterfaceType.Touch;
|
|
161
|
+
}
|
|
159
162
|
return viewer;
|
|
160
163
|
};
|
|
161
164
|
|
package/js/upload.service.js
CHANGED
|
@@ -98,14 +98,18 @@
|
|
|
98
98
|
console.log(complete);
|
|
99
99
|
});
|
|
100
100
|
}.bind(this)
|
|
101
|
-
}).
|
|
101
|
+
}).then(function(data, status, headers, config) {
|
|
102
102
|
pageScope.cronapi.evalInContext(JSON.stringify(data)).then((result) => {
|
|
103
103
|
$scope.uploaded = true;
|
|
104
104
|
$scope.uploading = false;
|
|
105
105
|
$scope.close();
|
|
106
106
|
});
|
|
107
|
-
}.bind(this)).
|
|
108
|
-
|
|
107
|
+
}.bind(this)).catch(function(data, status, errorThrown) {
|
|
108
|
+
let error = data.error;
|
|
109
|
+
if (data && data.data) {
|
|
110
|
+
error = data.data.error;
|
|
111
|
+
}
|
|
112
|
+
this.Notification.error(error);
|
|
109
113
|
$scope.uploading = false;
|
|
110
114
|
$scope.close();
|
|
111
115
|
}.bind(this));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cronapp-framework-js",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.29",
|
|
4
4
|
"description": "Javascript library for CronApp's projects",
|
|
5
5
|
"main": "cronapp.framework.js",
|
|
6
6
|
"scripts": {
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"pace": "HubSpot/pace#v0.7.8",
|
|
44
44
|
"raphael": "DmitryBaranovskiy/raphael#v2.1.4",
|
|
45
45
|
"ui-select-infinity": "hyzhak/ui-select-infinity#v0.1.5",
|
|
46
|
-
"angular-ui-router": "
|
|
46
|
+
"angular-ui-router": "1.0.29",
|
|
47
47
|
"eonasdan-bootstrap-datetimepicker": "^4.17.49",
|
|
48
48
|
"natives": "1.1.6",
|
|
49
|
-
"angular": "1.
|
|
49
|
+
"angular": "1.8.2",
|
|
50
50
|
"angular-ui-bootstrap": "0.13.0",
|
|
51
51
|
"angular-chart.js": "1.1.1",
|
|
52
52
|
"angular-cookies": "1.5.8",
|
|
@@ -54,21 +54,21 @@
|
|
|
54
54
|
"angular-i18n": "1.4.5",
|
|
55
55
|
"angular-resource": "1.3.15",
|
|
56
56
|
"angular-sanitize": "1.3.15",
|
|
57
|
-
"angular-translate": "2.
|
|
58
|
-
"angular-translate-handler-log": "2.
|
|
59
|
-
"angular-translate-loader-static-files": "2.
|
|
60
|
-
"angular-translate-storage-cookie": "2.
|
|
61
|
-
"angular-translate-storage-local": "2.
|
|
57
|
+
"angular-translate": "2.19.0",
|
|
58
|
+
"angular-translate-handler-log": "2.19.0",
|
|
59
|
+
"angular-translate-loader-static-files": "2.19.0",
|
|
60
|
+
"angular-translate-storage-cookie": "2.19.0",
|
|
61
|
+
"angular-translate-storage-local": "2.19.0",
|
|
62
62
|
"angular-ui-notification": "0.3.6",
|
|
63
63
|
"ui-select": "0.18.1",
|
|
64
|
-
"bootstrap": "3.
|
|
64
|
+
"bootstrap": "3.4.1",
|
|
65
65
|
"chart.js": "2.7.0",
|
|
66
66
|
"cpf_cnpj": "0.2.0",
|
|
67
67
|
"font-awesome": "4.4.0",
|
|
68
68
|
"jquery": "3.5.1",
|
|
69
69
|
"justgage": "1.3.5",
|
|
70
|
-
"moment": "2.
|
|
71
|
-
"moment-timezone": "0.
|
|
70
|
+
"moment": "2.29.1",
|
|
71
|
+
"moment-timezone": "0.5.33",
|
|
72
72
|
"ng-file-upload": "12.2.13"
|
|
73
73
|
}
|
|
74
74
|
}
|