Skip to content

Commit

Permalink
Prompts for confirmation before removing an app from app catalog. (#356)
Browse files Browse the repository at this point in the history
## 🎯 Aim

Prompts for a confirmation before removing an app from the app catalog to prevent accidental removals and improve user experience.

## 📷 Result

![image](https://github.com/user-attachments/assets/967a48f7-a73c-457e-8dd1-6f61917b915b)

## ✅ What was done

- [X] Updated `removeAppCatalogApp` function to check the user's
response and proceed with removal only if confirmed.

## 🔗 Related issue

Closes: #349
  • Loading branch information
Saurabh7019 authored Nov 23, 2024
1 parent 48c06ec commit 2d9f263
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/services/actions/CliActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,18 @@ export class CliActions {

const [appID, appTitle, appCatalogUrl] = actionNode.command.arguments;

const shouldRemove = await window.showQuickPick(['Yes', 'No'], {
title: `Are you sure you want to remove the app '${appTitle}' from the app catalog?`,
ignoreFocusOut: true,
canPickMany: false
});

const shouldRemoveAnswer = shouldRemove === 'Yes';

if (!shouldRemoveAnswer) {
return;
}

const commandOptions: any = {
id: appID,
force: true,
Expand Down

0 comments on commit 2d9f263

Please sign in to comment.