From e114bba7e14c1159976ad61f4f0b1854c4a6d76a Mon Sep 17 00:00:00 2001 From: davidbrenner Date: Sun, 6 Jun 2021 23:01:28 -0400 Subject: [PATCH 1/3] firestore:delete getConfirmationMessage note proj. The firestore:delete command should notify the user of the current project. This should help users minimize chances of accidental deletions when switching between projects. --- src/commands/firestore-delete.ts | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/commands/firestore-delete.ts b/src/commands/firestore-delete.ts index 08023fd28d8..0485b4a932b 100644 --- a/src/commands/firestore-delete.ts +++ b/src/commands/firestore-delete.ts @@ -26,12 +26,21 @@ function getConfirmationMessage(deleteOp: FirestoreDelete, options: any) { return ( "You are about to delete the document at " + clc.cyan(deleteOp.path) + - " and all of its subcollections. Are you sure?" + " and all of its subcollections "+ + " for " + + clc.cyan(options.project) + + ". Are you sure?" ); } // Shallow document delete - return "You are about to delete the document at " + clc.cyan(deleteOp.path) + ". Are you sure?"; + return ( + "You are about to delete the document at " + + clc.cyan(deleteOp.path) + + " for " + + clc.cyan(options.project) + + ". Are you sure?" + ); } // Recursive collection delete @@ -39,8 +48,10 @@ function getConfirmationMessage(deleteOp: FirestoreDelete, options: any) { return ( "You are about to delete all documents in the collection at " + clc.cyan(deleteOp.path) + - " and all of their subcollections. " + - "Are you sure?" + " and all of their subcollections " + + " for " + + clc.cyan(options.project) + + ". Are you sure?" ); } @@ -48,6 +59,8 @@ function getConfirmationMessage(deleteOp: FirestoreDelete, options: any) { return ( "You are about to delete all documents in the collection at " + clc.cyan(deleteOp.path) + + " for " + + clc.cyan(options.project) + ". Are you sure?" ); } From 1979c19c4f935d8e983874ebc08336dd2e59c41e Mon Sep 17 00:00:00 2001 From: Sam Stern Date: Tue, 8 Jun 2021 07:06:34 -0400 Subject: [PATCH 2/3] Update firestore-delete.ts --- src/commands/firestore-delete.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/firestore-delete.ts b/src/commands/firestore-delete.ts index 0485b4a932b..2049bb92d70 100644 --- a/src/commands/firestore-delete.ts +++ b/src/commands/firestore-delete.ts @@ -26,7 +26,7 @@ function getConfirmationMessage(deleteOp: FirestoreDelete, options: any) { return ( "You are about to delete the document at " + clc.cyan(deleteOp.path) + - " and all of its subcollections "+ + " and all of its subcollections " + " for " + clc.cyan(options.project) + ". Are you sure?" From 4c8d8c82c9e390fdbb5ca64bdc1d378cbccc13ab Mon Sep 17 00:00:00 2001 From: Sam Stern Date: Tue, 8 Jun 2021 07:11:09 -0400 Subject: [PATCH 3/3] Update firestore-delete.ts --- src/commands/firestore-delete.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/firestore-delete.ts b/src/commands/firestore-delete.ts index 2049bb92d70..ccda07d7485 100644 --- a/src/commands/firestore-delete.ts +++ b/src/commands/firestore-delete.ts @@ -35,8 +35,8 @@ function getConfirmationMessage(deleteOp: FirestoreDelete, options: any) { // Shallow document delete return ( - "You are about to delete the document at " + - clc.cyan(deleteOp.path) + + "You are about to delete the document at " + + clc.cyan(deleteOp.path) + " for " + clc.cyan(options.project) + ". Are you sure?"