Skip to content

Commit

Permalink
Passed AdaptiveCardsHostConfig as a prop to CommonCard (#2108)
Browse files Browse the repository at this point in the history
* Passed the AdaptiveCardsHostConfig as a prop to CommonCard

* Sorted properties alphabetically
  • Loading branch information
tdurnford authored and corinagum committed Jun 23, 2019
1 parent a43411f commit f1f5185
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -59,6 +59,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fix [#1627](https://github.com/Microsoft/BotFramework-WebChat/issues/1627). Fixed timestamps randomly stopped from updating, by [@compulim](https://github.com/compulim) in PR [#2090](https://github.com/Microsoft/BotFramework-WebChat/pull/2090)
- Fix [#2001](https://github.com/Microsoft/BotFramework-WebChat/issues/2001). Strip Markdown from ARIA labels, so screen readers do not speak Markdown in text, by [@corinagum](https://github.com/corinagum) in PR [#2096](https://github.com/Microsoft/BotFramework-WebChat/pull/2096)
- Fix [#1926](https://github.com/microsoft/BotFramework-WebChat/issues/1926). Fixed scroll stickiness issue when submitting an Adaptive Card form with suggested actions opened, by [@compulim](https://github.com/compulim) in PR [#2107](https://github.com/microsoft/BotFramework-WebChat/pull/2107)
- Fix [#2106](https://github.com/Microsoft/BotFramework-WebChat/issues/2016). Fix AdaptiveCardHostConfig warning associated with the CommonCard component, by [@tdurnford](https://github.com/tdurnford) in PR [#2108](https://github.com/Microsoft/BotFramework-WebChat/pull/2108)

### Samples

Expand Down
Expand Up @@ -26,7 +26,13 @@ class AnimationCardAttachment extends React.Component {
}

render() {
const { adaptiveCards, attachment, attachment: { content: { media = [] } = {} } = {}, styleSet } = this.props;
const {
adaptiveCardHostConfig,
adaptiveCards,
attachment,
attachment: { content: { media = [] } = {} } = {},
styleSet
} = this.props;

return (
<div className={styleSet.animationCardAttachment}>
Expand All @@ -41,13 +47,18 @@ class AnimationCardAttachment extends React.Component {
</li>
))}
</ul>
<CommonCard adaptiveCards={adaptiveCards} attachment={attachment} />
<CommonCard
adaptiveCardHostConfig={adaptiveCardHostConfig}
adaptiveCards={adaptiveCards}
attachment={attachment}
/>
</div>
);
}
}

AnimationCardAttachment.propTypes = {
adaptiveCardHostConfig: PropTypes.any.isRequired,
adaptiveCards: PropTypes.any.isRequired,
attachment: PropTypes.shape({
content: PropTypes.shape({
Expand Down
Expand Up @@ -9,9 +9,12 @@ import CommonCard from './CommonCard';
const { AudioContent } = Components;

const AudioCardAttachment = ({
adaptiveCardHostConfig,
adaptiveCards,
attachment,
attachment: { content: { autostart = false, autoloop = false, image: { url: imageURL = '' }, media = [] } = {} } = {},
attachment: {
content: { autostart = false, autoloop = false, image: { url: imageURL = '' } = {}, media = [] } = {}
} = {},
styleSet
}) => (
<div className={styleSet.audioCardAttachment}>
Expand All @@ -22,11 +25,12 @@ const AudioCardAttachment = ({
</li>
))}
</ul>
<CommonCard adaptiveCards={adaptiveCards} attachment={attachment} />
<CommonCard adaptiveCardHostConfig={adaptiveCardHostConfig} adaptiveCards={adaptiveCards} attachment={attachment} />
</div>
);

AudioCardAttachment.propTypes = {
adaptiveCardHostConfig: PropTypes.any.isRequired,
adaptiveCards: PropTypes.any.isRequired,
attachment: PropTypes.shape({
content: PropTypes.shape({
Expand Down
Expand Up @@ -4,13 +4,14 @@ import React from 'react';

import CommonCard from './CommonCard';

const SignInCardAttachment = ({ adaptiveCards, attachment, styleSet }) => (
const SignInCardAttachment = ({ adaptiveCardHostConfig, adaptiveCards, attachment, styleSet }) => (
<div className={styleSet.animationCardAttachment}>
<CommonCard adaptiveCards={adaptiveCards} attachment={attachment} />
<CommonCard adaptiveCardHostConfig={adaptiveCardHostConfig} adaptiveCards={adaptiveCards} attachment={attachment} />
</div>
);

SignInCardAttachment.propTypes = {
adaptiveCardHostConfig: PropTypes.any.isRequired,
adaptiveCards: PropTypes.any.isRequired,
attachment: PropTypes.any.isRequired,
styleSet: PropTypes.shape({
Expand Down
Expand Up @@ -9,6 +9,7 @@ import CommonCard from './CommonCard';
const { VideoContent } = Components;

const VideoCardAttachment = ({
adaptiveCardHostConfig,
adaptiveCards,
attachment,
attachment: { content: { media, autostart, autoloop, image: { url: imageURL } = {} } = {} } = {},
Expand All @@ -22,11 +23,12 @@ const VideoCardAttachment = ({
</li>
))}
</ul>
<CommonCard adaptiveCards={adaptiveCards} attachment={attachment} />
<CommonCard adaptiveCardHostConfig={adaptiveCardHostConfig} adaptiveCards={adaptiveCards} attachment={attachment} />
</div>
);

VideoCardAttachment.propTypes = {
adaptiveCardHostConfig: PropTypes.any.isRequired,
adaptiveCards: PropTypes.any.isRequired,
attachment: PropTypes.shape({
content: PropTypes.shape({
Expand Down

0 comments on commit f1f5185

Please sign in to comment.