File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/fragments/forms/map-form/components/optimization/components/edit-dialog Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,9 @@ export default {
2020 isEditOpen : true ,
2121 editId : 0 ,
2222 editData : [ ] ,
23+ dataCopy : '' ,
2324 editSkills : [ ] ,
25+ skillsCopy : '' ,
2426 jobsBox : false ,
2527 vehiclesBox : false ,
2628 pickPlaceSupported : true ,
@@ -155,6 +157,9 @@ export default {
155157 if ( this . index > 0 ) {
156158 this . editId = this . index
157159 }
160+ //create a string of data as copy
161+ this . dataCopy = JSON . stringify ( this . editData )
162+ this . skillsCopy = JSON . stringify ( this . editSkills )
158163
159164 // close editJobs box to pick a place from the map
160165 EventBus . $on ( 'pickAPlace' , ( ) => {
@@ -235,10 +240,15 @@ export default {
235240 if ( this . content . item === 'Vehicle' ) {
236241 this . validateTimeWindow ( )
237242 }
243+ /* if(JSON.stringify(this.editSkills) !== this.skillsCopy){
244+ TODO: update skills
245+ }*/
238246 if ( this . hasEmptyLocation ) {
239247 this . showError ( this . content . emptyLoc , { timeout : 3000 } )
240248 } else {
241- this . $emit ( this . content . changedEvent , this . editData )
249+ if ( JSON . stringify ( this . editData ) !== this . dataCopy ) {
250+ this . $emit ( this . content . changedEvent , this . editData )
251+ }
242252 this . closeEditModal ( )
243253 }
244254 } ,
You can’t perform that action at this time.
0 commit comments