[ Big Sur ] Operating System
[ 12.13.0 ] Node version
[ CLI version: 2.3.0 ]
[ Local version: 4.0.2 ] Gulp version
[ @microsoft/generator-sharepoint@1.13.0-beta.5 ] SPFx Generator version
Expected or Desired Behavior
I shouldn't be able to render my own CardView utilizing Adaptive Card Templates
Observed Behavior
If you provide the correct methods, you can actually render a CardView with an adaptive card template.
Steps to Reproduce
import { ISPFxAdaptiveCard, BaseAdaptiveCardView } from '@microsoft/sp-adaptive-card-extension-base';
import * as strings from 'HelloWorldAdaptiveCardExtensionStrings';
import { IHelloWorldAdaptiveCardExtensionProps, IHelloWorldAdaptiveCardExtensionState } from '../HelloWorldAdaptiveCardExtension';
export interface IQuickViewData {
subTitle: string;
title: string;
description: string;
}
export class QuickView extends BaseAdaptiveCardView<
IHelloWorldAdaptiveCardExtensionProps,
IHelloWorldAdaptiveCardExtensionState,
IQuickViewData
> {
public get data(): IQuickViewData {
return {
subTitle: strings.SubTitle,
title: strings.Title,
description: this.state.description
};
}
public cardButtons;
public onCardSelection;
public get template(): ISPFxAdaptiveCard {
return require('./template/QuickViewTemplate.json');
}
}
Now you can register it as a cardview
public onInit(): Promise<void> {
this.state = {
description: this.properties.description
};
this.cardNavigator.register(CARD_VIEW_REGISTRY_ID, () => new QuickView());
return Promise.resolve();
}
Versions
[ Big Sur ] Operating System [ 12.13.0 ] Node version [ CLI version: 2.3.0 ] [ Local version: 4.0.2 ] Gulp version [ @microsoft/generator-sharepoint@1.13.0-beta.5 ] SPFx Generator version
Expected or Desired Behavior
I shouldn't be able to render my own CardView utilizing Adaptive Card Templates
Observed Behavior
If you provide the correct methods, you can actually render a CardView with an adaptive card template.
Steps to Reproduce
Now you can register it as a cardview