@@ -3,7 +3,7 @@ import MapViewDataBuilder from '@/support/map-data-services/map-view-data-builde
3
3
import FieldsContainer from '@/fragments/forms/fields-container/FieldsContainer'
4
4
import FormActions from '@/fragments/forms/map-form/components/form-actions/FormActions'
5
5
import { EventBus } from '@/common/event-bus'
6
- import { Optimization } from '@/support/ors-api-runner'
6
+ import { Optimization } from '@/support/ors-api-runner'
7
7
import AppMode from '@/support/app-modes/app-mode'
8
8
import MapViewData from '@/models/map-view-data'
9
9
import constants from '@/resources/constants'
@@ -392,6 +392,21 @@ export default {
392
392
}
393
393
return jobProps
394
394
} ,
395
+ parsePropSkills ( propsOfJob ) {
396
+ let propSkills = [ ]
397
+ for ( const s of propsOfJob . skills ) {
398
+ let skillIds = [ ]
399
+ for ( const skill of this . skills ) {
400
+ skillIds . push ( skill . id )
401
+ }
402
+ if ( skillIds . includes ( s ) ) {
403
+ propSkills . push ( this . skills [ s - 1 ] )
404
+ } else {
405
+ propSkills . push ( new Skill ( 'Skill from added ' + this . $t ( 'optimization.job' ) + ' ' + propsOfJob . id , s ) )
406
+ }
407
+ }
408
+ return propSkills
409
+ } ,
395
410
parseProps ( jobProps ) {
396
411
let parsedProps = [ ]
397
412
for ( const j of jobProps ) {
@@ -402,19 +417,7 @@ export default {
402
417
}
403
418
}
404
419
if ( j . skills ) {
405
- let propSkills = [ ]
406
- for ( const s of j . skills ) {
407
- let skillIds = [ ]
408
- for ( const skill of this . skills ) {
409
- skillIds . push ( skill . id )
410
- }
411
- if ( skillIds . includes ( s ) ) {
412
- propSkills . push ( this . skills [ s - 1 ] )
413
- } else {
414
- propSkills . push ( new Skill ( 'Skill from added ' + this . $t ( 'optimization.job' ) + ' ' + j . id , s ) )
415
- }
416
- }
417
- parsedJobProps . skills = propSkills
420
+ parsedJobProps . skills = this . parsePropSkills ( j )
418
421
}
419
422
420
423
parsedProps . push ( parsedJobProps )
0 commit comments