@@ -4,6 +4,7 @@ $.widget.bridge('uitooltip', $.ui.tooltip);
4
4
5
5
// Global Vars
6
6
var yesnoEvent ;
7
+ var isProgress ;
7
8
var notyDefaultOptions = {
8
9
text : '' ,
9
10
layout : 'bottomRight' ,
@@ -20,13 +21,17 @@ var notyDefaultOptions = {
20
21
]
21
22
} ;
22
23
24
+
23
25
/**
24
26
* Global javascript must be here.
25
27
*/
26
28
$ ( document ) . ready ( function ( ) {
27
29
28
- showNotificationMessages ( ) ;
30
+
29
31
showHelpText ( ) ;
32
+ validatePhase ( ) . then ( function ( isProgress ) {
33
+ showNotificationMessages ( ) ;
34
+ } ) . catch ( function ( error ) { } ) ;
30
35
31
36
// Set elementsListComponent
32
37
setElementsListComponent ( ) ;
@@ -176,6 +181,22 @@ $(document).ready(function () {
176
181
$buttons . find ( '.buttons-content' ) . removeClass ( 'positionFixedBot animated flipInX' ) ;
177
182
}
178
183
}
184
+
185
+ function validatePhase ( ) {
186
+ return new Promise ( function ( resolve , reject ) {
187
+ // Ajax
188
+ $ . ajax ( {
189
+ url : baseURL + '/isProgressActive.do' ,
190
+ success : function ( data ) {
191
+ isProgress = data . status . isProgress ;
192
+ resolve ( ) ;
193
+ } ,
194
+ error : function ( xhr , status , error ) {
195
+ reject ( error ) ;
196
+ }
197
+ } ) ;
198
+ } ) ;
199
+ }
179
200
180
201
// Animate help text
181
202
function showHelpText ( ) {
@@ -200,8 +221,11 @@ $(document).ready(function () {
200
221
} else if ( messageSelector . length >= 1 && messageSelector . html ( ) . split ( ":" ) [ 0 ] != "message" && messageSelector . html ( ) . split ( ":" ) [ 1 ] === " deliverable.status.remaining" ) {
201
222
// SHOW CLUSTER SUBMITTED BASED ON THE DISABLED INPUT
202
223
var $clusterSubmitted = $ ( `.clusterSubmitted` ) ;
224
+ var $clusterSubmittedFilter = $clusterSubmitted . filter ( ( index , ele ) => $ ( ele ) . attr ( "issubmit" ) === "true" ) . get ( ) ;
203
225
var message = "" ;
204
- if ( $clusterSubmitted . length > 0 ) {
226
+ console . log ( "ClusterSubmitted Lenght" , $clusterSubmitted . length ) ;
227
+ console . log ( "ClusterSubmitted" , $clusterSubmitted ) ;
228
+ if ( $clusterSubmittedFilter . length > 0 ) {
205
229
// $clusterSubmitted exists, do something
206
230
const $mapClusterSubmit = $clusterSubmitted . filter ( ( index , ele ) => $ ( ele ) . attr ( "issubmit" ) === "true" ) . get ( ) ;
207
231
const $stringClusterSubmit = $mapClusterSubmit . reduce ( ( prev , curr ) => prev + $ ( curr ) . attr ( "name" ) + "," , "" ) ;
@@ -223,9 +247,17 @@ $(document).ready(function () {
223
247
} else if ( messageSelector . length >= 1 && messageSelector . html ( ) . split ( ":" ) [ 0 ] != "message" ) {
224
248
// WARNING MESSAGE
225
249
var message = ""
226
- message += "The Information was correctly saved. <br> " ;
227
- message += "Please keep in mind that the fields highlighted below are missing or incorrect." ;
228
250
var messageType = "warning" ;
251
+ if ( isProgress == 'true' ) {
252
+ message += "The Information was correctly saved. <br> " ;
253
+ message += "Some of the fields could be missing or incorrect. <br>" ;
254
+ message += "Don't worry! Some information is not necessary at this phase, but it will be required in the next phase." ;
255
+ messageType = "info" ;
256
+ } else {
257
+ message += "The Information was correctly saved. <br> " ;
258
+ message += "Please keep in mind that the fields highlighted below are missing or incorrect." ;
259
+ }
260
+
229
261
notifyErrorMessage ( messageType , message ) ;
230
262
}
231
263
} else if ( $ ( messageSelector ) . hasClass ( "error" ) ) {
@@ -262,6 +294,14 @@ $(document).ready(function () {
262
294
$ ( containerIcon ) . addClass ( "alertColorWarning" ) ;
263
295
$ ( messages ) . removeClass ( "displayNone" ) ;
264
296
break ;
297
+ case "info" :
298
+ $ ( element ) . find ( '.alertText' ) . html ( message ) ;
299
+ $ ( iconAlert ) . attr ( "src" , baseURL + '/global/images/icon-info.png' ) ;
300
+ $ ( containerAlert ) . addClass ( "alertColorBackgroundInfo" ) ;
301
+ $ ( containerLine ) . addClass ( "alertColorInfo" ) ;
302
+ $ ( containerIcon ) . addClass ( "alertColorInfo" ) ;
303
+ $ ( messages ) . removeClass ( "displayNone" ) ;
304
+ break ;
265
305
case "error" :
266
306
//Declaraciones ejecutadas cuando el resultado de expresión coincide con valorN
267
307
break ;
0 commit comments