Skip to content
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

Cannot add an ActionSet to a Column #35

Closed
filipvh opened this issue Dec 8, 2024 · 3 comments · Fixed by #36
Closed

Cannot add an ActionSet to a Column #35

filipvh opened this issue Dec 8, 2024 · 3 comments · Fixed by #36
Labels
bug Something isn't working

Comments

@filipvh
Copy link

filipvh commented Dec 8, 2024

It seems I cannot add an ActionSet to a Column,
whil this seems to work in other software and is included in examples on adaptivecards.io
example: https://adaptivecards.io/samples/ExpenseReport.html

kr

@dennis6p
Copy link
Owner

dennis6p commented Dec 8, 2024

Hey @filipvh,

thanks for opening this issue. Can you please provide the code which leads to an error?
What specific layout do you want to build up?

Thanks!

EDIT: By ".. I cannot add" you mean, that technically it is possible and the code runs through successfully but the type hint system is yelling at you, right? I just figured, ContainerTypes have to be added as one of the allowed types for the item property of Column. It will be addressed in #36. Maybe you can shortly confirm my assumption.

@filipvh
Copy link
Author

filipvh commented Dec 8, 2024

Sorry, good point, it's a type hint issue.

example

    topic_action: ActionOpenUrl = ActionOpenUrl(
        title="GOTO",
        url=data.url
    )
    topic_action_set: ActionSet = ActionSet(
        actions=[topic_action]
    )
    topic_action_column: Column = Column(
        items=[topic_action_set],
        width="auto"
    )

Expected type 'list[Image | TextBlock | Media | CaptionSource | RichTextBlock] | None', got 'list[ActionSet]' instead

The code runs fine.
So, nothing critical, but would be nice if this/these case(s) would not give type hint warning.

kr

@dennis6p dennis6p added the bug Something isn't working label Dec 8, 2024
@dennis6p
Copy link
Owner

dennis6p commented Dec 8, 2024

Yes, I fully agree. Should be adapted and will be fixed in the PR I mentioned in my last comment. Hopefully, all other parts are working fine for you. Let me know, if you face other issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants