Skip to content

Commit 0b27540

Browse files
ziyuheheziyuhehe
andauthored
Update (#26)
* update document * Update * update --------- Co-authored-by: ziyuhehe <[email protected]>
1 parent 230affd commit 0b27540

File tree

9 files changed

+172
-31
lines changed

9 files changed

+172
-31
lines changed

docs/embed-bot-consumption-page/embed-bot-consumption-properties.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,3 +484,38 @@ microstrategy.embeddingContexts.embedBotConsumptionPage({
484484
},
485485
});
486486
```
487+
488+
### `settings`
489+
490+
Specify the custom settings on the embedding pages. Including the non-UI settings of bot consumption page.
491+
492+
#### Required?
493+
494+
No
495+
496+
#### Properties
497+
498+
##### `botConsumption`
499+
500+
Use the `botConsumption` object to customize the options on the bot consumption page. The detailed properties contain:
501+
502+
- `disableManipulationsAutoSaving`
503+
504+
- Disable the bot instance manipulation auto saving or not.
505+
- Default value: `false`.
506+
507+
#### Sample
508+
509+
```js
510+
microstrategy.embeddingContexts.embedBotConsumptionPage({
511+
serverUrl: "https://demo.microstrategy.com/MicroStrategyLibrary",
512+
projectId: "B19DEDCC11D4E0EFC000EB9495D0F44F",
513+
objectId: "D9AB379D11EC92C1D9DC0080EFD415BB",
514+
placeholder: document.getElementById("container"),
515+
settings: {
516+
botConsumption: {
517+
disableManipulationsAutoSaving: true,
518+
},
519+
},
520+
});
521+
```

docs/embed-dossier-consumption-page/embed-dossier-consumption-properties.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,15 @@ Use the `dossierConsumption` object to customize the options on the dashboard co
334334
- Default value: "noSelection".
335335

336336
- `disableManipulationsAutoSaving`
337+
337338
- Disable the dashboard instance manipulation auto saving or not.
338339
- Default value: `false`.
339340

341+
- `enablePageSelection`
342+
343+
- Enable dashoard page selection in the TOC panel.
344+
- Default value: `false`.
345+
340346
#### Sample
341347

342348
```js
@@ -349,6 +355,7 @@ microstrategy.embeddingContexts.embedDossierConsumptionPage({
349355
dossierConsumption: {
350356
componentSelectionMode: "multipleSelection",
351357
disableManipulationsAutoSaving: false,
358+
enablePageSelection: false,
352359
},
353360
},
354361
});

