Add info/warning/error messages for wizards and dialogs (#1696)

This commit is contained in:
Matt Irvine
2018-06-21 11:55:23 -07:00
committed by GitHub
parent 9d2b206156
commit f5b147ca4b
16 changed files with 238 additions and 30 deletions

View File

@@ -582,6 +582,24 @@ declare module 'sqlops' {
*/
export function createWizard(title: string): Wizard;
/**
* Used to control whether a message in a dialog/wizard is displayed as an error,
* warning, or informational message. Default is error.
*/
export enum MessageLevel {
Error = 0,
Warning = 1,
Information = 2
}
/**
* A message shown in a dialog. If the level is not set it defaults to error.
*/
export type DialogMessage = {
readonly text: string,
readonly level?: MessageLevel
};
export interface ModelViewPanel {
/**
* Register model view content for the dialog.
@@ -632,6 +650,12 @@ declare module 'sqlops' {
* Any additional buttons that should be displayed
*/
customButtons: Button[];
/**
* Set the informational message shown in the dialog. Hidden when the message is
* undefined or the text is empty or undefined. The default level is error.
*/
message: DialogMessage;
}
export interface DialogTab extends ModelViewPanel {
@@ -798,6 +822,12 @@ declare module 'sqlops' {
* cancel it.
*/
registerNavigationValidator(validator: (pageChangeInfo: WizardPageChangeInfo) => boolean | Thenable<boolean>): void;
/**
* Set the informational message shown in the wizard. Hidden when the message is
* undefined or the text is empty or undefined. The default level is error.
*/
message: DialogMessage
}
}
}