57
57
<!-- Download AAS -->
58
58
<v-btn v-if =" aasRepoURL" @click.stop =" downloadAAS(item)" icon =" mdi-download" size =" x-small" variant =" plain" style =" z-index : 9000 ; margin-left : -6px " ></v-btn >
59
59
<!-- Remove from AAS Registry Button -->
60
- <v-btn @click.stop =" showDeleteDialog = true; aasToDelete = item" icon =" mdi-close" size =" x-small" variant =" plain" style =" z-index : 9000 ; margin-left : -6px " ></v-btn >
60
+ <v-btn @click.stop =" showDeleteDialog( item) " icon =" mdi-close" size =" x-small" variant =" plain" style =" z-index : 9000 ; margin-left : -6px " ></v-btn >
61
61
</template >
62
62
<v-overlay :model-value =" isSelected(item)" scrim =" primary" style =" opacity : 0.2 " contained persistent ></v-overlay >
63
63
</v-list-item >
79
79
</v-list >
80
80
</v-card >
81
81
</v-container >
82
- <v-dialog v-model =" showDeleteDialog " max-width =" 500px" >
82
+ <v-dialog v-model =" deleteDialogShowing " max-width =" 500px" >
83
83
<v-card >
84
- <v-card-title class = " headline " >Confirm Delete</v-card-title >
84
+ <v-card-title >Confirm Delete</v-card-title >
85
85
<v-divider ></v-divider >
86
86
<v-card-text class =" pb-0" >
87
- Are you sure you want to delete the AAS?
87
+ < span > Are you sure you want to delete the AAS?</ span >
88
88
<v-checkbox v-model =" deleteSubmodels" label =" Also delete Submodels" hide-details ></v-checkbox >
89
- <v-alert class =" mb-2" variant =" tonal" border v-if =" deleteSubmodels" color =" warning" >
90
- Warning: If other shells refer to the same submodels, those references are not deleted!
91
- </v-alert >
89
+ <v-alert class =" mb-2" variant =" tonal" border v-if =" deleteSubmodels" color =" warning" >Warning: If other shells refer to the same submodels, those references are not deleted!</v-alert >
92
90
</v-card-text >
93
91
<v-card-actions >
94
92
<v-spacer ></v-spacer >
95
- <v-btn @click =" showDeleteDialog = false" >Cancel</v-btn >
93
+ <v-btn @click =" deleteDialogShowing = false" >Cancel</v-btn >
96
94
<v-btn variant =" tonal" color =" error" @click =" confirmDelete" :loading =" deleteLoading" >Delete</v-btn >
97
95
</v-card-actions >
98
96
</v-card >
@@ -138,7 +136,7 @@ export default defineComponent({
138
136
detailsObject: {} as any , // Variable to store the AAS Data of the currently selected AAS
139
137
showDetailsCard: false , // Variable to store if the Details Card should be shown
140
138
listLoading: false , // Variable to store if the AAS List is loading
141
- showDeleteDialog : false , // Variable to store if the Delete Dialog should be shown
139
+ deleteDialogShowing : false , // Variable to store if the Delete Dialog should be shown
142
140
deleteSubmodels: false , // Variable to store if the Submodels should be deleted
143
141
aasToDelete: {} as any , // Variable to store the AAS to be deleted
144
142
deleteLoading: false , // Variable to store if the AAS is being deleted
@@ -461,7 +459,7 @@ export default defineComponent({
461
459
this .navigationStore .dispatchSnackbar ({ status: true , timeout: 4000 , color: ' error' , btnColor: ' buttonText' , text: ' Please wait for the current Request to finish.' });
462
460
return ;
463
461
}
464
- console .log (' Remove AAS: ' , AAS );
462
+ // console.log('Remove AAS: ', AAS);
465
463
let path = AAS .endpoints [0 ].protocolInformation .href ;
466
464
let context = ' removing AAS' ;
467
465
let disableMessage = false ;
@@ -479,7 +477,6 @@ export default defineComponent({
479
477
const response = await this .getRequest (path , context , disableMessage );
480
478
if (response .success ) {
481
479
const submodelRefs = response .data .result ;
482
- const aasIds = this .URLEncode (this .aasToDelete .id );
483
480
// Extract all references in an array called submodelIds from each keys[0].value
484
481
const submodelIds = submodelRefs .map ((ref : any ) => ref .keys [0 ].value );
485
482
this .removeAAS (this .aasToDelete );
@@ -490,21 +487,21 @@ export default defineComponent({
490
487
if (submodelResponse .success ) {
491
488
const deletePath = submodelResponse .data .endpoints [0 ].protocolInformation .href ;
492
489
await this .deleteRequest (deletePath , ' removing Submodel' , disableMessage );
493
- }else {
490
+ } else {
494
491
error = true ;
495
492
}
496
493
}
497
- }else {
494
+ } else {
498
495
error = true ;
499
496
}
500
497
} else {
501
498
this .removeAAS (this .aasToDelete );
502
499
}
503
500
} finally {
504
- this .showDeleteDialog = false ;
501
+ this .deleteDialogShowing = false ;
505
502
this .aasToDelete = {};
506
503
this .deleteSubmodels = false ;
507
- if (! error ){
504
+ if (! error ) {
508
505
// remove query from URL
509
506
this .$router .push ({ path: this .$route .path , query: {} });
510
507
this .aasStore .dispatchSelectedAAS ({});
@@ -515,6 +512,11 @@ export default defineComponent({
515
512
this .deleteLoading = false ;
516
513
}
517
514
},
515
+
516
+ showDeleteDialog(AAS : any ){
517
+ this .deleteDialogShowing = true ;
518
+ this .aasToDelete = AAS
519
+ }
518
520
},
519
521
});
520
522
</script >
0 commit comments