docs/embed-library-main-page/embed-custom-ui-on-all-pages.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ microstrategy.embeddingContexts.embedLibraryPage({
7272
bookmark: true,
7373
undoRedo: true,
7474
edit: false,
75+
dockedToc: {
76+
isOpen: false,
77+
isDocked: false,
78+
},
7579
},
7680
},
7781
dossierAuthoring: {
@@ -268,6 +272,12 @@ Use the `navigationBar` object to customize the navigation bar on the page. All
268272
- `edit`
269273
- Show or hide the edit icon.
270274
- Default value: `false`.
275+
- `dockedToc.isOpen`
276+
- Open or close TOC panel.
277+
- Default value: `false`.
278+
- `dockedToc.isDocked`
279+
- Pin or unpin TOC panel.
280+
- Default value: `false`.
271281

272282
#### Required?
273283

docs/embed-library-main-page/embed-library-properties.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ Specifies the page on the sidebar entries that you want to embed.
368368
};
369369
```
370370

371-
- `currentPage.key`: This field specifies the key of the page that the user wants to embed. Its available values are the menu items in the sidebar, which could be in ['all', 'myContent', 'favorites', 'recents', 'insights', 'subscriptions', 'defaultGroups', 'myGroups'].
371+
- `currentPage.key`: This field specifies the key of the page that the user wants to embed. Its available values are the menu items in the sidebar, which could be in ['home', 'insights', 'subscriptions', 'defaultGroups', 'myGroups', 'contentDiscovery'].
372372

373373
- `currentPage.targetGroup`: This field is only necessary when `currentPage.key` is 'defaultGroups' or 'myGroups', as on library home page the user can't select these 2 menu items but only could select the group items under them. It specifies which group item the user wants to select.
374374

docs/native-embedding-architecture/mstr-dossier.md

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The object returned from the `MstrEnvironment.loadDossier()` function, which all
1313

1414
#### Function
1515

16-
`async refresh(props)`
16+
`async refresh(props, options)`
1717

1818
#### Input Parameters
1919

@@ -22,6 +22,8 @@ The object returned from the `MstrEnvironment.loadDossier()` function, which all
2222
| props | Array | This parameter cannot be empty. It describes the visualizations that must appear on the page. Each visualization must have a valid container. If you call `refresh()` for a second time, the visualizations rendered in the former `refresh()` call are destroyed first, then all the visualizations specified in the second `refresh()` call are shown on page by page. | true |
2323
| props[i].key | String | The visualization key id. | true |
2424
| props[i].container | HTMLElement | The HTML element used for displaying the visualization. The HTML element must be in the current DOM tree of the client’s page. All elements must exist and cannot be in iframes. The `Node.contains()` function is used to determine this and is compatible with all browsers. | true |
25+
| options | Object | An object containing optional parameters to control the behavior of the `refresh()` function. | false |
26+
| options.signal | AbortSignal | An `AbortSignal` object that allows you to abort the refresh operation. This signal is typically created by an `AbortController` and can be used to cancel the operation by calling `AbortController.abort()` if needed. | false |
2527

2628
#### Response
2729

@@ -55,19 +57,57 @@ try {
5557
}
5658
```
5759

60+
With AbortController:
61+
62+
```js
63+
const abortController = new AbortController();
64+
try {
65+
const environment = await microstrategy.embeddingComponent.environments.create({
66+
serverUrl: "https://demo.microstrategy.com/MicroStrategyLibrary",
67+
getAuthToken: () => {
68+
// Logic similar to the existing Native Embedding SDK.
69+
},
70+
});
71+
const dossier = await environment.loadDossier({
72+
projectId: "B19DEDCC11D4E0EFC000EB9495D0F44F",
73+
objectId: "D9AB379D11EC92C1D9DC0080EFD415BB",
74+
});
75+
// Begin here
76+
const containerHtmlElement = document.getElementById("containerA");
77+
// Use the abortController's signal
78+
dossier.refresh(
79+
[
80+
{
81+
key: "K66",
82+
container: containerHtmlElement,
83+
},
84+
],
85+
{ signal: abortController.signal }
86+
);
87+
// Your own code after the visualizations are all loaded
88+
} catch (error) {
89+
// Add your own handling logic here
90+
}
91+
92+
if (shouldAbortRefresh) {
93+
abortController.abort();
94+
}
95+
```
96+
5897
#### API Errors
5998

