File tree Expand file tree Collapse file tree
core-notifications/src/NotificationsItem
plugin-sql-editor-navigation-tab-resource/src
plugin-sql-editor/src/SqlEditor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ export interface INotification<TProps extends INotificationExtraProps<any> = INo
5454 message ?: string ;
5555 timestamp : number ;
5656 details ?: string | Error | null ;
57+ autoClose ?: boolean ;
5758 persistent ?: boolean ;
5859 state : { deleteDelay : number } ;
5960 isSilent : boolean ;
@@ -69,6 +70,7 @@ export interface INotificationOptions<TProps extends INotificationExtraProps<any
6970 message ?: string ;
7071 details ?: string | Error | null ;
7172 isSilent ?: boolean ;
73+ autoClose ?: boolean ;
7274 persistent ?: boolean ;
7375 extraProps ?: TProps ;
7476 timestamp ?: number ;
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ export class NotificationService {
8080 isSilent : ! ! options . isSilent ,
8181 customComponent : options . customComponent ,
8282 extraProps : options . extraProps || { } as TProps ,
83+ autoClose : options . autoClose ,
8384 persistent : options . persistent ,
8485 state : observable ( { deleteDelay : 0 } ) ,
8586 timestamp : options . timestamp || Date . now ( ) ,
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export class NotificationItemController implements IInitializableController {
2222 isDetailsDialogOpen = false ;
2323 private notification ! : INotification < any > ;
2424
25- constructor ( private commonDialogService : CommonDialogService ) {
25+ constructor ( private readonly commonDialogService : CommonDialogService ) {
2626 makeObservable ( this , {
2727 isDetailsDialogOpen : observable ,
2828 } ) ;
@@ -35,7 +35,11 @@ export class NotificationItemController implements IInitializableController {
3535 this . handleShowDetails = this . showDetails . bind ( this ) ;
3636 }
3737
38- if ( notification . type !== ENotificationType . Error && ! notification . persistent ) {
38+ if (
39+ notification . type !== ENotificationType . Error
40+ && ! notification . persistent
41+ && notification . autoClose !== false
42+ ) {
3943 this . closeAfter = FadeTimeout ;
4044 }
4145 }
Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ export class PluginBootstrap extends Bootstrap {
204204 this . notificationService . logInfo ( {
205205 title : 'sql_editor_upload_script_max_size_title' ,
206206 message : `Max size: ${ maxSize } KB\nFile size: ${ size } KB` ,
207- persistent : true ,
207+ autoClose : false ,
208208 } ) ;
209209
210210 return ;
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ export function useTools(state: ISqlEditorTabState): Readonly<State> {
8282 this . notificationService . logInfo ( {
8383 title : 'sql_editor_upload_script_max_size_title' ,
8484 message : `Max size: ${ maxSize } KB\nFile size: ${ size } KB` ,
85+ autoClose : false ,
8586 } ) ;
8687
8788 return false ;
You can’t perform that action at this time.
0 commit comments