- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3.6k
          Add 'prompt' functionality to abp.message object
          #23915
        
          New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Introduces a new abp.message.prompt function using SweetAlert2 to display input dialogs. This allows developers to easily prompt users for text input with customizable options.
| Images automagically compressed by Calibre's image-actions ✨ Compression reduced images by 68.3%, saving 15.4 KB. 
 | 
| Images automagically compressed by Calibre's image-actions ✨ Compression reduced images by 7.5%, saving 549 B. 
 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add a default implementation of abp.message.prompt.
const userInput = prompt("Enter a new name to change your name: ");
if (userInput !== null) {
  console.log("User enter:", userInput);
} else {
  console.log("User canceled.");
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new prompt functionality to the abp.message object that exposes SweetAlert2's input capabilities, allowing developers to collect text input from users through a modal dialog.
- Implements abp.message.prompt()method with callback and promise support
- Adds configuration defaults for prompt dialogs in the SweetAlert config
- Updates documentation with usage examples and API reference
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description | 
|---|---|
| abp-sweetalert2.js | Adds prompt method implementation and default configuration | 
| message.md | Documents the new prompt functionality with examples and API reference | 
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
        
          
                ....Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/sweetalert2/abp-sweetalert2.js
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                ....Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/sweetalert2/abp-sweetalert2.js
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                ....Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/sweetalert2/abp-sweetalert2.js
              
                Outdated
          
            Show resolved
            Hide resolved
        
      Introduces abp.message.prompt to display a browser prompt and invoke a callback with the result. Logs a warning indicating the method is not fully implemented.
| 
 | 
Description
abp.message.prompt(...)function is added to expose SweetAlert2 input function.Simple usage:
Example
Checklist