mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 09:20:16 +00:00
Added spinner for notebook delete (#458)
* initial UI for delete published nb spinner * added notebook delete spinner * addressed PR comments
This commit is contained in:
committed by
GitHub
parent
4127d0f522
commit
b8e9903287
@@ -373,7 +373,9 @@ export function deleteItem(
|
||||
container: Explorer,
|
||||
junoClient: JunoClient,
|
||||
data: IGalleryItem,
|
||||
onComplete: (item: IGalleryItem) => void
|
||||
onComplete: (item: IGalleryItem) => void,
|
||||
beforeDelete?: () => void,
|
||||
afterDelete?: () => void
|
||||
): void {
|
||||
if (container) {
|
||||
trace(Action.NotebooksGalleryClickDelete, ActionModifiers.Mark, { notebookId: data.id });
|
||||
@@ -383,6 +385,9 @@ export function deleteItem(
|
||||
`Would you like to remove ${data.name} from the gallery?`,
|
||||
"Remove",
|
||||
async () => {
|
||||
if (beforeDelete) {
|
||||
beforeDelete();
|
||||
}
|
||||
const name = data.name;
|
||||
const notificationId = NotificationConsoleUtils.logConsoleMessage(
|
||||
ConsoleDataType.InProgress,
|
||||
@@ -409,6 +414,10 @@ export function deleteItem(
|
||||
);
|
||||
|
||||
handleError(error, "GalleryUtils/deleteItem", `Failed to remove ${name} from gallery`);
|
||||
} finally {
|
||||
if (afterDelete) {
|
||||
afterDelete();
|
||||
}
|
||||
}
|
||||
|
||||
NotificationConsoleUtils.clearInProgressMessageWithId(notificationId);
|
||||
|
||||
Reference in New Issue
Block a user