Skip to content

Commit 4fb32e1

Browse files
committed
Fix for the request change
1 parent cbd7366 commit 4fb32e1

File tree

11 files changed

+1183
-998
lines changed

11 files changed

+1183
-998
lines changed

docs/documentation/docs/controls/AdaptiveCardHost.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ All Elements and Actions of Adaptive Cards have been redefined using Fluent UI R
1414
Thanks to the "context" property that allows you to pass the SPFx context, whether the "data" property is passed or not, a new field called @context will be injected into the data object.
1515

1616
This allows, using Adaptive Cards templating syntax, to access to the context informations using the following fields (for more information on these fields, refer to the [BaseComponentContext](https://docs.microsoft.com/en-us/javascript/api/sp-component-base/basecomponentcontext) class):
17-
- "aadInfo": property "aadInfo" of the SPFx context object.
18-
- "cultureInfo": "cultureInfo" property of the SPFx context object.
19-
- "legacyPageContext": "legacyPageContext" property of the SPFx context object.
20-
- "list": property "list" of the SPFx context object.
21-
- "listItem": property "listItem" of the SPFx context object.
22-
- "site": property "site" of the SPFx context object.
23-
- "user": "user" property of the SPFx context object.
24-
- "web": "web" property of the SPFx context object.
2517
- "theme": property "theme" from the current theme applied to the card.
18+
- "aadInfo": Azure AD informations retrieved from the SPFx context object.
19+
- "cultureInfo": Culture informations retrieved from the SPFx context object.
20+
- "userInfo": User informations retrieved from the SPFx context object.
21+
- "spListInfo": Current List informations retrieved from the SPFx context object.
22+
- "spListItemInfo": Current List item informations retrieved from the SPFx context object.
23+
- "spSiteInfo": Current Site informations retrieved from the SPFx context object.
24+
- "spWebInfo": Current Web informations retrieved from the SPFx context object.
25+
- "spPartialLegacyContext": Subset of the "legacyPageContext" property retrieved from the SPFx context object.
2626

2727
The Adaptive Cards version supported is 1.5, by using the 'adaptivecards' npm package version 2.10.0.
2828

src/controls/adaptiveCardHost/AdaptiveCardHost.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
useRef
1313
} from 'react';
1414
import './AdaptiveCardHost.css';
15-
import { convertFromPartialThemeToTheme, createDarkTeamsHostConfig, createDefaultTeamsHostConfig, createHighContrastTeamsHostConfig, createSharePointHostConfig, initProcessMarkdown, injectContextProperty, setFluentUIThemeAsCSSVariables } from './AdaptiveCardHostHelpers';
15+
import { convertFromPartialThemeToTheme, createDarkTeamsHostConfig, createDefaultTeamsHostConfig, createHighContrastTeamsHostConfig, createSharePointHostConfig, initProcessMarkdown, addSPFxContextDataToDataObject, setFluentUIThemeAsCSSVariables } from './AdaptiveCardHostHelpers';
1616
import { createDarkTeamsTheme, createDefaultTeamsTheme, createHighContrastTeamsTheme, getDefaultFluentUITheme, setFluentUIThemeAsHostCapability, useLocalFluentUI } from './fluentUI';
1717
import { AdaptiveCardHostThemeType, IAdaptiveCardHostActionResult, IAdaptiveCardHostProps } from './IAdaptiveCardHostProps';
1818

@@ -202,7 +202,7 @@ export const AdaptiveCardHost = (props: IAdaptiveCardHostProps) => {
202202
let currentAdaptiveCard = adaptiveCardInstanceRef.current;
203203
try {
204204
let template = new Template(props.card);
205-
let evaluationContext = injectContextProperty(props.data, fluentUIThemeInstanceRef.current, props.context);
205+
let evaluationContext = addSPFxContextDataToDataObject(props.data, fluentUIThemeInstanceRef.current, props.context);
206206
let cardPayload = template.expand(evaluationContext);
207207

208208
currentAdaptiveCard.parse(cardPayload, serializationContextInstanceRef.current);

0 commit comments

Comments
 (0)