@@ -3,7 +3,7 @@ import MapViewDataBuilder from '@/support/map-data-services/map-view-data-builde
33import FieldsContainer from '@/fragments/forms/fields-container/FieldsContainer'
44import FormActions from '@/fragments/forms/map-form/components/form-actions/FormActions'
55import { EventBus } from '@/common/event-bus'
6- import { Optimization } from '@/support/ors-api-runner'
6+ import { Optimization } from '@/support/ors-api-runner'
77import AppMode from '@/support/app-modes/app-mode'
88import MapViewData from '@/models/map-view-data'
99import constants from '@/resources/constants'
@@ -392,6 +392,21 @@ export default {
392392 }
393393 return jobProps
394394 } ,
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+ } ,
395410 parseProps ( jobProps ) {
396411 let parsedProps = [ ]
397412 for ( const j of jobProps ) {
@@ -402,19 +417,7 @@ export default {
402417 }
403418 }
404419 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 )
418421 }
419422
420423 parsedProps . push ( parsedJobProps )
0 commit comments