Skip to content

Commit 8bd3af3

Browse files
committed
id as const
1 parent 9ee9703 commit 8bd3af3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/compass-import-export/src/components/export-code-view.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import {
1111
queryAsShellJSString,
1212
} from '../utils/get-shell-js-string';
1313

14+
export const codeElementId = 'export-collection-code-preview-wrapper';
15+
1416
const containerStyles = css({
1517
marginBottom: spacing[3],
1618
});
@@ -74,7 +76,7 @@ function ExportCodeView({
7476
<Code
7577
className={codeStyles}
7678
data-testid="export-collection-code-preview-wrapper"
77-
id="export-collection-code-preview-wrapper"
79+
id={codeElementId}
7880
language="javascript"
7981
copyable
8082
>

packages/compass-import-export/src/components/export-modal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import type { ExportStatus, FieldsToExportOption } from '../modules/export';
3030
import type { RootExportState } from '../stores/export-store';
3131
import { SelectFileType } from './select-file-type';
3232
import { ExportSelectFields } from './export-select-fields';
33-
import { ExportCodeView } from './export-code-view';
33+
import { codeElementId, ExportCodeView } from './export-code-view';
3434
import type { ExportAggregation, ExportQuery } from '../export/export-types';
3535
import { queryHasProjection } from '../utils/query-has-projection';
3636
import { FieldsToExportOptions } from './export-field-options';
@@ -250,7 +250,7 @@ function ExportModal({
250250
open={isOpen}
251251
setOpen={closeExport}
252252
data-testid="export-modal"
253-
initialFocus="#export-collection-code-preview-wrapper"
253+
initialFocus={`#${codeElementId}`}
254254
>
255255
<ModalHeader
256256
title="Export"

0 commit comments

Comments
 (0)