microsoft / microsoft/AdaptiveCards

[JS] selectAction type should be changed to ISubmitAction | IOpenUrlAction | IShowCardAction

Open
#6,758 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Renderers
Dominant language
C#
Stars
2k
Forks
595
Avg merge
1d 19h
Merged PRs (30d)
1

Description

Target Platforms

NodeJS

SDK Version

2.9.0

Application Name

Microsoft Viva Connections

Problem Description

We have encountered an issue with the way selectAction is typed in the IContainer, IColumn, IImage interfaces.

It is typed as an IAction, which means that specifying a Submit action, or any other type of action fails to compile.

A solution is to change the typing to ISubmitAction | IOpenUrlAction | IShowCardAction

https://github.com/microsoft/AdaptiveCards/blob/cfc865da8e9dd6a84bbbb62baa7697954bc707a9/source/nodejs/adaptivecards/src/schema.ts#L170

Also, IAction should be changed to:

export interface IAction {
    id: string;
    title?: string;
    type: 'Action.Submit' | 'Action.OpenUrl' | 'Action.ShowCard'
}

Screenshots

No response

Card JSON
n/a
Sample Code Language

No response

Sample Code

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with source/nodejs/adaptivecards/src/schema.ts around line 170, where IAction and the selectAction properties on IContainer, IColumn, and IImage are defined. Compare the declared action types with the issue's proposed unions, then verify that valid Submit, OpenUrl, and ShowCard actions compile correctly in the NodeJS SDK.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.