File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed
dashboards/components/dashboard_index Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -228,10 +228,15 @@ class DashboardCard extends PureComponent<Props> {
228228 )
229229 }
230230
231- private handleDeleteDashboard = ( ) => {
231+ private handleDeleteDashboard = async ( ) => {
232232 const { id, name, onDeleteDashboard} = this . props
233233 onDeleteDashboard ( id , name )
234- deletePinnedItemByParam ( id )
234+ try {
235+ await deletePinnedItemByParam ( id )
236+ this . props . sendNotification ( pinnedItemSuccess ( 'task' , 'deleted' ) )
237+ } catch ( error ) {
238+ this . props . sendNotification ( pinnedItemFailure ( error . message , 'delete' ) )
239+ }
235240 }
236241
237242 private handleClickDashboard = event => {
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ const MenuButton: FC<Props> = ({handleResetShare}) => {
6666 event ( 'delete_notebook' , {
6767 context : 'notebook' ,
6868 } )
69- deletePinnedItemByParam ( flow . id )
69+ await deletePinnedItemByParam ( flow . id )
7070 await deleteNotebook ( )
7171 setLoading ( RemoteDataState . Done )
7272 history . push ( `/orgs/${ orgID } /${ PROJECT_NAME_PLURAL . toLowerCase ( ) } ` )
Original file line number Diff line number Diff line change @@ -157,9 +157,13 @@ export class TaskCard extends PureComponent<
157157 }
158158 }
159159
160- private handleOnDelete = task => {
160+ private handleOnDelete = async task => {
161161 this . props . onDelete ( task )
162- deletePinnedItemByParam ( task . id )
162+ try {
163+ await deletePinnedItemByParam ( task . id )
164+ } catch ( error ) {
165+ this . props . sendNotification ( pinnedItemFailure ( error . message , 'delete' ) )
166+ }
163167 }
164168 private get contextMenu ( ) : JSX . Element {
165169 const { task, onClone, isPinned} = this . props
You can’t perform that action at this time.
0 commit comments