-
Notifications
You must be signed in to change notification settings - Fork 29
Update Adaptive Cards package #476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
corinagum
wants to merge
10
commits into
main
Choose a base branch
from
cg/ac-gen-versionfix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
14501da
Deprecate actions that now have generated replacements
5603f87
Remove manually created ITabInfo in favor of generated version
0f4d660
Updated CollabStageAction to use generated types
9a67818
Apply 3/18 generated core
88d314c
Lint
7e4cf1b
Lint
5a1b30a
Fixes
b34e453
Remove MsTeams
b782ca0
Lint
b16ad08
Update dialogs sample
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,117 +1,67 @@ | ||
| import { ITabInfo } from '../../common'; | ||
|
|
||
| import { ISubmitAction, SubmitAction, SubmitActionOptions } from '../../core'; | ||
|
|
||
| import { MSTeamsData } from './ms-teams-data'; | ||
| import { | ||
| CollabStageInvokeDataValue, | ||
| ICollabStageInvokeDataValue, | ||
| IInvokeSubmitActionData, | ||
| InvokeSubmitActionData, | ||
| ISubmitAction, | ||
| ISubmitActionData, | ||
| ITabInfo, | ||
| SubmitAction, | ||
| SubmitActionData, | ||
| SubmitActionOptions, | ||
| } from '../../core'; | ||
|
|
||
| export type CollabStageActionOptions = SubmitActionOptions & { | ||
| data: MSTeamsData<ICollabStageData>; | ||
| data: ISubmitActionData; | ||
| }; | ||
|
|
||
| /** | ||
| * Adaptive Card action response type for the {@link CollabStageAction} function. | ||
| */ | ||
| export interface ICollabStageAction extends ISubmitAction { | ||
| /** | ||
| * Initial data that input fields will be combined with. These are essentially ‘hidden’ properties. | ||
| * Initial data that input fields will be combined with. These are essentially 'hidden' properties. | ||
| */ | ||
| data: MSTeamsData<ICollabStageData>; | ||
| data: ISubmitActionData; | ||
| } | ||
|
|
||
| /** | ||
| * Adaptive Card action that opens a collab stage popout window. | ||
| */ | ||
| export class CollabStageAction extends SubmitAction implements ICollabStageAction { | ||
| /** | ||
| * Initial data that input fields will be combined with. These are essentially ‘hidden’ properties. | ||
| * Initial data that input fields will be combined with. These are essentially 'hidden' properties. | ||
| */ | ||
| data: MSTeamsData<ICollabStageData>; | ||
| data: ISubmitActionData; | ||
|
|
||
| constructor(tab?: ITabInfo, options: SubmitActionOptions = {}) { | ||
| super(options); | ||
| Object.assign(this, options); | ||
| this.data = { | ||
| msteams: { | ||
| type: 'invoke', | ||
| value: tab | ||
| ? { | ||
| type: 'tab/tabInfoAction', | ||
| tabInfo: tab, | ||
| } | ||
| this.data = new SubmitActionData({ | ||
| msteams: new InvokeSubmitActionData( | ||
| tab | ||
| ? new CollabStageInvokeDataValue({ tabInfo: tab }) | ||
| : undefined, | ||
| }, | ||
| }; | ||
| ), | ||
| }); | ||
| } | ||
|
|
||
| static from(options: CollabStageActionOptions) { | ||
| return new CollabStageAction(options.data.msteams.value?.tabInfo, options); | ||
| const msteams = options.data.msteams as IInvokeSubmitActionData | undefined; | ||
| const value = msteams?.value as ICollabStageInvokeDataValue | undefined; | ||
| return new CollabStageAction(value?.tabInfo, options); | ||
| } | ||
|
|
||
| withData(value: ICollabStageData) { | ||
| super.withData({ msteams: value }); | ||
| withData(value: IInvokeSubmitActionData) { | ||
| super.withData(new SubmitActionData({ msteams: value })); | ||
| return this; | ||
| } | ||
|
|
||
| withValue(value: ITabInfo) { | ||
| this.data.msteams.value = new CollabStageValueData(value); | ||
| const msteams = this.data.msteams as IInvokeSubmitActionData | undefined; | ||
| if (msteams) { | ||
| msteams.value = new CollabStageInvokeDataValue({ tabInfo: value }); | ||
| } | ||
| return this; | ||
| } | ||
| } | ||
|
|
||
corinagum marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| /** | ||
| * Contains the Adaptive Card action data in {@link CollabStageAction}. | ||
| */ | ||
| export interface ICollabStageData { | ||
| type: 'invoke'; | ||
|
|
||
| /** | ||
| * Set the value to send with the invoke | ||
| */ | ||
| value?: ICollabStageValueData; | ||
| } | ||
|
|
||
| /** | ||
| * Contains the Adaptive Card action data in {@link CollabStageAction}. | ||
| */ | ||
| export class CollabStageData implements ICollabStageData { | ||
| type: 'invoke'; | ||
|
|
||
| /** | ||
| * Set the value to send with the invoke | ||
| */ | ||
| value?: ICollabStageValueData; | ||
|
|
||
| constructor(value?: ICollabStageValueData) { | ||
| this.type = 'invoke'; | ||
| this.value = value; | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Contains the Adaptive Card action value data in {@link CollabStageActionData}. | ||
| */ | ||
| export interface ICollabStageValueData { | ||
| type: 'tab/tabInfoAction'; | ||
|
|
||
| /** | ||
| * Information about the iFrame content, rendered in the collab stage popout window. | ||
| */ | ||
| tabInfo: ITabInfo; | ||
| } | ||
|
|
||
| /** | ||
| * Contains the Adaptive Card action value data in {@link CollabStageActionData}. | ||
| */ | ||
| export class CollabStageValueData implements ICollabStageValueData { | ||
| type: 'tab/tabInfoAction'; | ||
|
|
||
| /** | ||
| * Information about the iFrame content, rendered in the collab stage popout window. | ||
| */ | ||
| tabInfo: ITabInfo; | ||
|
|
||
| constructor(tab: ITabInfo) { | ||
| this.type = 'tab/tabInfoAction'; | ||
| this.tabInfo = tab; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sigh, this is just really confusing. (not saying it's your fault -- but just to read this, is really really confusing.). I preferred it with this whole "msteams" stuff was abstracted away.
Right now, this is what I see:
I preferred it with TaskFetchSubmitActionData was would abstract most of this stuff away.... What do you think? We (I, if you don't want to), can push for a better devex here if there's some validation that this sort of sucks lol. To me it does, because all this msteams crap means nothing.