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

Fix typing for usePerformCardAction hook #3969

Merged

Conversation

compulim
Copy link
Contributor

@compulim compulim commented Jun 29, 2021

Fixes #3968

Changelog Entry

Fixes

Description

The typing for usePerformCardAction is wrong.

We didn't catch this because we didn't not have any TypeScript code that use this hook yet. The one we have is JavaScript-in-TS, which do not type check the usePerformCardAction hook.

Design

Specific Changes

  • Fix the typing of usePerformCardAction
  • Fully type out DirectLineCardAction.ts
  • Convert the React component in AdaptiveCardRenderer.tsx to TypeScript (type out the props, so tapAction is of type DirectLineCardAction)
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

Copy link
Member

@cwhitten cwhitten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, but CI is failing

@compulim compulim force-pushed the fix-3968-typing-use-perform-card-action branch from 0cfb9e6 to fbbf357 Compare August 27, 2021 05:11
@compulim compulim force-pushed the fix-3968-typing-use-perform-card-action branch from fbbf357 to 08a068d Compare August 27, 2021 05:12
@compulim
Copy link
Contributor Author

compulim commented Aug 27, 2021

Fixed some ESLint errors:

  • Running Prettier again on a file: useless parenthesis
  • Adding eslint-disable-next-line @typescript-eslint/no-explicit-any to some of our typing placeholder, e.g. DirectLineActivity.ts, which is a placeholder file until we fully typed it out (Typing for Direct Line objects #3953)

@compulim compulim merged commit 99625f4 into microsoft:main Aug 30, 2021
@compulim compulim deleted the fix-3968-typing-use-perform-card-action branch August 30, 2021 22:35
@compulim compulim mentioned this pull request Sep 2, 2021
11 tasks
compulim added a commit to compulim/BotFramework-WebChat that referenced this pull request Sep 9, 2021
* Fix typing for usePerformCardAction

* Update entry

* Fix ESLint
compulim added a commit to compulim/BotFramework-WebChat that referenced this pull request Sep 9, 2021
* Fix typing for usePerformCardAction

* Update entry

* Fix ESLint
compulim added a commit to compulim/BotFramework-WebChat that referenced this pull request Sep 22, 2021
* Fix typing for usePerformCardAction

* Update entry

* Fix ESLint
compulim added a commit that referenced this pull request Sep 22, 2021
…ocus indicators (#4035)

* Set default active descendant

* Update to TypeScript

* Add JSDoc

* Update entry

* Fix and clean up on focus activity

* Add capability detection

* Clean up

* Clean up

* Fix test

* Fix tests

* Fix tests

* Fix tests

* Clean up

* Fix tests

* Fix tests

* Fix tests

* Fix test

* Add tests

* Clean up

* Fix typing for `usePerformCardAction` hook (#3969)

* Fix typing for usePerformCardAction

* Update entry

* Fix ESLint

* Fix ESLint

* Clean up

* Clean up

* Add new focus indicator for suggested actions

* Styling send box button with accessibility

* Clean up

* Add snapshots

* Add entries

* Typo

* Fix color

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Improve test reliability

* Improve test reliability: wait for render

* Fix test reliability

* Improve test reliability

* Improve test reliability

* Fix typings

* Fix focusedActivityKey after merge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typing of usePerformCardAction() hook is wrong
2 participants