Skip to content

Commit

Permalink
fix: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
BramMeir committed May 23, 2024
1 parent 9793d91 commit 33a8840
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions frontend/src/components/projects/ProjectExtraChecksEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const displayExtraCheckCreation = ref(false);
/* Form content */
let form = reactive(new ExtraCheck());
// State to manage the visibility of the confirmation dialog and the selected docker image
// State to manage the visibility of the confirmation dialog for the deletion of a docker image
const confirmDialogVisible = ref(false);
// Define validation rules for each form field
Expand Down Expand Up @@ -99,19 +99,12 @@ async function onDockerImageUpload(event: any): Promise<void> {
emit('create:docker-image', dockerImage, event.files[0]);
}
/**
* Function to remove the docker image from the list of docker images
*/
async function confirmDelete(dockerImage: DockerImage): Promise<void> {
confirmDialogVisible.value = true;
removeDockerImage(dockerImage);
}
/**
* Function to remove the docker image from the list of docker images
*/
async function removeDockerImage(dockerImage: DockerImage): Promise<void> {
// Show a confirmation dialog before removing the image, to prevent accidental clicks
confirmDialogVisible.value = true;
confirm.require({
message: t('confirmations.deleteDockerImage'),
header: t('views.projects.extraChecks.deleteDockerImage'),
Expand Down Expand Up @@ -304,7 +297,7 @@ async function removeDockerImage(dockerImage: DockerImage): Promise<void> {
v-if="!slotProps.data.public"
icon="pi pi-trash"
class="p-button-danger p-button-sm"
@click="confirmDelete(slotProps.data)"
@click="removeDockerImage(slotProps.data)"
outlined
rounded
/>
Expand Down

0 comments on commit 33a8840

Please sign in to comment.