Skip to content

Conversation

@enisn
Copy link
Member

@enisn enisn commented Oct 8, 2025

Description

abp.message.prompt(...) function is added to expose SweetAlert2 input function.

Simple usage:

abp.message.prompt('Please enter a name:', (value)=> console.log('Entered name:', value));

Example

let options = { title: "Name Change" ,icon: "info", inputValue: "John Doe"};
let name = await abp.message.prompt('Enter a new name to change your name', options);
if (name){
 console.log('Entered name:', name );
}
image

Checklist

  • I fully tested it as developer / designer and created unit / integration tests
  • I documented it (or no need to document or I will create a separate documentation issue)

enisn added 2 commits October 8, 2025 14:29
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.
@enisn enisn added this to the 10.0-final milestone Oct 8, 2025
@enisn enisn requested a review from maliming October 8, 2025 11:44
@enisn enisn added enhancement javascript Pull requests that update Javascript code labels Oct 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2025

Images automagically compressed by Calibre's image-actions

Compression reduced images by 68.3%, saving 15.4 KB.

Filename Before After Improvement Visual comparison
docs/en/images/js-message-prompt.png 22.5 KB 7.1 KB 68.3% View diff

@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2025

Images automagically compressed by Calibre's image-actions

Compression reduced images by 7.5%, saving 549 B.

Filename Before After Improvement Visual comparison
docs/en/images/js-message-prompt.png 7.1 KB 6.6 KB 7.5% View diff

Copy link
Member

@maliming maliming left a 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.

https://github.com/abpframework/abp/blob/rel-10.0/modules/openiddict/app/OpenIddict.Demo.Server/wwwroot/libs/abp/core/abp.js#L301-L339

const userInput = prompt("Enter a new name to change your name: ");
if (userInput !== null) {
  console.log("User enter:", userInput);
} else {
  console.log("User canceled.");
}

@maliming maliming requested a review from Copilot October 8, 2025 12:51
Copy link
Contributor

Copilot AI left a 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.

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.
@enisn
Copy link
Member Author

enisn commented Oct 8, 2025

const userInput = prompt("Enter a new name to change your name: ");
if (userInput !== null) {
  console.log("User enter:", userInput);
} else {
  console.log("User canceled.");
}

0661d1a

@enisn enisn requested a review from maliming October 8, 2025 13:27
@maliming maliming merged commit 9cbcb5f into rel-10.0 Oct 9, 2025
3 checks passed
@maliming maliming deleted the 10.0-sweetalert-prompt branch October 9, 2025 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants