Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@
* `title` – The title of the step, which is highlighted when the step runs.
* `description` – The description of the step, which shows at the bottom of the dialog next to the progress bar.
* `action` – The action the step performs that returns `Promise<true | string>`, where `string` indicates the reason for failure if the step fails, and `true` is returned otherwise.
* `<resolveImmediatelyOnCancel>` - An optional boolean that, if provided, can only be `true`. If the developer needs the state that exists at the exact time of cancellation, then they can pass `true` for this parameter. The default behavior is that the cancelled step will finish, and the whole dialog will return the state that exists when the cancelled step is completed. If the developer needs the state that exists at the exact time of cancellation, then they can pass `true` for this parameter.

Check failure on line 233 in content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/dialog-api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Mendix.AmericanSpelling] Use American English spelling 'canceled' instead of 'cancelled'. Raw Output: {"message": "[Mendix.AmericanSpelling] Use American English spelling 'canceled' instead of 'cancelled'.", "location": {"path": "content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/dialog-api.md", "range": {"start": {"line": 233, "column": 346}}}, "severity": "ERROR"}

Check failure on line 233 in content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/dialog-api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Mendix.AmericanSpelling] Use American English spelling 'canceled' instead of 'cancelled'. Raw Output: {"message": "[Mendix.AmericanSpelling] Use American English spelling 'canceled' instead of 'cancelled'.", "location": {"path": "content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/dialog-api.md", "range": {"start": {"line": 233, "column": 254}}}, "severity": "ERROR"}

Check failure on line 233 in content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/dialog-api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Mendix.Capitalization] Use ''Boolean'' (capitalized) Raw Output: {"message": "[Mendix.Capitalization] Use ''Boolean'' (capitalized)", "location": {"path": "content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/dialog-api.md", "range": {"start": {"line": 233, "column": 48}}}, "severity": "ERROR"}

A checkmark icon appears next to the step title when the step completes successfully. If one of the steps fails, the dialog closes and the remaining steps do not run.

Expand All @@ -238,9 +239,11 @@
* `result` – A string that is either `Success`, `Failure`, or `UserCancelled`:
* `Success` – Returned when all steps return `true`.
* `Failure` – Returned when one step fails, causing the dialog to close.
* `UserCancelled` – Returned when the user closes the dialog and interrupts the process.
* `UserCancelled` – Returned when the user closes the dialog and interrupts the process. The cancelled step still finishes executing, and unless `resolveImmediatelyOnCancel` is `true`, the final state of the result will contain the changes performed by the step.

Check failure on line 242 in content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/dialog-api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Mendix.AmericanSpelling] Use American English spelling 'canceled' instead of 'cancelled'. Raw Output: {"message": "[Mendix.AmericanSpelling] Use American English spelling 'canceled' instead of 'cancelled'.", "location": {"path": "content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/dialog-api.md", "range": {"start": {"line": 242, "column": 98}}}, "severity": "ERROR"}
* `failedStep` (optional) – An object of type `FailedProgressStepResult` that describes the step that failed.

If the last step is cancelled, but it completed successfully, the whole result of the progress dialog will be `Success`.

Check failure on line 245 in content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/dialog-api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Mendix.AmericanSpelling] Use American English spelling 'canceled' instead of 'cancelled'. Raw Output: {"message": "[Mendix.AmericanSpelling] Use American English spelling 'canceled' instead of 'cancelled'.", "location": {"path": "content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/dialog-api.md", "range": {"start": {"line": 245, "column": 21}}}, "severity": "ERROR"}

The `FailedProgressStepResult` object contains the following properties:

