@@ -229,30 +229,30 @@ You can also modify the dimensions of a dialog using the dialog API's `update` m
229229
230230## Showing a Progress Dialog
231231
232- To show a progress dialog , you will need to call the method ` studioPro.ui.dialogs.showProgressDialog(<title>, <steps>) ` , where :
232+ To show a progress dialog , call the method ` studioPro.ui.dialogs.showProgressDialog(<title>, <steps>) ` , where :
233233
234- * ` <title> ` is a string which will be displayed in the title bar of the dialog .
235- * ` <steps> ` is an array of ` ProgressDialogStep ` , which will run in the same order provided in the array . A ` ProgressDialogStep ` object containing the following properties :
236- * ` title ` — the title of the step . It is highlighted when the step is running
237- * ` description ` — the description of the step . It will show at the bottom of the dialog next to the progress bar
238- * ` action ` — the action that the step will perform . It returns ` Promise<true | string> ` . If the step fails , string should be the reason for the failure . Otherwise , ` true ` will be returned .
234+ * ` <title> ` is a string that is displayed in the title bar of the dialog
235+ * ` <steps> ` is an array of ` ProgressDialogStep ` , which runs in the same order provided in the array ; a ` ProgressDialogStep ` object contains the following properties :
236+ * ` title ` – the title of the step , which is highlighted when the step is running
237+ * ` description ` – the description of the step , which shows at the bottom of the dialog next to the progress bar
238+ * ` action ` – the action the step will perform that returns ` Promise<true | string> ` , where ` string ` indicates the reason for failure if the step fails , and ` true ` is returned otherwise
239239
240- A checkmark icon will be shown next to the step title after the step has completed successfully . But if one of the steps fails , the dialog will close and the remaining steps will not be executed .
240+ A checkmark icon will be shown next to the step title once step has completed successfully . If one of the steps fails , the dialog will close and the remaining steps will not be executed .
241241
242242The ` showProgressDialog ` method returns a ` Promise<ProgressDialogResult> ` . ` ProgressDialogResult ` is an object that contains the following properties :
243243
244- * ` result ` - a string that is either ` Success ` , ` Failure ` or ` UserCancelled `
245- * ` Success ` is returned when all the steps have returned true
246- * ` Failure ` is returned when one step has failed , causing the dialog to close
247- * ` UserCancelled ` is returned when the user closes the dialog themselves and interrupts the process
248- * ` failedStep ` (optional ) - it is an object of type ` FailedProgressStepResult ` which describes the actual step that has failed
244+ * ` result ` – a string that is either ` Success ` , ` Failure ` , or ` UserCancelled `
245+ * ` Success ` – returned when all the steps have returned true
246+ * ` Failure ` – returned when one step has failed , causing the dialog to close
247+ * ` UserCancelled ` – returned when the user closes the dialog themselves and interrupts the process
248+ * ` failedStep ` (optional ) – an object of type ` FailedProgressStepResult ` which describes the actual step that has failed
249249
250250The ` FailedProgressStepResult ` object contains the following properties :
251251
252- * ` stepTitle ` - the title of the step that has failed , causing the whole process to fail
253- * ` error ` - a string which describes the error or exception that has occurred during the step execution
252+ * ` stepTitle ` – the title of the step that has failed , causing the whole process to fail
253+ * ` error ` – a string which describes the error or exception that has occurred during the step execution
254254
255- In this example , we will create a menu to show the modal progress dialog , and run three steps . This is done inside the ` loaded ` event in the main entry point (` src/main/index.ts ` ).
255+ In the example below , you create a menu to show the modal progress dialog , and run three steps . This is done inside the ` loaded ` event in the main entry point (` src/main/index.ts ` ).
256256
257257` ` ` typescript
258258import { ComponentContext, IComponent, ProgressDialogStep, getStudioProApi } from "@mendix/extensions-api";
@@ -319,7 +319,7 @@ export const component: IComponent = {
319319};
320320```
321321
322- It is recommended to always wrap your step action body in a ` try/catch ` block so that you can be in control of the error that gets returned to the user:
322+ It is recommended to always wrap your step action body in a ` try/catch ` block so you can be in control of the error that is returned to the user:
323323
324324``` typescript
325325const step: ProgressDialogStep = {
@@ -337,7 +337,7 @@ const step: ProgressDialogStep = {
337337```
338338
339339When running, the progress dialog will look like this:
340- {{< figure src="/attachments/apidocs-mxsdk/apidocs/extensibility-api/web/dialogs/sample-progress-dialog.png" >}}
340+ {{< figure src="/attachments/apidocs-mxsdk/apidocs/extensibility-api/web/dialogs/sample-progress-dialog.png" width="300" >}}
341341
342342## Extensibility Feedback
343343
0 commit comments