Skip to content

Commit babee31

Browse files
authored
Update build-first-sharepoint-adaptive-card-extension.md
1 parent b38c282 commit babee31

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

docs/spfx/viva/get-started/build-first-sharepoint-adaptive-card-extension.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Build your first SharePoint Adaptive Card Extension
33
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: 07/27/2021
55
ms.prod: sharepoint
66
localization_priority: Priority
77
---
@@ -34,7 +34,7 @@ When prompted, enter the following values (*select the default option for all pr
3434

3535
When prompted by the generator for which ACE template to use, select **Primary Text Template** for this tutorial.
3636

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.
3838

3939
## Step 2 - Serve the ACE in the workbench
4040

@@ -49,7 +49,7 @@ The following arguments are used in the previous command:
4949
- `-l`: skips tests and `tslint` to make the inner loop faster
5050
- `--nobrowser`: skips trying to launch the `localhost` test page
5151

52-
Once local webserver is running, navigate to the hosted Workbench: `https://{tenant}.sharepoint.com/_layouts/15/workbench.aspx`
52+
Once local webserver is running, navigate to the hosted workbench: `https://{tenant}.sharepoint.com/_layouts/15/workbench.aspx`
5353

5454
Open the Web Part Toolbox and select your ACE:
5555

@@ -70,11 +70,11 @@ The second way an ACE can render is called the **Quick view**. When you interact
7070
> [!NOTE]
7171
> ACE interaction is disabled while in **Edit** mode. The Workbench or Page must be in *Preview* or *Read* mode to interact with the ACE.
7272
73-
Switch the Workbench to **Preview** mode.
73+
Switch the workbench to **Preview** mode.
7474

7575
:::image type="content" source="../../../images/viva-extensibility/lab1-preview.png" alt-text="Set the workbench to preview mode":::
7676

77-
Select on the **Quick View** button on the ACE:
77+
Select the **Quick View** button on the ACE:
7878

7979
:::image type="content" source="../../../images/viva-extensibility/lab1-hw-ql.png" alt-text="Select the Quick View button on the ACE":::
8080

@@ -104,7 +104,7 @@ protected renderCard(): string | undefined {
104104
}
105105
```
106106

107-
The `renderCard()` method is `virtual` that returns a string identifier to a registered View; more on View registration later. This method is invoked during the **initial** render of the Card view.
107+
The `renderCard()` method is `virtual` that returns a string identifier to a registered view; more on view registration later. This method is invoked during the **initial** render of the Card view.
108108

109109
If `renderCard()` isn't overridden, then a default Card view will be rendered.
110110

@@ -131,7 +131,7 @@ The default Card view, will render using the following properties from the manif
131131
> [!NOTE]
132132
> Unlike with the Card view, there is no default Quick view.
133133
134-
### Register a view for hte ACE
134+
### Register a view for the ACE
135135

136136
For a View to be used, it must be registered with its respective `ViewNavigator`.
137137

@@ -184,7 +184,7 @@ Each of these Views will render differently and have different constraints on wh
184184
> [!NOTE]
185185
> The card views for Adaptive Card templates are fixed and cannot be changed.
186186
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.
188188

189189
- **TProperties**: The View's properties interface, the same interface used by persisted properties of the ACE (*property bag*).
190190
- **TState**: The View's generic state interface, which must be the same as the ACE's state interface
@@ -256,14 +256,14 @@ public get onCardSelection(): IQuickViewCardAction | IExternalLinkCardAction | u
256256

257257
Selecting the Card will now open the Quick view.
258258

259-
### ACE Quick Views
259+
### Quick Views
260260

261261
Locate and open the following file: **./src/adaptiveCardExtensions/helloWorld/quickView/QuickView.ts**.
262262

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:
264264

265265
- **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*).
267267
- **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.
268268

269269
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 {
355355
> [!NOTE]
356356
> In its `template()` getter, the Quick view of the ACE you generated returns the object from a JSON file.
357357
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:
359361

360362
```json
361363
{
@@ -429,7 +431,7 @@ public onAction(action: IActionArguments): void {
429431
}
430432
```
431433

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`.
433435

434436
### Property Pane
435437

@@ -497,7 +499,7 @@ protected onPropertyPaneFieldChanged(propertyPath: string, oldValue: any, newVal
497499
}
498500
```
499501

500-
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.
501503

502504
> [!NOTE]
503505
> If no value or identical values are passed, a re-render will still occur.
@@ -519,8 +521,8 @@ public onInit(): Promise<void> {
519521

520522
Unlike with `properties`, `state` isn't persisted past the current session and should only be used for ephemeral View state.
521523

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`.
524526
525527
## Step 4 - Card designer
526528

0 commit comments

Comments
 (0)