Skip to content

Commit 8586158

Browse files
authored
feat(download-json-report): Don't clear export description on dropdown open (#4788)
#### Details Currently, opening the export dropdown clears the user's description in the export dialog. If they then download an export, the description will be there. If they don't download at that moment, the description is lost. This PR updates the behavior to be in line with current production behavior wherein the user's description is not cleared until they start a new assessment. Before: ![before](https://user-images.githubusercontent.com/4615491/136467890-f2c9e62a-253c-4d17-ba18-4bcb880645a7.gif) After: ![after](https://user-images.githubusercontent.com/4615491/136467899-12d99191-711b-4953-89b4-6405b19e6964.gif) ##### Motivation Fixes unwanted behavior ##### Context I considered clearing the description on dialog close, but that would not line up with production behavior. #### Pull request checklist <!-- If a checklist item is not applicable to this change, write "n/a" in the checkbox --> - [n/a] Addresses an existing issue: #0000 - [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`. - [x] (UI changes only) Added screenshots/GIFs to description above - [n/a] (UI changes only) Verified usability with NVDA/JAWS
1 parent 26f0b98 commit 8586158

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/DetailsView/components/export-dialog-with-local-state.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ export class ExportDialogWithLocalState extends React.Component<
7070
private generateExports = () => {
7171
this.generateJson();
7272
this.generateHtml();
73-
this.setState({ exportDescription: '' });
7473
};
7574

7675
public render(): JSX.Element {

src/tests/unit/tests/DetailsView/components/__snapshots__/export-dialog-with-local-state.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ exports[`ExportDialogWithLocalState clicking export on the dialog triggers gener
1414
},
1515
}
1616
}
17-
description=""
17+
description="test content with special characters: <> $ \\" \` '"
1818
featureFlagStoreData={
1919
Object {
2020
"test-feature-flag": true,

0 commit comments

Comments
 (0)