* `stepTitle` – The title of the step that failed, causing the whole process to fail.
Expand Down Expand Up @@ -313,6 +316,59 @@
};
```

To see how `resolveImmediatelyOnCancel` influences the final state of the result, let's use the example above modified to set a value twice for each step into a dictionary called `state`. If `resolveImmediatelyOnCancel` is omitted when calling `showProgressDialog` (which is the default behavior), then the cancelled step will finish executing and the final result will have a value of `2` for the dictionary value set at that step.

Check failure on line 319 in content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/dialog-api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Mendix.AmericanSpelling] Use American English spelling 'canceled' instead of 'cancelled'. Raw Output: {"message": "[Mendix.AmericanSpelling] Use American English spelling 'canceled' instead of 'cancelled'.", "location": {"path": "content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/dialog-api.md", "range": {"start": {"line": 319, "column": 308}}}, "severity": "ERROR"}
If however, the developer needs the cancelled step to not influence the final result, they should pass `true` for `resolveImmediatelyOnCancel`, and once the user cancels the progress dialog, the `state` dictionary will contain a value of `1` instead of `2` for the cancelled step.

Check failure on line 320 in content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/dialog-api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Mendix.AmericanSpelling] Use American English spelling 'canceled' instead of 'cancelled'. Raw Output: {"message": "[Mendix.AmericanSpelling] Use American English spelling 'canceled' instead of 'cancelled'.", "location": {"path": "content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/dialog-api.md", "range": {"start": {"line": 320, "column": 266}}}, "severity": "ERROR"}

Check failure on line 320 in content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/dialog-api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Mendix.AmericanSpelling] Use American English spelling 'canceled' instead of 'cancelled'. Raw Output: {"message": "[Mendix.AmericanSpelling] Use American English spelling 'canceled' instead of 'cancelled'.", "location": {"path": "content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/dialog-api.md", "range": {"start": {"line": 320, "column": 37}}}, "severity": "ERROR"}

```typescript
const state: { [step: string]: number } = {};

const step1: ProgressDialogStep = {
title: "Step 1",
description: "Executing Step 1",
action: async () => {
// perform action
state["step1"] = 1;
// other things happening...
await sleep(5000);
state["step1"] = 2;
return true;
}
};

const step2: ProgressDialogStep = {
title: "Step 2",
description: "Executing Step 2",
action: async () => {
// perform action
state["step2"] = 1;
// other things happening...
await sleep(5000);
state["step2"] = 2;

return true;
}
};

const step3: ProgressDialogStep = {
title: "Step 3",
description: "Executing Step 3",
action: async () => {
// perform action
state["step3"] = 1;
// other things happening...
await sleep(5000);
state["step3"] = 2;
return true;
}
};

const resolveImmediatelyOnCancel = true;
const result = await studioPro.ui.dialogs.showProgressDialog("Cancel This Progress", [step1, step2, step3], resolveImmediatelyOnCancel);

if (result.result === "Success") await studioPro.ui.messageBoxes.show("info", "Process completed successfully");
if (result.result === "UserCancelled") await studioPro.ui.messageBoxes.show("info", "Process was cancelled. Result: " + JSON.stringify(state));
```

Mendix recommends wrapping your step action body in a `try/catch` block so you can control the error that is returned to the user:

```typescript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

These release notes cover changes to the [Extensibility API for Web Developers](/apidocs-mxsdk/apidocs/extensibility-api/).

## Version 11.12.2

* We fixed a bug where the Extensions Overview Page would not open if the user was not signed in.
* We fixed a bug where reloading a Dev extension would cause a crash if tabs previously opened via an extension were not closed before the reload.
* We fixed an issue where the progress dialogs did not behave as the C# counterpart, where cancelling a step still waited for it to finish and return its result. If the user still wants to exit the step and return the result immediately, they can still do so by passing `resolveImmediatelyOnCancel` to the `IDialogApi.showProgressDialog` method.

Check failure on line 15 in content/en/docs/releasenotes/studio-pro/web-extensibility-api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Mendix.AmericanSpelling] Use American English spelling 'canceling' instead of 'cancelling'. Raw Output: {"message": "[Mendix.AmericanSpelling] Use American English spelling 'canceling' instead of 'cancelling'.", "location": {"path": "content/en/docs/releasenotes/studio-pro/web-extensibility-api.md", "range": {"start": {"line": 15, "column": 92}}}, "severity": "ERROR"}
## Version 11.12.1

* We removed timeouts for Custom Blob Document consistency checks instead of showing a generic error in the **Errors** pane. We also added analytics to identify extensions that exceed the previous timeout.
Expand All @@ -20,6 +25,7 @@
* We added a `permissionsChanged` event to the [Permissions API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/extension-permissions/) that notifies you when the user changes the permissions of your extension.
* We added the `documentsChanged` event, which notifies you when a document that your extension depends on is modified in Studio Pro.
* The Studio Pro version is now available through the [Preferences API](/apidocs-mxsdk/apidocs/web-extensibility-api-11/preference-api/).
* We fixed an issue where the progress dialogs did not behave as the C# counterpart, where cancelling a step still waited for it to finish and return its result. If the user still wants to exit the step and return the result immediately, they can still do so by passing `resolveImmediatelyOnCancel` to the `IDialogApi.showProgressDialog` method.

## Version 11.11.0

Expand Down
Loading