60-
| Error Case | Error Category | Handling Module | Error Handling |
61-
| ----------------------------------------------------------------------------------- | -------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
62-
| The input parameter fails input validation | Invalid input | Native Embedding SDK | Caught by the `catch()` of the promise object |
63-
| The user wants to show more than one visualization in one container in input params | Invalid input | Native Embedding SDK | Caught by the `catch()` of the promise object |
64-
| The user wants to show one visualization in multiple containers | Invalid input | Native Embedding SDK | Caught by the `catch()` of the promise object |
65-
| Visualization key isn't a valid visualization key in the dashboard | Invalid input | Native Embedding SDK | Caught by the `catch()` of the promise object |
66-
| The container isn’t a valid HTML element in the DOM tree | Invalid input | Native Embedding SDK | Caught by the `catch()` of the promise object |
67-
| A container has children that are not shown in the visualization | Invalid input | Native Embedding SDK | Caught by the `catch()` of the promise object |
68-
| A container is occupied by other dossiers | Invalid input | Native Embedding SDK | Caught by the `catch()` of the promise object |
69-
| Other REST API errors | Other | Native Embedding SDK | Caught by the `catch()` of the promise object |
70-
| The key is the visualization key of the visualization in the panel | Invalid input | Native Embedding SDK | console err message in console "The visualization `${VisualizationKey}` is a visualization in a panel, which isn't supported." |
99+
| Error Case | Error Category | Handling Module | Error Handling |
100+
| -------------------------------------------------------------------------------------------------------- | -------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
101+
| The input parameter fails input validation | Invalid input | Native Embedding SDK | Caught by the `catch()` of the promise object |
102+
| The user wants to show more than one visualization in one container in input params | Invalid input | Native Embedding SDK | Caught by the `catch()` of the promise object |
103+
| The user wants to show one visualization in multiple containers | Invalid input | Native Embedding SDK | Caught by the `catch()` of the promise object |
104+
| Visualization key isn't a valid visualization key in the dashboard | Invalid input | Native Embedding SDK | Caught by the `catch()` of the promise object |
105+
| The container isn’t a valid HTML element in the DOM tree | Invalid input | Native Embedding SDK | Caught by the `catch()` of the promise object |
106+
| A container has children that are not shown in the visualization | Invalid input | Native Embedding SDK | Caught by the `catch()` of the promise object |
107+
| A container is occupied by other dossiers | Invalid input | Native Embedding SDK | Caught by the `catch()` of the promise object |
108+
| Other REST API errors | Other | Native Embedding SDK | Caught by the `catch()` of the promise object |
109+
| The key is the visualization key of the visualization in the panel | Invalid input | Native Embedding SDK | console err message in console "The visualization `${VisualizationKey}` is a visualization in a panel, which isn't supported." |
110+
| Object you pass to AbortController.abort(), or `AbortError: signal is aborted without reason` otherwise. | Abort Error | Native Embedding SDK | Caught by the `catch()` of the promise object |
71111

72112
### The get information API
73113

