openmct/platform/commonUI/dialog
Charles Hacskaylo a4fab3ce8a
UI enhancement fixes (#3222)
- Added min-width and min-height to Display Layout lines to allow
 easier selection and move when line is purely vertical or horizontal;
 - Fixed spacing, size and icon of overlay close button;
2020-07-22 11:35:06 -07:00
..
res/templates UI enhancement fixes (#3222) 2020-07-22 11:35:06 -07:00
src Auto-correct lint errors (#2450) 2019-08-27 09:26:58 -07:00
test Use instead of to avoid double digest issue (#2346) 2019-03-29 15:38:39 -07:00
bundle.js Experimental unit tests for the Telemetry Table component (#2533) 2019-11-27 16:04:52 -08:00
README.md [Licenses] Update copyright year to 2017 2017-04-05 14:52:46 -07:00

This bundle provides dialogService, which can be used to prompt for user input.

getUserChoice

The getUserChoice method is useful for displaying a message and a set of buttons. This method returns a promise which will resolve to the user's chosen option (or, more specifically, its key), and will be rejected if the user closes the dialog with the X in the top-right;

The dialogModel given as an argument to this method should have the following properties.

  • title: The title to display at the top of the dialog.
  • hint: Short message to display below the title.
  • template: Identifying key (as will be passed to mct-include) for the template which will be used to populate the inner area of the dialog.
  • model: Model to pass in the ng-model attribute of mct-include.
  • parameters: Parameters to pass in the parameters attribute of mct-include.
  • options: An array of options describing each button at the bottom. Each option may have the following properties:
    • name: Human-readable name to display in the button.
    • key: Machine-readable key, to pass as the result of the resolved promise when clicked.
    • description: Description to show in tool tip on hover.