@@ -31,10 +31,10 @@ import {UserComparatorService} from '../../user/services/user-comparator.service
31
31
import { TaskSetDataRequestContext } from '../models/task-set-data-request-context' ;
32
32
import { EventOutcomeMessageResource } from '../../resources/interface/message-resource' ;
33
33
import { EventService } from '../../event/services/event.service' ;
34
- import { EventOutcome } from '../../resources/interface/event-outcome' ;
35
34
import { ChangedFieldsService } from '../../changed-fields/services/changed-fields.service' ;
36
35
import { ChangedFieldsMap } from '../../event/services/interfaces/changed-fields-map' ;
37
36
import { TaskFields } from '../../task-content/model/task-fields' ;
37
+ import { EnumerationField } from "../../data-fields/enumeration-field/models/enumeration-field" ;
38
38
39
39
/**
40
40
* Handles the loading and updating of data fields and behaviour of
@@ -149,7 +149,7 @@ export class TaskDataService extends TaskHandlingService implements OnDestroy {
149
149
150
150
/**
151
151
* Processes a successful outcome of a `getData` request
152
- * @param gottenTaskId the Id of the task whose data was requested
152
+ * @param gottenTaskId the ID of the task whose data was requested
153
153
* @param dataGroups the returned data groups of the task
154
154
* @param afterAction the action that should be performed after the request is processed
155
155
* @param nextEvent indicates to the event queue that the next event can be processed
@@ -233,7 +233,7 @@ export class TaskDataService extends TaskHandlingService implements OnDestroy {
233
233
234
234
/**
235
235
* Processes an erroneous outcome of a `getData` request
236
- * @param gottenTaskId the Id of the task whose data was requested
236
+ * @param gottenTaskId the ID of the task whose data was requested
237
237
* @param error the returned error
238
238
* @param afterAction the action that should be performed after the request is processed
239
239
* @param nextEvent indicates to the event queue that the next event can be processed
@@ -348,12 +348,16 @@ export class TaskDataService extends TaskHandlingService implements OnDestroy {
348
348
field . changed = false ;
349
349
}
350
350
351
+ protected isAutocompleteEnumException ( field : DataField < unknown > ) : boolean {
352
+ return ( field instanceof EnumerationField ) && ( field . getComponentType ( ) === 'autocomplete' ) && ! field . valid ;
353
+ }
354
+
351
355
/**
352
356
* @param field the checked field
353
357
* @returns whether the field was updated on frontend and thus the backend should be notified
354
358
*/
355
359
protected wasFieldUpdated ( field : DataField < unknown > ) : boolean {
356
- return field . initialized && field . changed && ( field . valid || field . sendInvalidValues ) ;
360
+ return field . initialized && field . changed && ( field . valid || field . sendInvalidValues ) && ( ! this . isAutocompleteEnumException ( field ) ) ;
357
361
}
358
362
359
363
/**
@@ -397,7 +401,7 @@ export class TaskDataService extends TaskHandlingService implements OnDestroy {
397
401
398
402
/**
399
403
* Performs a `setData` request on the task currently stored in the `taskContent` service
400
- * @param setTaskId id of the task
404
+ * @param setTaskId ID of the task
401
405
* @param body content of the `setData` request
402
406
* @param afterAction the action that should be performed after the request is processed
403
407
* @param nextEvent indicates to the event queue that the next event can be processed
@@ -434,18 +438,18 @@ export class TaskDataService extends TaskHandlingService implements OnDestroy {
434
438
}
435
439
436
440
/**
437
- * Processes a unsuccessful outcome of a `setData` request
438
- * @param setTaskId the Id of the task whose data was set
441
+ * Processes an unsuccessful outcome of a `setData` request
442
+ * @param setTaskId the ID of the task whose data was set
439
443
* @param response the resulting Event outcome of the set data request
440
444
* @param afterAction the action that should be performed after the request is processed
441
445
* @param nextEvent indicates to the event queue that the next event can be processed
442
446
* @param body hold the data that was sent in request
443
447
*/
444
448
protected processUnsuccessfulSetDataRequest ( setTaskId : string ,
445
- response : EventOutcomeMessageResource ,
446
- afterAction : AfterAction ,
447
- nextEvent : AfterAction ,
448
- body : TaskSetDataRequestBody ) {
449
+ response : EventOutcomeMessageResource ,
450
+ afterAction : AfterAction ,
451
+ nextEvent : AfterAction ,
452
+ body : TaskSetDataRequestBody ) {
449
453
if ( response . error !== '' ) {
450
454
this . _snackBar . openErrorSnackBar ( this . _translate . instant ( response . error ) ) ;
451
455
} else {
@@ -468,7 +472,7 @@ export class TaskDataService extends TaskHandlingService implements OnDestroy {
468
472
469
473
/**
470
474
* Processes a successful outcome of a `setData` request
471
- * @param setTaskId the Id of the task whose data was set
475
+ * @param setTaskId the ID of the task whose data was set
472
476
* @param response the resulting Event outcome of the set data request
473
477
* @param afterAction the action that should be performed after the request is processed
474
478
* @param nextEvent indicates to the event queue that the next event can be processed
@@ -493,7 +497,7 @@ export class TaskDataService extends TaskHandlingService implements OnDestroy {
493
497
494
498
/**
495
499
* Processes an erroneous outcome of a `setData` request
496
- * @param setTaskId the Id of the task whose data was set
500
+ * @param setTaskId the ID of the task whose data was set
497
501
* @param error the returned error
498
502
* @param afterAction the action that should be performed after the request is processed
499
503
* @param nextEvent indicates to the event queue that the next event can be processed
@@ -586,7 +590,7 @@ export class TaskDataService extends TaskHandlingService implements OnDestroy {
586
590
*
587
591
* @param afterAction the call chain steam of the update data method
588
592
* @param result result of the update data request
589
- * @param setTaskId the Id of the {@link Task}, who's state should be updated
593
+ * @param setTaskId the ID of the {@link Task}, who's state should be updated
590
594
*/
591
595
protected updateStateInfo ( afterAction : AfterAction , result : boolean , setTaskId : string ) : void {
592
596
this . _taskState . stopLoading ( setTaskId ) ;
0 commit comments