Skip to content

chore: Typescript Cleanup- Part 2 for isSelected,Requirement,fixInstructionProcessor#7256

Merged
JeevaniChinthala merged 17 commits intomainfrom
users/v-jeevanic/TypeScriptFeature
Apr 9, 2024
Merged

chore: Typescript Cleanup- Part 2 for isSelected,Requirement,fixInstructionProcessor#7256
JeevaniChinthala merged 17 commits intomainfrom
users/v-jeevanic/TypeScriptFeature

Conversation

@JeevaniChinthala
Copy link
Copy Markdown
Contributor

@JeevaniChinthala JeevaniChinthala commented Mar 1, 2024

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'.
  • In AssessmentToggleActionPayload interface the methods enableFastPassVisualHelperWithoutScan and rescanVisualizationWithoutTelemetry uses the requirement property which was an optional property. To avoid null check error a new interface named RequirementToggleActionPayload was introduced, in which the requirement property is declared as either string or undefined.
  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

  • Addresses an existing issue: #(chore: Remove deprecated TypeScript options #6611)
  • Ran yarn fastpass
  • Added/updated relevant unit test(s) (and ran yarn test)
  • 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 JeevaniChinthala changed the title chore: Typescript Cleanup- Part 1 of 2 for isSelected,Requirement,data-automation-id,fixInstructionProcessor,getPropertyConfigById chore: Typescript Cleanup- Part 2 of 1 for isSelected,Requirement,data-automation-id,fixInstructionProcessor,getPropertyConfigById Mar 1, 2024
@JeevaniChinthala JeevaniChinthala changed the title chore: Typescript Cleanup- Part 2 of 1 for isSelected,Requirement,data-automation-id,fixInstructionProcessor,getPropertyConfigById chore: Typescript Cleanup- Part 2 of 1 for isSelected,Requirement,fixInstructionProcessor Mar 13, 2024
@v-viyada v-viyada changed the title chore: Typescript Cleanup- Part 2 of 1 for isSelected,Requirement,fixInstructionProcessor chore: Typescript Cleanup- Part 2 for isSelected,Requirement,fixInstructionProcessor Mar 18, 2024
@v-viyada v-viyada marked this pull request as ready for review April 3, 2024 19:26
@v-viyada v-viyada requested a review from a team as a code owner April 3, 2024 19:26
Copy link
Copy Markdown
Contributor

@madalynrose madalynrose left a comment

Choose a reason for hiding this comment

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

I have a couple of questions/suggestions before I approve.

@JeevaniChinthala JeevaniChinthala merged commit 6be8f21 into main Apr 9, 2024
@JeevaniChinthala JeevaniChinthala deleted the users/v-jeevanic/TypeScriptFeature branch May 23, 2024 05:03
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.

2 participants