cronapp-framework-js 2.9.6-SP.4 → 2.9.6-SP.40
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-calendar.components.json +1 -0
- package/components/crn-dynamic-image.components.json +8 -0
- package/components/crn-enterprise-combobox-multiple.components.json +7 -0
- package/components/crn-navbar.components.json +2 -21
- package/components/templates/navbar.template.html +8 -7
- package/css/app.css +4 -0
- package/css/themes/custom/krypton/custom-krypton.css +667 -146
- package/css/themes/custom/krypton/grid-krypton.css +178 -45
- package/css/themes/custom/krypton/navbar-krypton.css +13 -10
- package/css/themes/custom/krypton/panel-krypton.css +14 -10
- package/css/themes/custom/material-round/custom-material-round.css +1029 -33
- package/css/themes/custom/material-round/grid-material-round.css +303 -8
- package/css/themes/custom/material-round/navbar-material-round.css +15 -5
- package/css/themes/custom/material-round/panel-material-round.css +4 -4
- package/css/themes/custom/navigator/custom-navigator.css +47 -20
- package/css/themes/custom/theme-general/menu-vertical-retratil.css +29 -20
- package/css/themes/custom/theme-general/theme-general.css +1 -1
- package/dist/components/templates/navbar.template.html +1 -1
- package/dist/css/app.css +1 -1
- package/dist/css/themes/custom/krypton/custom-krypton.css +1 -1
- package/dist/css/themes/custom/krypton/grid-krypton.css +1 -1
- package/dist/css/themes/custom/krypton/navbar-krypton.css +1 -1
- package/dist/css/themes/custom/krypton/panel-krypton.css +1 -1
- package/dist/css/themes/custom/material-round/custom-material-round.css +1 -1
- package/dist/css/themes/custom/material-round/grid-material-round.css +1 -1
- package/dist/css/themes/custom/material-round/navbar-material-round.css +1 -1
- package/dist/css/themes/custom/material-round/panel-material-round.css +1 -1
- package/dist/css/themes/custom/navigator/custom-navigator.css +1 -1
- package/dist/css/themes/custom/theme-general/menu-vertical-retratil.css +1 -1
- package/dist/css/themes/custom/theme-general/theme-general.css +1 -1
- package/dist/i18n/locale_en_us.json +3 -1
- package/dist/i18n/locale_pt_br.json +3 -1
- package/dist/js/app.js +1 -1
- package/dist/js/controllers.js +1 -1
- package/dist/js/directives.js +10 -10
- package/dist/js/upload.service.js +1 -1
- package/i18n/locale_en_us.json +3 -1
- package/i18n/locale_pt_br.json +3 -1
- package/js/app.js +10 -5
- package/js/controllers.js +24 -10
- package/js/directives.js +129 -166
- package/js/upload.service.js +7 -4
- package/package.json +9 -4
- package/postupdate.json +8 -0
|
@@ -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"));
|
|
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"));let a=window.isUsingCookie()?{"Content-Type":void 0}:{"Content-Type":void 0,"X-AUTH-TOKEN":l?l.token:""};this.$promise=c({method:"POST",url:(window.hostApp||"")+g,data:j,headers:a,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/i18n/locale_en_us.json
CHANGED
|
@@ -152,5 +152,7 @@
|
|
|
152
152
|
"clear": "Clear",
|
|
153
153
|
"noDataFound": "No data found",
|
|
154
154
|
"yes": "Yes",
|
|
155
|
-
"no": "No"
|
|
155
|
+
"no": "No",
|
|
156
|
+
"Datasource.Error": "Error",
|
|
157
|
+
"Datasource.Duplicate": "There is more than one data source with the same name, use a unique name for each, check if there is a modal with the data source that has the name: "
|
|
156
158
|
}
|
package/i18n/locale_pt_br.json
CHANGED
|
@@ -152,5 +152,7 @@
|
|
|
152
152
|
"clear": "Limpar",
|
|
153
153
|
"noDataFound": "Nenhum dado encontrado",
|
|
154
154
|
"yes": "Sim",
|
|
155
|
-
"no": "Não"
|
|
155
|
+
"no": "Não",
|
|
156
|
+
"Datasource.Error": "Erro",
|
|
157
|
+
"Datasource.Duplicate": "Existem mais de uma fonte de dados com o mesmo nome, utilize nome único para cada, verifique se existe modal com a fonte de dados que tenha o nome: "
|
|
156
158
|
}
|
package/js/app.js
CHANGED
|
@@ -71,10 +71,11 @@ var app = (function() {
|
|
|
71
71
|
function($q, $rootScope) {
|
|
72
72
|
var service = {
|
|
73
73
|
'request': function(config) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
if (!window.isUsingCookie()) {
|
|
75
|
+
var _u = JSON.parse(localStorage.getItem('_u'));
|
|
76
|
+
if (_u && _u.token) {
|
|
77
|
+
config.headers['X-AUTH-TOKEN'] = _u.token;
|
|
78
|
+
}
|
|
78
79
|
}
|
|
79
80
|
return config;
|
|
80
81
|
}
|
|
@@ -546,7 +547,11 @@ window.camelCaseToSentenceCase = function(str){
|
|
|
546
547
|
const keyCodeFormActions = {
|
|
547
548
|
initialize: () => $(document).on("keypress", "form[crn-datasource]", keyCodeFormActions.handle),
|
|
548
549
|
handle: (e) => !keyCodeFormActions[e.keyCode || e.which] || keyCodeFormActions[e.keyCode || e.which](e),
|
|
549
|
-
13: (e) =>
|
|
550
|
+
13: (e) => {
|
|
551
|
+
if (!e.target || e.target.type !== 'textarea') {
|
|
552
|
+
e.preventDefault();
|
|
553
|
+
}
|
|
554
|
+
}
|
|
550
555
|
};
|
|
551
556
|
keyCodeFormActions.initialize();
|
|
552
557
|
|
package/js/controllers.js
CHANGED
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
url: 'auth/refresh'
|
|
9
9
|
}).then(function (data, status, headers, config) {
|
|
10
10
|
data = getRequestData(data);
|
|
11
|
+
if (window.isUsingCookie()) {
|
|
12
|
+
delete data.token;
|
|
13
|
+
}
|
|
11
14
|
//Keeping the user information, the auth/refresh only has name and username info
|
|
12
15
|
if (localStorage.getItem("_u")) {
|
|
13
16
|
let currentSession = JSON.parse(localStorage.getItem("_u"));
|
|
@@ -44,14 +47,17 @@
|
|
|
44
47
|
return;
|
|
45
48
|
}
|
|
46
49
|
|
|
50
|
+
let headerValues = window.isUsingCookie() ? {
|
|
51
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
52
|
+
} : {
|
|
53
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
54
|
+
'X-AUTH-TOKEN' : $location.search().token
|
|
55
|
+
};
|
|
47
56
|
$http({
|
|
48
57
|
method: 'POST',
|
|
49
58
|
url: 'auth/confirm-reset-password',
|
|
50
59
|
data: $.param({password: passwordNew.value}),
|
|
51
|
-
headers:
|
|
52
|
-
'Content-Type': 'application/x-www-form-urlencoded',
|
|
53
|
-
'X-AUTH-TOKEN': $location.search().token
|
|
54
|
-
}
|
|
60
|
+
headers: headerValues
|
|
55
61
|
}).then(() => {
|
|
56
62
|
Notification.info($translate.instant('ResetPasswordSuccess'));
|
|
57
63
|
passwordNew.value = "";
|
|
@@ -131,6 +137,9 @@
|
|
|
131
137
|
if ($cookies.get('_u')) {
|
|
132
138
|
if (!localStorage.getItem('_u')) {
|
|
133
139
|
var decodedUser = decodeURIComponent($cookies.get('_u'));
|
|
140
|
+
if (window.isUsingCookie()) {
|
|
141
|
+
delete decodedUser.token;
|
|
142
|
+
}
|
|
134
143
|
localStorage.setItem("_u", decodedUser);
|
|
135
144
|
}
|
|
136
145
|
$scope.goHome();
|
|
@@ -166,9 +175,8 @@
|
|
|
166
175
|
'Content-Type' : 'application/x-www-form-urlencoded'
|
|
167
176
|
};
|
|
168
177
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
178
|
+
// Necessario para concluir a autenticação via SSO. Neste momento ainda não existe o cookie
|
|
179
|
+
headerValues["X-AUTH-TOKEN"] = token;
|
|
172
180
|
|
|
173
181
|
$http({
|
|
174
182
|
method : 'POST',
|
|
@@ -209,6 +217,9 @@
|
|
|
209
217
|
// The local storage will be cleaned when the browser window is closed
|
|
210
218
|
if(typeof (Storage) !== "undefined") {
|
|
211
219
|
// save the user data on localStorage
|
|
220
|
+
if (window.isUsingCookie()) {
|
|
221
|
+
delete data.token;
|
|
222
|
+
}
|
|
212
223
|
localStorage.setItem("_u", JSON.stringify(data));
|
|
213
224
|
$rootScope.session = JSON.parse(localStorage._u);
|
|
214
225
|
}
|
|
@@ -352,15 +363,15 @@
|
|
|
352
363
|
$('#themeSytleSheet').attr('href', "node_modules/cronapp-framework-js/css/themes/" + value + ".min.css");
|
|
353
364
|
}
|
|
354
365
|
});
|
|
355
|
-
if(localStorage.getItem('_u') && JSON.parse(localStorage.getItem('_u')).token){
|
|
356
|
-
refreshToken($http,function(){},function(){
|
|
366
|
+
if (localStorage.getItem('_u') && (JSON.parse(localStorage.getItem('_u')).token || window.isUsingCookie())){
|
|
367
|
+
refreshToken($http, function() {},function() {
|
|
357
368
|
localStorage.removeItem('_u');
|
|
358
369
|
if (window.location.hash) {
|
|
359
370
|
$state.go('loginReturnUrl', { "returnUrl" : window.location.hash });
|
|
360
371
|
} else {
|
|
361
372
|
$state.go('login');
|
|
362
373
|
}
|
|
363
|
-
})
|
|
374
|
+
});
|
|
364
375
|
}
|
|
365
376
|
}
|
|
366
377
|
else {
|
|
@@ -517,6 +528,9 @@
|
|
|
517
528
|
function changeSuccess(data, status, headers, config) {
|
|
518
529
|
$rootScope.session.theme = theme;
|
|
519
530
|
$rootScope.session.user.theme = theme;
|
|
531
|
+
if (window.isUsingCookie()) {
|
|
532
|
+
delete $rootScope.session.token;
|
|
533
|
+
}
|
|
520
534
|
localStorage.setItem("_u", JSON.stringify($rootScope.session));
|
|
521
535
|
}
|
|
522
536
|
|
package/js/directives.js
CHANGED
|
@@ -102,11 +102,11 @@
|
|
|
102
102
|
const expressionOnChange = options.expressionOnChange;
|
|
103
103
|
const expressionOnNavigate = options.expressionOnNavigate;
|
|
104
104
|
|
|
105
|
-
const initialDate = expressionInitialDate ? await scope.$eval(generateBlocklyCall(expressionInitialDate)) : new Date();
|
|
106
|
-
const selectDates = (expressionSelectDates && options.isSelectableMultiple) ? await scope.$eval(generateBlocklyCall(expressionSelectDates)) : [];
|
|
107
|
-
const disableDates = expressionDisableDates ? await scope.$eval(generateBlocklyCall(expressionDisableDates)) : null;
|
|
108
|
-
const min = expressionMinDate ? await scope.$eval(generateBlocklyCall(expressionMinDate)) : new Date(1900, 0, 1);
|
|
109
|
-
const max = expressionMaxDate ? await scope.$eval(generateBlocklyCall(expressionMaxDate)) : new Date(2099, 11, 31);
|
|
105
|
+
const initialDate = expressionInitialDate ? await scope.$eval(generateBlocklyCall(expressionInitialDate, true)) : new Date();
|
|
106
|
+
const selectDates = (expressionSelectDates && options.isSelectableMultiple) ? await scope.$eval(generateBlocklyCall(expressionSelectDates, true)) : [];
|
|
107
|
+
const disableDates = expressionDisableDates ? await scope.$eval(generateBlocklyCall(expressionDisableDates, true)) : null;
|
|
108
|
+
const min = expressionMinDate ? await scope.$eval(generateBlocklyCall(expressionMinDate, true)) : new Date(1900, 0, 1);
|
|
109
|
+
const max = expressionMaxDate ? await scope.$eval(generateBlocklyCall(expressionMaxDate), true) : new Date(2099, 11, 31);
|
|
110
110
|
|
|
111
111
|
cronCalendarElement.kendoCalendar({
|
|
112
112
|
culture: culture.startsWith('pt') ? 'pt-BR' : 'en-US',
|
|
@@ -221,7 +221,7 @@
|
|
|
221
221
|
|
|
222
222
|
app.directive('textarea', transformText);
|
|
223
223
|
|
|
224
|
-
var generateBlocklyCall = function(blocklyInfo) {
|
|
224
|
+
var generateBlocklyCall = function(blocklyInfo, hasToPromise) {
|
|
225
225
|
var call = "";
|
|
226
226
|
if (!blocklyInfo) return call;
|
|
227
227
|
|
|
@@ -238,7 +238,7 @@
|
|
|
238
238
|
}
|
|
239
239
|
else if (blocklyInfo.type == "server") {
|
|
240
240
|
var blocklyName = blocklyInfo.blocklyClass + '.' + blocklyInfo.blocklyMethod;
|
|
241
|
-
call = "cronapi.server('"+blocklyName+"')";
|
|
241
|
+
call = "cronapi.server('"+blocklyName+"')" + (hasToPromise ? '.toPromise()' : '');
|
|
242
242
|
|
|
243
243
|
var params = "";
|
|
244
244
|
blocklyInfo.blocklyParams.forEach(function(p) {
|
|
@@ -355,7 +355,7 @@
|
|
|
355
355
|
var required = (attr.ngRequired && attr.ngRequired == "true"?"required":"");
|
|
356
356
|
var content = element.html();
|
|
357
357
|
const objectFit = attr.objectFit || 'unset';
|
|
358
|
-
let templateDyn =`<div ngf-drop="" ngf-drag-over-class="dragover" style="display: flex; justify-content: center; width: 100%; height: 100%; ">
|
|
358
|
+
let templateDyn =`<div ngf-drop="" ngf-drag-over-class="dragover" style="display: flex; justify-content: center; width: 100%; height: 100%; position: relative; ">
|
|
359
359
|
<img alt="$picture$" style="width: 100%; object-fit: ${objectFit}" ng-if="$ngModel$"
|
|
360
360
|
data-ng-src="{{$ngModel$.startsWith(\'http\') || ($ngModel$.startsWith(\'/\') && $ngModel$.length < 1000)? $ngModel$ : \'data:image/png;base64,\' + $ngModel$}}">
|
|
361
361
|
<input id="$id$" aria-label="$userHtml$" ng-if="!$ngModel$" autocomplete="off" tabindex="-1"
|
|
@@ -394,6 +394,12 @@
|
|
|
394
394
|
.split('$picture$').join($translate.instant(imgAltText))
|
|
395
395
|
);
|
|
396
396
|
|
|
397
|
+
var readOnly = attr.readOnly == 'true';
|
|
398
|
+
if (readOnly) {
|
|
399
|
+
templateDyn.find('.remove-image-button').remove();
|
|
400
|
+
templateDyn.find('.start-camera-button-attribute').remove();
|
|
401
|
+
}
|
|
402
|
+
|
|
397
403
|
element.html(templateDyn);
|
|
398
404
|
$compile(templateDyn)(element.scope());
|
|
399
405
|
}
|
|
@@ -650,7 +656,12 @@
|
|
|
650
656
|
$element.hide();
|
|
651
657
|
}
|
|
652
658
|
if (!enabled) {
|
|
653
|
-
$element.find('*')
|
|
659
|
+
$element.find('*')
|
|
660
|
+
.addBack()
|
|
661
|
+
.css('pointer-events', 'none')
|
|
662
|
+
.attr('disabled', true)
|
|
663
|
+
.off('click')
|
|
664
|
+
.on('click', e => e.preventDefault());
|
|
654
665
|
}
|
|
655
666
|
if (!render) {
|
|
656
667
|
$element.remove();
|
|
@@ -1288,7 +1299,7 @@
|
|
|
1288
1299
|
var tinyMCEOptions = {
|
|
1289
1300
|
menubar: false,
|
|
1290
1301
|
statusbar: false,
|
|
1291
|
-
plugins: "bdesk_photo advlist anchor autolink autoresize autosave charmap code colorpicker contextmenu directionality emoticons fullpage fullscreen hr image imagetools importcss insertdatetime legacyoutput link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace tabfocus table template toc visualblocks visualchars wordcount tiny_mce_wiris",
|
|
1302
|
+
plugins: "bdesk_photo advlist anchor autolink autoresize autosave charmap code colorpicker contextmenu directionality emoticons fullpage fullscreen hr image imagetools importcss insertdatetime legacyoutput link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace tabfocus table template toc visualblocks visualchars wordcount tiny_mce_wiris colorpicker textcolor",
|
|
1292
1303
|
toolbar: "",
|
|
1293
1304
|
content_style: ""
|
|
1294
1305
|
};
|
|
@@ -1299,6 +1310,8 @@
|
|
|
1299
1310
|
tinyMCEOptions.toolbar += " " + toolbarGroup[key];
|
|
1300
1311
|
}
|
|
1301
1312
|
}
|
|
1313
|
+
|
|
1314
|
+
tinyMCEOptions.toolbar += " forecolor backcolor ";
|
|
1302
1315
|
tinyMCEOptions.menubar = optionsSelected.showMenuBar;
|
|
1303
1316
|
tinyMCEOptions.statusbar = optionsSelected.showStatusBar;
|
|
1304
1317
|
tinyMCEOptions.content_style = optionsSelected.contentStyle;
|
|
@@ -1550,8 +1563,8 @@
|
|
|
1550
1563
|
return datasource.active;
|
|
1551
1564
|
}
|
|
1552
1565
|
},
|
|
1553
|
-
getSchedulerProperties: function(options, datasource, scope) {
|
|
1554
|
-
let schedulerStartDate = (options.initialDateStrategy === 'Expression' ? scope.$eval(generateBlocklyCall(options.initialDateBlocklyInfo)) : options.initialDate);
|
|
1566
|
+
getSchedulerProperties: async function(options, datasource, scope) {
|
|
1567
|
+
let schedulerStartDate = (options.initialDateStrategy === 'Expression' ? await scope.$eval(generateBlocklyCall(options.initialDateBlocklyInfo, true)) : options.initialDate);
|
|
1555
1568
|
let lastSearchedPeriod = {start: null, end: null};
|
|
1556
1569
|
|
|
1557
1570
|
let needsToFetchData = function(searchablePeriod) {
|
|
@@ -1988,11 +2001,11 @@
|
|
|
1988
2001
|
|
|
1989
2002
|
this.initCulture();
|
|
1990
2003
|
|
|
1991
|
-
$.getScript(baseUrl, function() {
|
|
2004
|
+
$.getScript(baseUrl, async function() {
|
|
1992
2005
|
|
|
1993
2006
|
let kendoDatasource = app.kendoHelper.getDataSource(options.dataSourceScreen.entityDataSource, scope, true, options.dataSourceScreen.rowsPerPage);
|
|
1994
2007
|
|
|
1995
|
-
let schedulerProperties = this.getSchedulerProperties(options, datasource, scope);
|
|
2008
|
+
let schedulerProperties = await this.getSchedulerProperties(options, datasource, scope);
|
|
1996
2009
|
|
|
1997
2010
|
schedulerElement.kendoScheduler(schedulerProperties);
|
|
1998
2011
|
|
|
@@ -3470,6 +3483,10 @@
|
|
|
3470
3483
|
}
|
|
3471
3484
|
|
|
3472
3485
|
$element = $(element);
|
|
3486
|
+
let $grid = $element.find('[data-role="grid"]');
|
|
3487
|
+
if ($grid.length) {
|
|
3488
|
+
$element = $grid;
|
|
3489
|
+
}
|
|
3473
3490
|
let style = $element.attr("style")||"";
|
|
3474
3491
|
if (style) {
|
|
3475
3492
|
style += ", ";
|
|
@@ -3514,8 +3531,8 @@
|
|
|
3514
3531
|
getAllParent(cronappDatasource, itemResult.d.results[0], ids, resolve, reject);
|
|
3515
3532
|
},
|
|
3516
3533
|
beforeSend: (xhr) => {
|
|
3517
|
-
if (window.
|
|
3518
|
-
xhr.setRequestHeader ("X-AUTH-TOKEN",
|
|
3534
|
+
if (!window.isUsingCookie()) {
|
|
3535
|
+
xhr.setRequestHeader ("X-AUTH-TOKEN", cronapi.util.getUserToken());
|
|
3519
3536
|
}
|
|
3520
3537
|
},
|
|
3521
3538
|
error: () => reject(),
|
|
@@ -3656,8 +3673,8 @@
|
|
|
3656
3673
|
resolve();
|
|
3657
3674
|
},
|
|
3658
3675
|
beforeSend: (xhr) => {
|
|
3659
|
-
if (window.
|
|
3660
|
-
xhr.setRequestHeader ("X-AUTH-TOKEN",
|
|
3676
|
+
if (!window.isUsingCookie()) {
|
|
3677
|
+
xhr.setRequestHeader ("X-AUTH-TOKEN", cronapi.util.getUserToken());
|
|
3661
3678
|
}
|
|
3662
3679
|
},
|
|
3663
3680
|
error: () => reject(),
|
|
@@ -4216,7 +4233,13 @@
|
|
|
4216
4233
|
value = null;
|
|
4217
4234
|
}
|
|
4218
4235
|
|
|
4219
|
-
|
|
4236
|
+
let comboValue = combobox.value();
|
|
4237
|
+
comboValue = comboValue !== undefined && comboValue !== null ? comboValue.trim() : comboValue;
|
|
4238
|
+
let valueToCheck = value !== undefined && value !== null ? ('' + value).trim() : value;
|
|
4239
|
+
|
|
4240
|
+
if (valueToCheck !== comboValue) {
|
|
4241
|
+
await combobox.value(value);
|
|
4242
|
+
}
|
|
4220
4243
|
|
|
4221
4244
|
if (select.changeCursor) {
|
|
4222
4245
|
scope.safeApply(() => {
|
|
@@ -4580,11 +4603,21 @@
|
|
|
4580
4603
|
|
|
4581
4604
|
}.bind(relactionDS);
|
|
4582
4605
|
|
|
4606
|
+
var hideSelectedItem = attrs.crnHideSelectedItem == 'true';
|
|
4607
|
+
var onSelectedItem = () => {
|
|
4608
|
+
if (hideSelectedItem) {
|
|
4609
|
+
if (combobox.list && combobox.list.length > 0) {
|
|
4610
|
+
combobox.list.find('.k-item').show();
|
|
4611
|
+
combobox.list.find('.k-item.k-state-selected').hide();
|
|
4612
|
+
}
|
|
4613
|
+
}
|
|
4614
|
+
}
|
|
4615
|
+
|
|
4583
4616
|
options['change'] = attrs.ngChange ? function (){_scope.$eval(attrs.ngChange)}: undefined;
|
|
4584
4617
|
options['close'] = attrs.ngClose ? function (){_scope.$eval(attrs.ngClose)}: undefined;
|
|
4585
4618
|
options['dataBound'] = attrs.ngDatabound ? function (){_scope.$eval(attrs.ngDatabound)}: undefined;
|
|
4586
4619
|
options['filtering'] = attrs.ngFiltering ? function (){_scope.$eval(attrs.ngFiltering)}: undefined;
|
|
4587
|
-
options['open'] = attrs.ngOpen ? function (){_scope.$eval(attrs.ngOpen)}:
|
|
4620
|
+
options['open'] = attrs.ngOpen ? function (){_scope.$eval(attrs.ngOpen); onSelectedItem();}: onSelectedItem;
|
|
4588
4621
|
options['cascade'] = attrs.ngCascade ? function (){_scope.$eval(attrs.ngCascade)}: undefined;
|
|
4589
4622
|
evtSelect = attrs.ngSelect ? function (){_scope.$eval(attrs.ngSelect)}: undefined;
|
|
4590
4623
|
deselect = attrs.ngDeselect ? function (){_scope.$eval(attrs.ngDeselect)}: undefined;
|
|
@@ -5108,7 +5141,7 @@
|
|
|
5108
5141
|
items.forEach(function (item) {
|
|
5109
5142
|
|
|
5110
5143
|
var security = (item.security && item.security != null) ? ` cronapp-security="${item.security }" ` : '';
|
|
5111
|
-
var action = (item.action && item.action != null) ? ` ng-click="${item.action}" ` : '';
|
|
5144
|
+
var action = (item.action && item.action != null) ? ` ng-click="cronapi.internal.lastCronappMenuClick('${item.id}');${item.action}" ` : '';
|
|
5112
5145
|
var hide = (item.hide && item.hide != null) ? ` ng-hide="${item.hide}" ` : '';
|
|
5113
5146
|
var iconClass = (item.iconClass && item.iconClass != null) ? `<i class="${item.iconClass}" id="menu-tag-i-${item.id}"></i> ` : '';
|
|
5114
5147
|
var title = `<span id="menu-tag-span-${item.id}"></span>`;
|
|
@@ -5235,168 +5268,98 @@
|
|
|
5235
5268
|
};
|
|
5236
5269
|
}])
|
|
5237
5270
|
|
|
5238
|
-
.directive('cronBreadcrumbs', function () {
|
|
5271
|
+
.directive('cronBreadcrumbs', function ($rootScope) {
|
|
5239
5272
|
'use strict';
|
|
5240
5273
|
return {
|
|
5241
5274
|
restrict: 'E',
|
|
5242
5275
|
replace: true,
|
|
5243
5276
|
link: function (scope, element, attrs) {
|
|
5244
5277
|
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5278
|
+
var bcAction = attrs.ngInit ? attrs.ngInit : null;
|
|
5279
|
+
const bcDelimiterIcon = attrs.crnDelimiterIcon;
|
|
5280
|
+
const bcTypeMenu = attrs.typeMenu;
|
|
5281
|
+
const bcMenuId = attrs.idMenu ? attrs.idMenu : null;
|
|
5282
|
+
const bcId = attrs.id;
|
|
5283
|
+
const bcIconRoot = attrs.breadcrumbIcon ? attrs.breadcrumbIcon : null;
|
|
5284
|
+
const bcList = [];
|
|
5252
5285
|
|
|
5253
|
-
|
|
5286
|
+
const fillAction = async () => {
|
|
5287
|
+
const shortVersion = bcAction.replace("cronapi.client('js.", 'blockly.js.');
|
|
5288
|
+
bcAction = shortVersion.replace("').run()", '');
|
|
5289
|
+
bcAction = scope.$eval(bcAction);
|
|
5290
|
+
bcList = await bcAction();
|
|
5254
5291
|
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
var onclick = async (e) => {
|
|
5262
|
-
if (e.item.action) {
|
|
5263
|
-
e.item.action();
|
|
5264
|
-
}
|
|
5265
|
-
};
|
|
5292
|
+
const onclick = async (e) => {
|
|
5293
|
+
if (e.item.action) {
|
|
5294
|
+
e.item.action();
|
|
5295
|
+
}
|
|
5296
|
+
};
|
|
5266
5297
|
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5298
|
+
$(`#${bcId}`).kendoBreadcrumb({
|
|
5299
|
+
items: bcList,
|
|
5300
|
+
delimiterIcon: bcDelimiterIcon,
|
|
5301
|
+
navigational: true,
|
|
5302
|
+
click : onclick
|
|
5303
|
+
});
|
|
5273
5304
|
}
|
|
5274
5305
|
|
|
5306
|
+
const clearAction = (action) => {
|
|
5307
|
+
if (action) {
|
|
5308
|
+
return action.replace("cronapi.screen.changeView('", '').replace("', [])", '');
|
|
5309
|
+
}
|
|
5310
|
+
return "#/home";
|
|
5311
|
+
}
|
|
5275
5312
|
|
|
5276
|
-
if (
|
|
5277
|
-
|
|
5278
|
-
|
|
5313
|
+
if (bcAction && bcTypeMenu === "idBloco") {
|
|
5314
|
+
fillAction();
|
|
5279
5315
|
} else {
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
if (action && action != "") {
|
|
5303
|
-
action = action.replace("cronapi.screen.changeView('", '');
|
|
5304
|
-
action = action.replace("', [])", '')
|
|
5305
|
-
action = action.split("/");
|
|
5306
|
-
} else {
|
|
5307
|
-
action = null
|
|
5308
|
-
}
|
|
5309
|
-
|
|
5310
|
-
if (items[i].level === 1) {
|
|
5311
|
-
arrayPaiBreadcrumb = [];
|
|
5312
|
-
}
|
|
5313
|
-
|
|
5314
|
-
if (arrayPaiBreadcrumb.length != 0 && items[i].level === arrayPaiBreadcrumb[arrayPaiBreadcrumb.length - 1].level) {
|
|
5315
|
-
if (!action) {
|
|
5316
|
-
arrayPaiBreadcrumb[arrayPaiBreadcrumb.length - 1] = {
|
|
5317
|
-
level: items[i].level,
|
|
5318
|
-
title: items[i].title,
|
|
5319
|
-
href: '#'
|
|
5320
|
-
};
|
|
5321
|
-
|
|
5322
|
-
} else if (action) {
|
|
5323
|
-
arrayPaiBreadcrumb[arrayPaiBreadcrumb.length - 1] = {
|
|
5324
|
-
level: items[i].level,
|
|
5325
|
-
title: items[i].title,
|
|
5326
|
-
href: document.location.origin + '/' + action.join("/")
|
|
5327
|
-
};
|
|
5328
|
-
|
|
5329
|
-
}
|
|
5330
|
-
|
|
5331
|
-
} else {
|
|
5332
|
-
if (!action) {
|
|
5333
|
-
arrayPaiBreadcrumb.push({
|
|
5334
|
-
level: items[i].level,
|
|
5335
|
-
title: items[i].title,
|
|
5336
|
-
href: '#'
|
|
5337
|
-
});
|
|
5338
|
-
} else if (action) {
|
|
5339
|
-
arrayPaiBreadcrumb.push({
|
|
5340
|
-
level: items[i].level,
|
|
5341
|
-
title: items[i].title,
|
|
5342
|
-
href: document.location.origin + '/' + action.join("/")
|
|
5343
|
-
});
|
|
5344
|
-
}
|
|
5345
|
-
}
|
|
5346
|
-
|
|
5347
|
-
if (items[i].menuItems.length > 0) {
|
|
5348
|
-
inicio(items[i].menuItems);
|
|
5349
|
-
|
|
5350
|
-
} else {
|
|
5351
|
-
if (action) {
|
|
5352
|
-
if (action[action.length - 1] === page[page.length - 1] || action[action.length - 1] === page) {
|
|
5353
|
-
x = true;
|
|
5316
|
+
var observer = new MutationObserver((mutation, observer) => {
|
|
5317
|
+
const $parent = $(`#${bcMenuId}`).parent();
|
|
5318
|
+
const attrOptions = $parent.attr('options');
|
|
5319
|
+
if (attrOptions) {
|
|
5320
|
+
observer.disconnect(); // stop observing
|
|
5321
|
+
|
|
5322
|
+
const options = JSON.parse(attrOptions);
|
|
5323
|
+
const page = document.location.hash || 'home';
|
|
5324
|
+
|
|
5325
|
+
const findTrace = (array, action, path = []) => {
|
|
5326
|
+
for (let i = 0; i < array.length; i++) {
|
|
5327
|
+
var item = array[i];
|
|
5328
|
+
item.action = clearAction(item.action);
|
|
5329
|
+
if (item.action === action) {
|
|
5330
|
+
return [...path, item];
|
|
5331
|
+
}
|
|
5332
|
+
if (item.menuItems) {
|
|
5333
|
+
const result = findTrace(item.menuItems, action, [...path, item]);
|
|
5334
|
+
if (result) {
|
|
5335
|
+
return result;
|
|
5336
|
+
}
|
|
5337
|
+
}
|
|
5354
5338
|
}
|
|
5339
|
+
return null;
|
|
5355
5340
|
}
|
|
5356
|
-
}
|
|
5357
5341
|
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
showIcon: false
|
|
5376
|
-
})
|
|
5377
|
-
} else {
|
|
5378
|
-
breadcrumb.push({
|
|
5379
|
-
type: "item",
|
|
5380
|
-
href: arrayPaiBreadcrumb[y].href,
|
|
5381
|
-
text: arrayPaiBreadcrumb[y].title,
|
|
5382
|
-
showText: true,
|
|
5383
|
-
showIcon: false
|
|
5384
|
-
})
|
|
5385
|
-
}
|
|
5342
|
+
const trace = findTrace(options.subMenuOptions, page);
|
|
5343
|
+
if (trace) {
|
|
5344
|
+
for (var index in trace) {
|
|
5345
|
+
const item = trace[index];
|
|
5346
|
+
bcList.push({
|
|
5347
|
+
type: index == 0 ? 'rootitem' : 'item',
|
|
5348
|
+
href: item.action,
|
|
5349
|
+
text: item.title,
|
|
5350
|
+
showText: true,
|
|
5351
|
+
showIcon: false
|
|
5352
|
+
});
|
|
5353
|
+
}
|
|
5354
|
+
$(`#${bcId}`).kendoBreadcrumb({
|
|
5355
|
+
items: bcList,
|
|
5356
|
+
delimiterIcon: bcDelimiterIcon,
|
|
5357
|
+
navigational: true
|
|
5358
|
+
});
|
|
5386
5359
|
}
|
|
5387
|
-
|
|
5388
|
-
return breadcrumb
|
|
5389
|
-
}
|
|
5390
5360
|
}
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
$(`#${idBreadcrumb}`).kendoBreadcrumb({
|
|
5394
|
-
items: breadcrumb,
|
|
5395
|
-
delimiterIcon: crnDelimiterIcon,
|
|
5396
|
-
navigational: true
|
|
5397
|
-
});
|
|
5398
|
-
|
|
5399
|
-
}, 800);
|
|
5361
|
+
});
|
|
5362
|
+
observer.observe(document.body, { childList : true});
|
|
5400
5363
|
}
|
|
5401
5364
|
}
|
|
5402
5365
|
}
|
|
@@ -5420,7 +5383,7 @@
|
|
|
5420
5383
|
let blocklyParams = shortVersion.split('.run')[1];
|
|
5421
5384
|
evaluated = await scope.$eval(blocklyPackage + blocklyParams);
|
|
5422
5385
|
} else {
|
|
5423
|
-
evaluated = scope.$eval(attrs.ngInitialValue);
|
|
5386
|
+
evaluated = scope.$eval(attrs.ngInitialValue) || attrs.ngInitialValue;
|
|
5424
5387
|
}
|
|
5425
5388
|
} catch (e) {
|
|
5426
5389
|
evaluated = attrs.ngInitialValue;
|
package/js/upload.service.js
CHANGED
|
@@ -80,14 +80,17 @@
|
|
|
80
80
|
console.log(files[i].$valid);
|
|
81
81
|
}
|
|
82
82
|
var _u = JSON.parse(localStorage.getItem('_u'));
|
|
83
|
+
let headerValues = window.isUsingCookie() ? {
|
|
84
|
+
'Content-Type' : undefined
|
|
85
|
+
} : {
|
|
86
|
+
'Content-Type' : undefined,
|
|
87
|
+
'X-AUTH-TOKEN' : (_u ?_u.token : '')
|
|
88
|
+
};
|
|
83
89
|
this.$promise = $http({
|
|
84
90
|
method: 'POST',
|
|
85
91
|
url: (window.hostApp || "") + uploadUrl,
|
|
86
92
|
data: formData,
|
|
87
|
-
headers:
|
|
88
|
-
'Content-Type': undefined,
|
|
89
|
-
'X-AUTH-TOKEN': (_u ?_u.token : '')
|
|
90
|
-
},
|
|
93
|
+
headers: headerValues,
|
|
91
94
|
onProgress: function(event) {
|
|
92
95
|
this.safeApply(function() {
|
|
93
96
|
if (event.lengthComputable) {
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cronapp-framework-js",
|
|
3
|
-
"version": "2.9.6-SP.
|
|
3
|
+
"version": "2.9.6-SP.40",
|
|
4
4
|
"description": "Javascript library for CronApp's projects",
|
|
5
5
|
"main": "cronapp.framework.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "npm i && gulp",
|
|
8
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
+
"preinstall": "npx force-resolutions"
|
|
9
10
|
},
|
|
10
11
|
"repository": {
|
|
11
12
|
"type": "git",
|
|
@@ -63,14 +64,18 @@
|
|
|
63
64
|
"angular-ui-notification": "0.3.6",
|
|
64
65
|
"ui-select": "0.18.1",
|
|
65
66
|
"bootstrap": "3.4.1",
|
|
66
|
-
"chart.js": "2.
|
|
67
|
+
"chart.js": "2.9.4",
|
|
67
68
|
"cpf_cnpj": "0.2.0",
|
|
68
69
|
"font-awesome": "4.4.0",
|
|
69
70
|
"jquery": "3.5.1",
|
|
70
71
|
"justgage": "1.3.5",
|
|
71
|
-
"moment": "2.29.
|
|
72
|
+
"moment": "2.29.4",
|
|
72
73
|
"moment-timezone": "0.5.33",
|
|
73
74
|
"ng-file-upload": "12.2.13",
|
|
74
75
|
"signature_pad": "^3.0.0-beta.4"
|
|
76
|
+
},
|
|
77
|
+
"resolutions": {
|
|
78
|
+
"chart.js": "2.9.4",
|
|
79
|
+
"moment": "2.29.4"
|
|
75
80
|
}
|
|
76
81
|
}
|