Skip to content

Commit 1a6ae92

Browse files
authored
chore(schema, telemetry): add and update schema telemetry events COMPASS-8818 (#6723)
1 parent 6765079 commit 1a6ae92

File tree

10 files changed

+729
-280
lines changed

10 files changed

+729
-280
lines changed

packages/compass-schema/src/components/compass-schema.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ export default connect(
446446
}),
447447
{
448448
onStartAnalysis: startAnalysis,
449-
onStopAnalysis: stopAnalysis,
449+
onStopAnalysis: () => stopAnalysis(),
450450
onExportSchemaClicked: openExportSchema,
451451
}
452452
)(Schema);

packages/compass-schema/src/components/export-schema-legacy-banner.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313

1414
import type { RootState, SchemaThunkDispatch } from '../stores/store';
1515
import {
16-
confirmedLegacySchemaShare,
16+
confirmedExportLegacySchemaToClipboard,
1717
switchToSchemaExport,
1818
SchemaExportActions,
1919
stopShowingLegacyBanner,
@@ -539,7 +539,7 @@ export default connect(
539539
}),
540540
(dispatch: SchemaThunkDispatch) => ({
541541
onClose: () => dispatch({ type: SchemaExportActions.closeLegacyBanner }),
542-
onLegacyShare: () => dispatch(confirmedLegacySchemaShare()),
542+
onLegacyShare: () => dispatch(confirmedExportLegacySchemaToClipboard()),
543543
onSwitchToSchemaExport: () => dispatch(switchToSchemaExport()),
544544
stopShowingLegacyBanner: (choice: 'legacy' | 'export') =>
545545
dispatch(stopShowingLegacyBanner(choice)),

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
cancelExportSchema,
2222
changeExportSchemaFormat,
2323
closeExportSchema,
24+
trackSchemaExported,
2425
type SchemaFormat,
2526
type ExportStatus,
2627
} from '../stores/schema-export-reducer';
@@ -75,6 +76,7 @@ const ExportSchemaModal: React.FunctionComponent<{
7576
onCancelSchemaExport: () => void;
7677
onChangeSchemaExportFormat: (format: SchemaFormat) => Promise<void>;
7778
onClose: () => void;
79+
onExportedSchemaCopied: () => void;
7880
}> = ({
7981
errorMessage,
8082
exportStatus,
@@ -84,6 +86,7 @@ const ExportSchemaModal: React.FunctionComponent<{
8486
onCancelSchemaExport,
8587
onChangeSchemaExportFormat,
8688
onClose,
89+
onExportedSchemaCopied,
8790
}) => {
8891
const onFormatOptionSelected = useCallback(
8992
(event: ChangeEvent<HTMLInputElement>) => {
@@ -143,6 +146,7 @@ const ExportSchemaModal: React.FunctionComponent<{
143146
language="json"
144147
className={codeStyles}
145148
copyable={true}
149+
onCopy={onExportedSchemaCopied}
146150
>
147151
{exportedSchema ?? 'Empty'}
148152
</Code>
@@ -163,7 +167,7 @@ const ExportSchemaModal: React.FunctionComponent<{
163167
</Button>
164168
<Button
165169
onClick={() => {
166-
/* TODO(COMPASS-8704) */
170+
/* TODO(COMPASS-8704): download and track with trackSchemaExported */
167171
}}
168172
variant="primary"
169173
>
@@ -183,6 +187,7 @@ export default connect(
183187
exportedSchema: state.schemaExport.exportedSchema,
184188
}),
185189
{
190+
onExportedSchemaCopied: trackSchemaExported,
186191
onCancelSchemaExport: cancelExportSchema,
187192
onChangeSchemaExportFormat: changeExportSchemaFormat,
188193
onClose: closeExportSchema,

0 commit comments

Comments
 (0)