Skip to content

Commit

Permalink
ante: fix dialog display
Browse files Browse the repository at this point in the history
  • Loading branch information
ChlodAlejandro committed Jan 17, 2025
1 parent b1dd0f4 commit dae6ce6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/modules/ante/ui/CopiedTemplateEditorDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,10 @@ function initCopiedTemplateEditorDialog() {
TemplateMerger.merge( noticeSet );
}
} ) :
OO.ui.alert( 'There are no templates to merge.' );
window.CopiedTemplateEditor.windowManager.openWindow( 'message', {
message: 'There are no templates to merge.',
actions: [ OO.ui.MessageDialog.static.actions[ 0 ] ]
} );
} );

const resetButton = new OO.ui.ButtonWidget( {
Expand Down Expand Up @@ -478,9 +481,11 @@ function initCopiedTemplateEditorDialog() {
unwrapWidget( this.layout )
.querySelector( '.oo-ui-flaggedElement-invalid' ) != null
) {
return new OO.ui.Process( () => {
OO.ui.alert( mw.msg( 'deputy.ante.invalid' ) );
window.CopiedTemplateEditor.windowManager.openWindow( 'message', {
message: mw.msg( 'deputy.ante.invalid' ),
actions: [ OO.ui.MessageDialog.static.actions[ 0 ] ]
} );
return process;
}

// Saves the page.
Expand Down
5 changes: 4 additions & 1 deletion src/modules/ante/ui/pages/CopiedTemplateRowPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,10 @@ function initCopiedTemplateRowPage() {
confirmProcess.execute();
} catch ( e ) {
error( 'Cannot convert `diff` parameter to URL.', e );
OO.ui.alert( mw.msg( 'deputy.ante.copied.diffDeprecate.failed' ) );
window.CopiedTemplateEditor.windowManager.openWindow( 'message', {
message: mw.msg( 'deputy.ante.copied.diffDeprecate.failed' ),
actions: [ OO.ui.MessageDialog.static.actions[ 0 ] ]
} );
}
}

Expand Down

0 comments on commit dae6ce6

Please sign in to comment.