You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/spfx/viva/get-started/build-first-sharepoint-adaptive-card-extension.md
+14-12Lines changed: 14 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Build your first SharePoint Adaptive Card Extension
3
3
description: Adaptive Card Extensions (ACEs) are a new SharePoint Framework component type, which enable developers to build rich, native extensions to Viva Connections' Dashboards and SharePoint Pages. In this tutorial, you'll build and explore your first ACE.
4
-
ms.date: 07/22/2021
4
+
ms.date: 08/05/2021
5
5
ms.prod: sharepoint
6
6
localization_priority: Priority
7
7
---
@@ -34,7 +34,7 @@ When prompted, enter the following values (*select the default option for all pr
34
34
35
35
When prompted by the generator for which ACE template to use, select **Primary Text Template** for this tutorial.
36
36
37
-
At this point, Yeoman installs the required dependencies and scaffolds the solution files. This might take a few minutes.
37
+
At this point, Yeoman installs the required dependencies and scaffolds the solution files. This might take few minutes.
38
38
39
39
## Step 2 - Serve the ACE in the workbench
40
40
@@ -74,7 +74,7 @@ Switch the Workbench to **Preview** mode.
74
74
75
75
:::image type="content" source="../../../images/viva-extensibility/lab1-preview.png" alt-text="Set the workbench to preview mode":::
76
76
77
-
Select on the **Quick View** button on the ACE:
77
+
Select the **Quick View** button on the ACE:
78
78
79
79
:::image type="content" source="../../../images/viva-extensibility/lab1-hw-ql.png" alt-text="Select the Quick View button on the ACE":::
80
80
@@ -131,7 +131,7 @@ The default Card view, will render using the following properties from the manif
131
131
> [!NOTE]
132
132
> Unlike with the Card view, there is no default Quick view.
133
133
134
-
### Register a view for hte ACE
134
+
### Register a view for the ACE
135
135
136
136
For a View to be used, it must be registered with its respective `ViewNavigator`.
137
137
@@ -184,7 +184,7 @@ Each of these Views will render differently and have different constraints on wh
184
184
> [!NOTE]
185
185
> The card views for Adaptive Card templates are fixed and cannot be changed.
186
186
187
-
Additionally there two generics for the `properties` and `state` objects shared between the view and the ACE.
187
+
Additionally, there are two generics for the `properties` and `state` objects shared between the view and the ACE.
188
188
189
189
-**TProperties**: The View's properties interface, the same interface used by persisted properties of the ACE (*property bag*).
190
190
-**TState**: The View's generic state interface, which must be the same as the ACE's state interface
@@ -260,10 +260,10 @@ Selecting the Card will now open the Quick view.
260
260
261
261
Locate and open the following file: **./src/adaptiveCardExtensions/helloWorld/quickView/QuickView.ts**.
262
262
263
-
Quick views must extend the **BaseAdaptiveCardView** base case. There are three optional generics that can be defined:
263
+
Quick views must extend the **BaseAdaptiveCardView** base class. There are three optional generics that can be defined:
264
264
265
265
-**TData**: The type returned from the `data()` getter method.
266
-
-**TProperties**: Similar to the Quick view, this is the same interface used by persisted properties of the ACE (*property bag*).
266
+
-**TProperties**: Similar to the Card view, this is the same interface used by persisted properties of the ACE (*property bag*).
267
267
-**TState** Similar to the Card view, this is the set of stateful data the View needs to render. **TState** must share properties with the ACE's state interface.
268
268
269
269
A Quick View has more control over the Adaptive Card template schema than a Card view. The
@@ -355,7 +355,9 @@ public get data(): IPrimaryTextCardParameters {
355
355
> [!NOTE]
356
356
> In its `template()` getter, the Quick view of the ACE you generated returns the object from a JSON file.
357
357
358
-
Locate and open the following file: **./src/adaptiveCardExtensions/helloWorld/quickView/template/QuickViewTemplate.json**. Replace the contents of this file with the following JSON:
358
+
Locate and open the following file: **./src/adaptiveCardExtensions/helloWorld/quickView/template/QuickViewTemplate.json**.
359
+
360
+
Replace the contents of this file with the following JSON:
359
361
360
362
```json
361
363
{
@@ -429,7 +431,7 @@ public onAction(action: IActionArguments): void {
429
431
}
430
432
```
431
433
432
-
Selecting on either button will now set the state's `subTitle` to the `data.message` value, causing a re-render (*more on this later*). The Quick view's Adaptive Card will now display this message, since its template binds to `subTitle`.
434
+
Selecting either button will now set the state's `subTitle` to the `data.message` value, causing a re-render (*more on this later*). The Quick view's Adaptive Card will now display this message, since its template binds to `subTitle`.
Passing `setState()`a `Partial<TState>` object will update all Views with the new values. Updating the **Description Field** in the Property Pane will now update the `subTitle` displayed on the Quick view.
502
+
Passing a `Partial<TState>` object to `setState()` method will update all Views with the new values. Updating the **Description Field** in the Property Pane will now update the `subTitle` displayed on the Quick view.
501
503
502
504
> [!NOTE]
503
505
> If no value or identical values are passed, a re-render will still occur.
@@ -519,8 +521,8 @@ public onInit(): Promise<void> {
519
521
520
522
Unlike with `properties`, `state` isn't persisted past the current session and should only be used for ephemeral View state.
521
523
522
-
> [!Note]
523
-
The scaffolded AdaptiveCardExtension maintains a `description` property in the `state` object. This is obsolete, since the AdaptiveCardExtension and all its views can simply reference the `description` stored in `properties`.
524
+
> [!NOTE]
525
+
> The scaffolded AdaptiveCardExtension maintains a `description` property in the `state` object. This is obsolete, since the AdaptiveCardExtension and all its views can simply reference the `description` stored in `properties`.
0 commit comments