-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(null): strict null checks for assessment-provider and deps (#6274)
#### Details This PR adds `assessment-builder`, `assessment-provider`, and most individual assessment `test-steps` to the strict null check config. The only particularly interesting conversion was in `assessments-requirements-filter` - I ended up converting a pattern that used a mutating `filter` callback followed by a `map` to use a single `reduce` call to implement a `filterMap` pattern, so that typescript could see the relevant type information within the same scope instead of being split into several scopes. ```md ## Web strict-null progress **81%** complete (**1272**/1562 non-test files) *Contribute at [#2869](#2869). Last update: Fri Dec 16 2022* ``` ##### Motivation #2869 ##### Context n/a #### Pull request checklist <!-- If a checklist item is not applicable to this change, write "n/a" in the checkbox --> - [x] Addresses an existing issue: #2869 - [x] Ran `yarn null:autoadd` - [x] 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` - [x] 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
- Loading branch information
Showing
19 changed files
with
119 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 7 additions & 2 deletions
9
src/assessments/page/pagetitle-instance-details-column-renderer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
import { InstanceTableRow } from 'assessments/types/instance-table-data'; | ||
import { PageAssessmentProperties } from 'common/types/store-data/assessment-result-data'; | ||
import { AssessmentInstanceDetailsColumn } from 'DetailsView/components/assessment-instance-details-column'; | ||
import * as React from 'react'; | ||
|
||
export function pageTitleInstanceDetailsColumnRenderer(item: InstanceTableRow<any>): JSX.Element { | ||
export function pageTitleInstanceDetailsColumnRenderer( | ||
item: InstanceTableRow<PageAssessmentProperties>, | ||
): JSX.Element { | ||
const propertyBag = item.instance.propertyBag; | ||
const textContent = propertyBag ? propertyBag.pageTitle : null; | ||
// Undefined pageTitles shouldn't occur in practice; the browser will infer the title to be | ||
// the last URL path component rather than emitting an undefined page title | ||
const textContent = propertyBag?.pageTitle ?? ''; | ||
|
||
return <AssessmentInstanceDetailsColumn textContent={textContent} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.