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

chore(null): null checks for web-visualization-config-factory and deps #6279

Merged
merged 4 commits into from
Dec 20, 2022

Conversation

dbjorge
Copy link
Contributor

@dbjorge dbjorge commented Dec 19, 2022

Details

This PR adds just a single file to the strict null check list (src/common/configs/web-visualization-configuration-factory.ts), but I've given it its own PR since one of the changes touched a lot of files. Specifically, the factory involved initializing as null several visualization fields that were present in the VisualizationConfiguration type but never used except by ad-hoc checks.

In one case, there was a pattern that I thought was a bit misleading where a bag of UI strings called displayableData contained a mix of properties which all visualizations were expected to provide (title) vs some which only ad-hoc visualizations were expected to provide (several properties used to store the labels/etc on the ad hoc popup panel). I separated these so the ad-hoc specific ones were under a new adHoc grouping and included a comment on the grouping that clarified when this could be expected to be null or not. This involved touching all the files which use these properties.

This isn't quite as good as using separate typings for the ad-hoc vs non-ad-hoc options to make the type system enforce that comment, but I felt it was a reasonable middle ground for how much existing code to re-write in order to make this change.

Motivation

#2869

Context

n/a

Pull request checklist

  • Addresses an existing issue: Codebase should use strict null checks #2869
  • Ran yarn null:autoadd
  • 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.
  • [n/a] (UI changes only) Added screenshots/GIFs to description above
  • [n/a] (UI changes only) Verified usability with NVDA/JAWS

@dbjorge dbjorge requested a review from a team as a code owner December 19, 2022 17:51
Copy link
Member

@sfoslund sfoslund left a comment

Choose a reason for hiding this comment

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

LGTM!

@dbjorge dbjorge merged commit d6eff3a into microsoft:main Dec 20, 2022
@dbjorge dbjorge deleted the null-20221219 branch December 20, 2022 18:34
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