Skip to content

Commit dae006e

Browse files
committed
fix: clarify import functionality COMPASS-9833
1 parent 29dae92 commit dae006e

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

packages/compass-data-modeling/src/components/export-diagram-modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const ExportDiagramModal = ({
8888
size="small"
8989
description="Importable into Compass and Data Explorer so teammates can collaborate."
9090
>
91-
Diagram File
91+
MDM File
9292
</Radio>
9393
</div>
9494
<div className={radioItemStyles}>

packages/compass-data-modeling/src/components/import-diagram-button.tsx

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
Button,
44
type ButtonProps,
55
FileSelector,
6+
Tooltip,
67
} from '@mongodb-js/compass-components';
78

89
type ImportDiagramButtonProps = Omit<ButtonProps, 'onClick'> & {
@@ -14,22 +15,31 @@ export const ImportDiagramButton = ({
1415
...buttonProps
1516
}: ImportDiagramButtonProps) => {
1617
return (
17-
<FileSelector
18-
id="import-diagram-file-input"
19-
data-testid="import-diagram-file-input"
20-
multiple={false}
21-
accept=".mdm"
22-
onSelect={(files) => {
23-
if (files.length === 0) {
24-
return;
25-
}
26-
onImportDiagram(files[0]);
27-
}}
28-
trigger={({ onClick }) => (
29-
<Button {...buttonProps} onClick={onClick}>
30-
Import diagram
31-
</Button>
32-
)}
33-
/>
18+
<Tooltip
19+
trigger={
20+
<span>
21+
<FileSelector
22+
id="import-diagram-file-input"
23+
data-testid="import-diagram-file-input"
24+
multiple={false}
25+
accept=".mdm"
26+
onSelect={(files) => {
27+
if (files.length === 0) {
28+
return;
29+
}
30+
onImportDiagram(files[0]);
31+
}}
32+
trigger={({ onClick }) => (
33+
<Button {...buttonProps} onClick={onClick}>
34+
Import diagram
35+
</Button>
36+
)}
37+
/>
38+
</span>
39+
}
40+
>
41+
Only MDM files exported from Compass or Atlas Data Explorer can be
42+
imported.
43+
</Tooltip>
3444
);
3545
};

0 commit comments

Comments
 (0)