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: Typescript Cleanup- Part 5 for Errors - urls,cardsViewStoreData,storeActionMessageCreator,axeResultToIssueFilingDataConverter #7302

Merged
merged 22 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
32ef68a
Feature 2 Typescript pending issues
JeevaniChinthala Apr 10, 2024
18aae48
typescript changes for deps
JeevaniChinthala Apr 11, 2024
5fec1be
updated collapsible-url-result-section.tsx
JeevaniChinthala Apr 11, 2024
debae9e
changes for deps
JeevaniChinthala Apr 11, 2024
8a82033
updated testcase for deps
JeevaniChinthala Apr 11, 2024
16dad92
testcase lint issue
JeevaniChinthala Apr 11, 2024
d303d7a
onExpandToggle unittest issue
JeevaniChinthala Apr 11, 2024
aca2cd1
build issue
JeevaniChinthala Apr 11, 2024
31a66b6
Merge main branch
JeevaniChinthala Apr 12, 2024
b271cdf
Typescript changes for selectedIssueFilingServiceData,isMoveToAssessm…
JeevaniChinthala Apr 12, 2024
c1f7406
typescript changes for axeResultToIssueFilingDataConverter
JeevaniChinthala Apr 12, 2024
2aa9a61
typescript changes - getPropertyConfigById,data-automation-id
JeevaniChinthala Apr 15, 2024
a21d2fb
typescript changes - isLabelVisible,rel,value
JeevaniChinthala Apr 15, 2024
5a09660
islabelvisible snapshot update
JeevaniChinthala Apr 15, 2024
66a9faf
Revert "typescript changes - getPropertyConfigById,data-automation-id"
JeevaniChinthala Apr 16, 2024
75a9d38
testing e2e-report-test for getproperty,data-automation-id
JeevaniChinthala Apr 16, 2024
09f9828
reverting getPropertyConfigById changes
JeevaniChinthala Apr 16, 2024
9c793c4
typescript changes for tabbedElements
JeevaniChinthala Apr 17, 2024
95918b0
Revert "typescript changes for tabbedElements"
JeevaniChinthala Apr 17, 2024
6919342
tabbedElements new changes for typescript
JeevaniChinthala Apr 18, 2024
1e12aa6
Reverting AxeResultToIssueFilingDataConverter changes
JeevaniChinthala Apr 19, 2024
dbae7a1
PR Review-Fixes
JeevaniChinthala May 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/DetailsView/components/choice-group-pass-fail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export class ChoiceGroupPassFail extends React.Component<ChoiceGroupPassFailProp
onChange={this.props.onChange}
selectedKey={this.props.selectedKey}
options={this.props.options.map(this.makeOptions)}
isLabelVisible={this.props.isLabelVisible}
data-automation-id={this.props['data-automation-id']}
/>
<div className={styles.secondaryControlsWrapper}>
Expand Down
1 change: 0 additions & 1 deletion src/DetailsView/components/details-view-command-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ export class DetailsViewCommandBar extends React.Component<
isInvalidLoadAssessmentDialogOpen: false,
isLoadAssessmentDialogOpen: false,
isReportExportDialogOpen: false,
isMoveToAssessmentDialogOpen: false,
loadedAssessmentData: {} as VersionedAssessmentData,
startOverDialogState: 'none',
};
Expand Down
6 changes: 5 additions & 1 deletion src/DetailsView/components/issue-filing-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import * as React from 'react';
import { IssueFilingActionMessageCreator } from '../../common/message-creators/issue-filing-action-message-creator';
import { UserConfigMessageCreator } from '../../common/message-creators/user-config-message-creator';
import { CreateIssueDetailsTextData } from '../../common/types/create-issue-details-text-data';
import { IssueFilingServicePropertiesMap } from '../../common/types/store-data/user-configuration-store';
import {
IssueFilingServiceProperties,
IssueFilingServicePropertiesMap,
} from '../../common/types/store-data/user-configuration-store';
import {
IssueFilingSettingsContainer,
IssueFilingSettingsContainerDeps,
Expand All @@ -25,6 +28,7 @@ export interface IssueFilingDialogProps {
isOpen: boolean;
selectedIssueFilingService: IssueFilingService;
selectedIssueData?: CreateIssueDetailsTextData;
selectedIssueFilingServiceData: IssueFilingServiceProperties;
issueFilingServicePropertiesMap: IssueFilingServicePropertiesMap;
onClose: (ev?: React.SyntheticEvent) => void;
afterClosed?: () => void;
Expand Down
3 changes: 0 additions & 3 deletions src/DetailsView/components/save-assessment-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ export const SaveAssessmentButton = NamedFC<SaveAssessmentButtonProps>(
>
<Stack.Item grow disableShrink>
<Checkbox
value={
JeevaniChinthala marked this conversation as resolved.
Show resolved Hide resolved
!props.userConfigurationStoreData.showSaveAssessmentDialog
}
label="Don't show again"
onChange={handleDontShowAgainClick}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ export const ReportTabStopsInstanceSectionPropsFactory: TabStopsInstanceSectionP
content: (
<TabStopsReportInstanceList
key={`${result.id}-requirement-group`}
requirementId={result.id}
JeevaniChinthala marked this conversation as resolved.
Show resolved Hide resolved
instances={instances}
/>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ScanMetadata } from 'common/types/store-data/unified-data-interface';
import { NarrowModeStatus } from 'DetailsView/components/narrow-mode-detector';
import { CardsViewModel } from '../../types/store-data/card-view-model';
import { UserConfigurationStoreData } from '../../types/store-data/user-configuration-store';
import { CardsViewStoreData } from './cards-view-store-data';
import { ResultSectionDeps } from './result-section';

export type CommonInstancesSectionDeps = ResultSectionDeps;
Expand All @@ -18,4 +19,5 @@ export type CommonInstancesSectionProps = {
cardSelectionMessageCreator?: CardSelectionMessageCreator;
sectionHeadingLevel: HeadingLevel;
narrowModeStatus?: NarrowModeStatus;
cardsViewStoreData?: CardsViewStoreData;
};
2 changes: 1 addition & 1 deletion src/common/components/visualization-toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class VisualizationToggle extends React.Component<VisualizationToggleProp
componentRef: this.props.componentRef,
onBlur: this.props.onBlur,
onFocus: this.props.onFocus,
'data-automation-id': this.props['data-automation-id'],
...{ 'data-automation-id': this.props['data-automation-id'] },
};
JeevaniChinthala marked this conversation as resolved.
Show resolved Hide resolved

return <Toggle {...props} />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const AllPropertyTypes = [
'className',
'contentDescription',
'text',
'urls',
'relatedCssSelectors',
] as const;
export type PropertyType = (typeof AllPropertyTypes)[number];
Expand Down
4 changes: 4 additions & 0 deletions src/injected/analyzers/analyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export interface ScanUpdatePayload extends ScanBasePayload {
results: TabStopEvent[];
}

export interface TabStopScanUpdatePayload extends ScanUpdatePayload {
tabbedElements: TabStopEvent[];
}

export interface ScanBasePayload extends BaseActionPayload {
testType: VisualizationType;
key: string;
Expand Down
4 changes: 2 additions & 2 deletions src/injected/analyzers/tab-stops-analyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { TabStopsDoneAnalyzingTracker } from 'injected/analyzers/tab-stops-done-
import { TabStopsRequirementResultProcessor } from 'injected/analyzers/tab-stops-requirement-result-processor';
import { ScanIncompleteWarningDetector } from 'injected/scan-incomplete-warning-detector';
import { debounce, DebouncedFunc } from 'lodash';
import { FocusAnalyzerConfiguration, ScanBasePayload, ScanUpdatePayload } from './analyzer';
import { FocusAnalyzerConfiguration, ScanBasePayload, TabStopScanUpdatePayload } from './analyzer';

export interface ProgressResult<T> {
result: T;
Expand Down Expand Up @@ -55,7 +55,7 @@ export class TabStopsAnalyzer extends BaseAnalyzer {
const results = this.pendingTabbedElements;
this.pendingTabbedElements = [];

const payload: ScanUpdatePayload = {
const payload: TabStopScanUpdatePayload = {
key: this.config.key,
testType: this.config.testType,
tabbedElements: results,
Expand Down
3 changes: 0 additions & 3 deletions src/packages/accessibility-insights-ui/ui-factory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ export const contentViewFactory = ({ applicationTitle, getNarrowModeThresholds }
textContent: {
applicationTitle,
},
storeActionMessageCreator: {
getAllStates: nullCreator,
},
storesHub: nullStoresHub,
getNarrowModeThresholds,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class CodePenExportForm extends React.Component<ReportExportFormProps> {
action="https://codepen.io/pen/define"
method="POST"
target="_blank"
rel="noopener"
style={{ visibility: 'hidden' }}
>
<input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export const CollapsibleResultSection = NamedFC<CollapsibleResultSectionProps>(
header: <ResultSectionTitle {...props} titleSize="title" />,
content: <RulesOnly {...props} />,
headingLevel: props.headingLevel,
deps: null,
testKey,
onExpandToggle: (event: React.MouseEvent<HTMLDivElement>) => {
cardSelectionMessageCreator?.toggleRuleExpandCollapse(containerId, event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const CollapsibleUrlResultSection = NamedFC<CollapsibleUrlResultSectionPr
header: <ResultSectionTitle {...props} titleSize="heading" />,
content,
headingLevel: 3,
onExpandToggle: (event: React.MouseEvent<HTMLDivElement>) => {},
});

return <div className={styles.urlResultSection}>{CollapsibleContent}</div>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface ReportCollapsibleContainerProps {
containerClassName?: string;
buttonAriaLabel?: string;
testKey?: string;
onExpandToggle: (event: React.MouseEvent<HTMLDivElement>) => void;
JeevaniChinthala marked this conversation as resolved.
Show resolved Hide resolved
}

const ReportCollapsibleContainer = NamedFC<ReportCollapsibleContainerProps>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ exports[`ChoiceGroupPassFail render 1`] = `
class="choiceGroupContainer"
>
<mock-styledchoicegroup
islabelvisible="false"
options="[object Object],[object Object],[object Object]"
selectedkey="unknown"
styles="[object Object]"
Expand All @@ -29,7 +28,6 @@ exports[`ChoiceGroupPassFail render: selectedKey is set to FAIL 1`] = `
class="choiceGroupContainer"
>
<mock-styledchoicegroup
islabelvisible="false"
options="[object Object],[object Object],[object Object]"
selectedkey="fail"
styles="[object Object]"
Expand Down Expand Up @@ -64,7 +62,6 @@ exports[`ChoiceGroupPassFail render: selectedKey is set to FAIL: StyledChoiceGro
{
"componentRef": [Function],
"data-automation-id": undefined,
"isLabelVisible": false,
"onChange": [Function],
"options": [
{
Expand Down Expand Up @@ -111,7 +108,6 @@ exports[`ChoiceGroupPassFail render: selectedKey is set to PASS 1`] = `
class="choiceGroupContainer"
>
<mock-styledchoicegroup
islabelvisible="false"
options="[object Object],[object Object],[object Object]"
selectedkey="pass"
styles="[object Object]"
Expand Down Expand Up @@ -146,7 +142,6 @@ exports[`ChoiceGroupPassFail render: selectedKey is set to PASS: StyledChoiceGro
{
"componentRef": [Function],
"data-automation-id": undefined,
"isLabelVisible": false,
"onChange": [Function],
"options": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ exports[`SaveAssessmentButton on dialog enabled render snapshot of dialog 1`] =
>
<mock-styledcheckboxbase
label="Don't show again"
value="false"
/>
</mock-stackitem>
<mock-stackitem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import { IMock, It, Mock, MockBehavior, Times } from 'typemoq';
import { IssueFilingActionMessageCreator } from '../../../../../common/message-creators/issue-filing-action-message-creator';
import { UserConfigMessageCreator } from '../../../../../common/message-creators/user-config-message-creator';
import { CreateIssueDetailsTextData } from '../../../../../common/types/create-issue-details-text-data';
import { IssueFilingServicePropertiesMap } from '../../../../../common/types/store-data/user-configuration-store';
import {
IssueFilingServiceProperties,
IssueFilingServicePropertiesMap,
} from '../../../../../common/types/store-data/user-configuration-store';
import { ActionAndCancelButtonsComponent } from '../../../../../DetailsView/components/action-and-cancel-buttons-component';
import {
IssueFilingDialog,
Expand Down Expand Up @@ -93,12 +96,16 @@ describe('IssueFilingDialog', () => {
getSettingsFromStoreData: getSettingsFromStoreDataMock.object,
key: serviceKey,
} as IssueFilingService;
const selectedIssueFilingServiceData: IssueFilingServiceProperties = {
repository: 'none',
};
props = {
deps,
isOpen: true,
onClose: onCloseMock.object,
selectedIssueFilingService: issueFilingServiceStub,
selectedIssueData: selectedIssueDataStub,
selectedIssueFilingServiceData,
issueFilingServicePropertiesMap: issueFilingServicePropertiesMapStub,
afterClosed: () => null,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ exports[`TabStopsChoiceGroup render with fail status 1`] = `
>
<mock-styledchoicegroup
data-automation-id="tabStopsPassFailChoiceGroup"
islabelvisible="false"
options="[object Object],[object Object]"
selectedkey="fail"
styles="[object Object]"
Expand Down Expand Up @@ -43,7 +42,6 @@ exports[`TabStopsChoiceGroup render with fail status: StyledChoiceGroup props 1`
{
"componentRef": [Function],
"data-automation-id": "tabStopsPassFailChoiceGroup",
"isLabelVisible": false,
"onChange": [Function],
"options": [
{
Expand Down Expand Up @@ -81,7 +79,6 @@ exports[`TabStopsChoiceGroup render with pass status 1`] = `
>
<mock-styledchoicegroup
data-automation-id="tabStopsPassFailChoiceGroup"
islabelvisible="false"
options="[object Object],[object Object]"
selectedkey="pass"
styles="[object Object]"
Expand All @@ -102,7 +99,6 @@ exports[`TabStopsChoiceGroup render with pass status: StyledChoiceGroup props 1`
{
"componentRef": [Function],
"data-automation-id": "tabStopsPassFailChoiceGroup",
"isLabelVisible": false,
"onChange": [Function],
"options": [
{
Expand Down Expand Up @@ -140,7 +136,6 @@ exports[`TabStopsChoiceGroup render with unknown status 1`] = `
>
<mock-styledchoicegroup
data-automation-id="tabStopsPassFailChoiceGroup"
islabelvisible="false"
options="[object Object],[object Object]"
selectedkey="unknown"
styles="[object Object]"
Expand All @@ -156,7 +151,6 @@ exports[`TabStopsChoiceGroup render with unknown status: StyledChoiceGroup props
{
"componentRef": [Function],
"data-automation-id": "tabStopsPassFailChoiceGroup",
"isLabelVisible": false,
"onChange": [Function],
"options": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ exports[`TabStopsInstanceSectionPropsFactory for Report creates props as expecte
},
]
}
requirementId="keyboard-navigation"
/>,
"deps": {
"tabStopRequirementActionMessageCreator": [typemoq mock object],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ exports[`UIFactory exports ContentView: Content props 1`] = `
"children": "CONTENTS",
"deps": {
"getNarrowModeThresholds": [Function],
"storeActionMessageCreator": {
"getAllStates": [Function],
},
"storesHub": {
"addChangedListenerToAllStores": [Function],
"getAllStoreData": [Function],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ exports[`CodePenReportExportService exportForm renders 1`] = `
<form
action="https://codepen.io/pen/define"
method="POST"
rel="noopener"
style="visibility: hidden;"
target="_blank"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { render } from '@testing-library/react';
import { forOwn } from 'lodash';
import * as React from 'react';
import { Mock } from 'typemoq';

import { HeadingElementForLevel } from '../../../../../../common/components/heading-element-for-level';
import {
Expand All @@ -20,7 +21,7 @@ describe('ReportCollapsibleContainerControl', () => {
buttonAriaLabel: [undefined, 'some button label'],
id: [undefined, 'some id'],
};

const onExpandToggleMock = Mock.ofType<(event: React.MouseEvent<HTMLDivElement>) => void>();
forOwn(optionalPropertiesObject, (propertyValues, propertyName) => {
propertyValues.forEach(value => {
test(`render with ${propertyName} set to: ${value}`, () => {
Expand All @@ -30,6 +31,7 @@ describe('ReportCollapsibleContainerControl', () => {
content: <div>Some content</div>,
headingLevel: 5,
[propertyName]: value,
onExpandToggle: onExpandToggleMock.object,
};
const control = ReportCollapsibleContainerControl(props);
const renderResult = render(control);
Expand Down
Loading