accessibility-insights-web icon indicating copy to clipboard operation
accessibility-insights-web copied to clipboard

chore: Typescript Cleanup- Part 2 of 1 for isSelected,Requirement,fixInstructionProcessor

Open JeevaniChinthala opened this issue 1 year ago • 0 comments
trafficstars

Details

As part of Typescript migration added/removed the error causing fields.

Motivation

TypeScript 5.0 has marked some options as deprecated. We can temporarily override these deprecations, but the documented plan is for the ability to override the flag to go away in TypeScript 5.5

Context
  1. Requirement
  • Error: Type '{ test: VisualizationType; requirement: string; telemetry: AssessmentTelemetryData; }' is not assignable to type 'ToggleActionPayload'.
  • Object literal may only specify known properties, and 'requirement' does not exist in type 'ToggleActionPayload'.
  • Instead of ToggleActionPayload replaced AssessmentToggleActionPayload. In which requirement property is defined and it extends ToggleActionPayload.
  1. isSelected
  • Error: Type '{ isSelected: boolean; status: InstanceResultStatus; ruleId: string; uid: string; identifiers: { conciseName: string; identifier: string; 'css-selector': string; target: Target; }; descriptors: { ...; }; resolution: { ...; }; rule: { ...; }; }' is not assignable to type 'ScanNodeResult'.
  • Object literal may only specify known properties, and 'isSelected' does not exist in type 'ScanNodeResult'.
  • Added isSelected in ScanNodeResult in order to get required data.
  1. fixInstructionProcessor
  • Error: Type'{ deps: InstanceDetailsGroupDeps; fixInstructionProcessor: FixInstructionProcessor; recommendColor: RecommendColor; rule: CardRuleResult; userConfigurationStoreData: null; targetAppInfo: { ...; }; cardSelectionMessageCreator: CardSelectionMessageCreator; }' is not assignable to type 'InstanceDetailsGroupProps'.
  • Object literal may only specify known properties, and 'fixInstructionProcessor' does not exist in type 'InstanceDetailsGroupProps'.
  • Upon verifying in UI, fixInstructionProcessor is defined in 'deps' property. So, removed from code.

Pull request checklist

  • [x] Addresses an existing issue: #(https://github.com/microsoft/accessibility-insights-web/pull/6611)
  • [ ] Ran yarn fastpass
  • [x] Added/updated relevant unit test(s) (and ran yarn test)
  • [x] Verified code coverage for the changes made. Check coverage report at: <rootDir>/test-results/unit/coverage
  • [ ] PR title AND final merge commit title both start with a semantic tag (fix:, chore:, feat(feature-name):, refactor:). See CONTRIBUTING.md.
  • [ ] (UI changes only) Added screenshots/GIFs to description above
  • [ ] (UI changes only) Verified usability with NVDA/JAWS

JeevaniChinthala avatar Mar 01 '24 07:03 JeevaniChinthala