aws-lex-web-ui icon indicating copy to clipboard operation
aws-lex-web-ui copied to clipboard

Response card subtitle not showing up

Open tuanis-ebrenes opened this issue 2 years ago • 2 comments

I think this is because the API response property is subtitle and from the Vue component you are getting the subTitle property.

https://github.com/aws-samples/aws-lex-web-ui/blob/v0.19.4/lex-web-ui/src/components/ResponseCard.vue#L8

tuanis-ebrenes avatar May 01 '22 01:05 tuanis-ebrenes

@tuanis-ebrenes Another Lex V2 breaking change. Lex V1 required "subTitle". https://docs.aws.amazon.com/lex/latest/dg/API_runtime_GenericAttachment.html. Lex V2 requires "subtitle" as you indicated. https://docs.aws.amazon.com/lexv2/latest/dg/API_runtime_ImageResponseCard.html.

Simplest change is in ResponseCard.vue. To support both V1 or V2 in the same code, change lines 8-10 to be

    <v-card-text v-if="responseCard.subTitle">
      <span>{{responseCard.subTitle}}</span>
    </v-card-text>
    <v-card-text v-if="responseCard.subtitle">
      <span>{{responseCard.subtitle}}</span>
    </v-card-text>

The other mechanism would be to change lex-web-ui/src/lib/lex/client.js such that it normalizes the response to match the V1 json. I've always disliked normalizing the V2 ImageResponseCard into a V1 GenericAttachment but rather than rewriting LexWebUi to support only V2 that was the decision made. LexWebUi does its best to allow operation with either LexV1 or LexV2. This is a case where LexWebUi didn't catch all the differences.

bobpskier avatar May 02 '22 14:05 bobpskier

@tuanis-ebrenes I submitted a pull request with a fix for this issue. Up to the AWS team to accept the pull request and merge into development and then release on master branch.

bobpskier avatar Jul 08 '22 21:07 bobpskier