diff --git a/src/background/actions/action-payloads.ts b/src/background/actions/action-payloads.ts index 2ca8c8c9869..186025f323d 100644 --- a/src/background/actions/action-payloads.ts +++ b/src/background/actions/action-payloads.ts @@ -90,7 +90,7 @@ export interface ChangeInstanceSelectionPayload extends AssessmentActionInstance } export interface UpdateSelectedDetailsViewPayload extends BaseActionPayload { - detailsViewType: VisualizationType; + detailsViewType: VisualizationType | null; pivotType: DetailsViewPivotType; } diff --git a/src/common/components/cards/instance-details.tsx b/src/common/components/cards/instance-details.tsx index 28589104577..9bc91ed1163 100644 --- a/src/common/components/cards/instance-details.tsx +++ b/src/common/components/cards/instance-details.tsx @@ -66,7 +66,7 @@ export const InstanceDetails = NamedFC('InstanceDetails', cardSelectionMessageCreator.toggleCardSelection(result.ruleId, result.uid, event); }; - const hiddenButton = React.useRef(null); + const hiddenButton = React.useRef(null); const cardHighlightingProperties = isHighlightSupported ? { onClick: (_: React.SyntheticEvent): void => { @@ -124,7 +124,7 @@ const renderCardRowsForPropertyBag = ( props: InstanceDetailsProps, ) => { let propertyIndex = 0; - const cardRows = []; + const cardRows: JSX.Element[] = []; forOwn(propertyBag, (propertyData, propertyName) => { const propertyConfig = props.deps.getPropertyConfigById(propertyName); if (!isEmpty(propertyConfig)) { diff --git a/src/common/components/cards/needs-review-instances-section.tsx b/src/common/components/cards/needs-review-instances-section.tsx index c215ec8eb04..c47a415786a 100644 --- a/src/common/components/cards/needs-review-instances-section.tsx +++ b/src/common/components/cards/needs-review-instances-section.tsx @@ -31,7 +31,6 @@ export const NeedsReviewInstancesSection = NamedFC( deps={deps} title="Instances to review" results={cardsViewData.cards.unknown} - containerClassName={null} outcomeType="review" badgeCount={count} userConfigurationStoreData={userConfigurationStoreData} diff --git a/src/common/components/cards/result-section.tsx b/src/common/components/cards/result-section.tsx index 98e8975b864..aa5de3e2f77 100644 --- a/src/common/components/cards/result-section.tsx +++ b/src/common/components/cards/result-section.tsx @@ -17,7 +17,7 @@ export type ResultSectionDeps = ResultSectionContentDeps; export type ResultSectionProps = Omit & Omit & { - containerClassName: string; + containerClassName?: string; deps: ResultSectionDeps; sectionHeadingLevel: HeadingLevel; }; diff --git a/src/common/components/cards/rules-with-instances.tsx b/src/common/components/cards/rules-with-instances.tsx index d559cb7a76c..3815c5a2cfb 100644 --- a/src/common/components/cards/rules-with-instances.tsx +++ b/src/common/components/cards/rules-with-instances.tsx @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -import { FixInstructionProcessor } from 'common/components/fix-instruction-processor'; import { CardSelectionMessageCreator } from 'common/message-creators/card-selection-message-creator'; import { NamedFC } from 'common/react/named-fc'; import * as React from 'react'; @@ -27,7 +26,6 @@ export type RulesWithInstancesDeps = RuleContentDeps & export type RulesWithInstancesProps = { deps: RulesWithInstancesDeps; - fixInstructionProcessor: FixInstructionProcessor; rules: CardRuleResult[]; outcomeType: InstanceOutcomeType; userConfigurationStoreData: UserConfigurationStoreData; @@ -44,7 +42,6 @@ export const RulesWithInstances = NamedFC( ({ rules, outcomeType, - fixInstructionProcessor, deps, userConfigurationStoreData, targetAppInfo, @@ -73,7 +70,6 @@ export const RulesWithInstances = NamedFC( key={`${rule.id}-rule-group`} deps={deps} rule={rule} - fixInstructionProcessor={fixInstructionProcessor} userConfigurationStoreData={userConfigurationStoreData} targetAppInfo={targetAppInfo} cardSelectionMessageCreator={cardSelectionMessageCreator} diff --git a/src/common/extension-telemetry-events.ts b/src/common/extension-telemetry-events.ts index ac512dbb88c..b61d5af6301 100644 --- a/src/common/extension-telemetry-events.ts +++ b/src/common/extension-telemetry-events.ts @@ -137,7 +137,7 @@ export type ExportFastPassResultsTelemetryData = { } & ExportResultsTelemetryData; export type DetailsViewOpenTelemetryData = { - selectedTest: string; + selectedTest: string | null; } & BaseTelemetryData; export type DetailsViewOpenedTelemetryData = { diff --git a/src/common/telemetry-data-factory.ts b/src/common/telemetry-data-factory.ts index 0a1d43f529b..e1091644d7a 100644 --- a/src/common/telemetry-data-factory.ts +++ b/src/common/telemetry-data-factory.ts @@ -204,12 +204,12 @@ export class TelemetryDataFactory { public forOpenDetailsView( event: SupportedMouseEvent, - visualizationType: VisualizationType, + visualizationType: VisualizationType | null, source: TelemetryEventSource, ): DetailsViewOpenTelemetryData { return { ...this.withTriggeredByAndSource(event, source), - selectedTest: VisualizationType[visualizationType], + selectedTest: visualizationType == null ? null : VisualizationType[visualizationType], }; } diff --git a/src/popup/actions/popup-action-message-creator.ts b/src/popup/actions/popup-action-message-creator.ts index 054f7223d3c..a4e007f009a 100644 --- a/src/popup/actions/popup-action-message-creator.ts +++ b/src/popup/actions/popup-action-message-creator.ts @@ -59,7 +59,7 @@ export class PopupActionMessageCreator { public openDetailsView( event: SupportedMouseEvent, - viewType: VisualizationType, + viewType: VisualizationType | null, source: TelemetryEventSource, pivotType: DetailsViewPivotType, ): void { diff --git a/src/tests/unit/tests/common/components/cards/__snapshots__/needs-review-instances-section.test.tsx.snap b/src/tests/unit/tests/common/components/cards/__snapshots__/needs-review-instances-section.test.tsx.snap index 482066229ce..09aa804c0b4 100644 --- a/src/tests/unit/tests/common/components/cards/__snapshots__/needs-review-instances-section.test.tsx.snap +++ b/src/tests/unit/tests/common/components/cards/__snapshots__/needs-review-instances-section.test.tsx.snap @@ -7,7 +7,6 @@ exports[`NeedsReviewInstancesSection renders null results 1`] = `null`; exports[`NeedsReviewInstancesSection renders with alerting off 1`] = ` { collapsibleControl: (props: CollapsibleComponentCardsProps) => ( ), + fixInstructionProcessor: fixInstructionProcessorMock.object, } as RulesWithInstancesDeps; const outcomeCounterStub = () => 5; const wrapped = shallow(