docs/native-embedding-architecture/mstr-environment.md

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ The instance of this class is the object returned from the `microstrategy.embedd
1717

1818
#### Input Parameters
1919

20-
| Parameter Name | Data Type | Description | Is Required |
21-
| ---------------- | --------- | -------------------------------------------------------------------------------------------------------- | ----------- |
22-
| props.projectId | String | The project ID, which must be a GUID. | true |
23-
| props.objectId | String | The dashboard ID, which must be valid. If the ID is a document, report, or bot ID, an error is reported. | true |
24-
| props.instanceId | String | The dashboard instance ID, if it already exists. | false |
20+
| Parameter Name | Data Type | Description | Is Required |
21+
| ------------------- | --------- | -------------------------------------------------------------------------------------------------------- | ----------- |
22+
| props.projectId | String | The project ID, which must be a GUID. | true |
23+
| props.objectId | String | The dashboard ID, which must be valid. If the ID is a document, report, or bot ID, an error is reported. | true |
24+
| props.instanceId | String | The dashboard instance ID, if it already exists. | false |
25+
| props.applicationId | String | the dashboard application ID, if not specified, the default application will be used | false |
2526

2627
The `projectId` + `objectId` is used as the dashboard identifier. If the function is called twice with the same parameter, the same `MstrDossier` object is returned in the callback.
2728

@@ -97,10 +98,11 @@ try {
9798

9899
#### Input Parameters
99100

100-
| Parameter Name | Data Type | Description | Is Required |
101-
| --------------- | --------- | ------------------------------------------------------------------------------------------------------- | ----------- |
102-
| props.projectId | String | The project ID, which must be a GUID. | true |
103-
| props.objectId | String | The bot ID, which must be valid. If the ID is a dashboard, document or report ID, an error is reported. | true |
101+
| Parameter Name | Data Type | Description | Is Required |
102+
| ------------------- | --------- | ------------------------------------------------------------------------------------------------------- | ----------- |
103+
| props.projectId | String | The project ID, which must be a GUID. | true |
104+
| props.objectId | String | The bot ID, which must be valid. If the ID is a dashboard, document or report ID, an error is reported. | true |
105+
| props.applicationId | String | the bot application ID, if not specified, the default application will be used | false |
104106

105107
The `projectId` + `objectId` is used as the bot identifier. If the function is called twice with the same parameter, the same `MstrBot` object is returned in the callback.
106108

@@ -134,3 +136,30 @@ try {
134136
| ------------------------------------------ | -------------- | -------------------- | --------------------------------------------- |
135137
| The input parameter fails input validation | Invalid input | Native Embedding SDK | Caught by the `catch()` of the promise object |
136138
| Other REST API errors | Other | Native Embedding SDK | Caught by the `catch()` of the promise object |
139+
140+
### The get authToken API
141+
142+
#### Function
143+
144+
`getAuthToken()`
145+
146+
#### Response
147+
148+
This API returns the authentication token obtained by the MstrEnvironment.
149+
150+
#### Example
151+
152+
```js
153+
try {
154+
const environment = await microstrategy.embeddingComponent.environments.create({
155+
serverUrl: "https://demo.microstrategy.com/MicroStrategyLibrary",
156+
getAuthToken: () => {
157+
// Logic similar to the existing Native Embedding SDK.
158+
},
159+
});
160+
// Get authentication token
161+
const authToken = environment.getAuthToken();
162+
} catch (error) {
163+
// Your own error handling logic
164+
}
165+
```

docs/whats-new-in-the-embedding-sdk.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@ description: In each release, changes are made to make the MicroStrategy SDK mor
55

66
In each release, changes are made to make the MicroStrategy SDK more powerful and easier to use.
77

8+
## MicroStrategy ONE September 2024
9+
10+
- [Embed MicroStrategy dashboard consumption page.](./embed-dossier-consumption-page/embed-dossier-consumption-page.md)
11+
- Introduce `enablePageSelection` property to customize displaying page selectors in the TOC panel of Microstrategy dashboard consumption page.
12+
- [The customized UI settings in Embedding SDK.](./embed-library-main-page/embed-custom-ui-on-all-pages.md)
13+
- Introduce `customUi` object property `dockedToc` to customize default values of `isOpen` and `isDocked` of the TOC panel in the UI of Microstrategy dashboard consumption page.
14+
- [Embed Dashboard Visualizations with Native Embedding SDK.](./native-embedding-architecture/mstr-dossier.md)
15+
- Introduce `AbortController` support to cancel `MstrDossier.refresh()` calls.
16+
- [Native Embedding MstrEnvironment Class](./native-embedding-architecture/mstr-environment.md)
17+
18+
- Introduce optional `applicationId` input parameter for `MstrEnvironment.loadDossier()` and `MstrEnvironment.loadBot()`.
19+
- Introduce `MstrEnvironment.getAuthToken()` function.
20+
21+
- [Properties for an embedded MicroStrategy Library home page.](./embed-library-main-page/embed-library-properties.md)
22+
- Change the available values of `currentPage.key` according to the Library UI change and new API functionalities: Remove 'all', 'myContent', 'favorites' and 'recents'; add 'home' and 'contentDiscovery'.
23+
824
## MicroStrategy ONE June 2024
925

1026
- [Embed MicroStrategy bot consumption page.](./embed-bot-consumption-page/embed-bot-consumption-page.md)

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
"react-dom": "^18.3.1",
4646
"yarn": "^1.22.22"
4747
},
48+
"resolutions": {
49+
"@docusaurus/core/webpack-bundle-analyzer/ws": "7.5.10",
50+
"@docusaurus/core/webpack-dev-server/ws": "8.17.1"
51+
},
4852
"devDependencies": {
4953
"@cmfcmf/docusaurus-search-local": "^1.1.0",
5054
"@docusaurus/eslint-plugin": "^3.3.2",

0 commit comments

Comments
 (0)