Skip to content

Unnecessary console.log on Image Card Element if "altText" is not provided. #128

@luislovera87

Description

@luislovera87

Target Application

React Native

Application Operating System

Other

Schema Version

1.4

Problem Description

A console.log on "adaptivecards-reactnative/src/components/elements/image.js" at line 277 to receive "altText" is always shown in the logs.

Expected Outcome

Remove the console.log to prevent unnecessary logs and performance issues.

Actual Outcome

a log on the terminal shown as "undefined" since "altText" is not provided on the payload for an Image component

Card JSON

{
    "id": "my-id",
    "communicationMode": "mobile",
    "body": [
        {
            "$data": "${data}",
            "columns": [
                {
                    "items": [
                        {
                            "size": "auto",
                            "style": "person",
                            "type": "Image",
                            "url": "${data.profilePicture}"
                        }
                    ],
                    "type": "Column",
                    "width": "50px"
                }
            ],
            "separator": "false",
            "type": "ColumnSet"
        }
    ],
    "schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.5",
    "width": "mobile"
}

Repro Steps

  1. Create an adaptive card with a Card Element of type "Image" and url "https://www.github.com".
  2. Do not provide "altText" since it's not a required value as per documentation [here].(https://adaptivecards.io/explorer/Image.html).
  3. See logs in terminal
  4. A "undefined" log is shown for each Card Element that is rendered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions