Skip to content

Commit 22629e4

Browse files
committed
cleanup
1 parent ce7f4e9 commit 22629e4

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,10 @@ const containerStyles = css({
444444
width: '650px',
445445
});
446446

447+
const checkboxContainerStyles = css({
448+
marginTop: spacing[300],
449+
});
450+
447451
const comparisonContainerStyles = css({
448452
display: 'grid',
449453
gridTemplateColumns: '1fr 1fr',
@@ -517,7 +521,7 @@ const ExportSchemaLegacyBanner: React.FunctionComponent<{
517521
Try new Export
518522
</Button>
519523
</div>
520-
<div>
524+
<div className={checkboxContainerStyles}>
521525
<Checkbox
522526
label="Do not show me this message again"
523527
checked={dontShowAgainChecked}

packages/compass-schema/src/stores/schema-export-reducer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ export const schemaExportReducer: Reducer<SchemaExportState, Action> = (
281281
SchemaExportActions.openLegacyBanner
282282
)
283283
) {
284-
console.log('opening the banner');
285284
return {
286285
...state,
287286
isLegacyBannerOpen: true,

packages/compass-schema/src/stores/store.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import type { TrackFunction } from '@mongodb-js/compass-telemetry';
2020
import { schemaAnalysisReducer, stopAnalysis } from './schema-analysis-reducer';
2121
import {
2222
cancelExportSchema,
23+
confirmedLegacySchemaShare,
2324
SchemaExportActions,
2425
schemaExportReducer,
2526
} from './schema-export-reducer';
@@ -76,8 +77,12 @@ export function activateSchemaPlugin(
7677
*/
7778

7879
on(services.localAppRegistry, 'menu-share-schema-json', () => {
79-
console.log('I am here');
80-
store.dispatch({ type: SchemaExportActions.openLegacyBanner });
80+
const { enableExportSchema } = services.preferences.getPreferences();
81+
if (enableExportSchema) {
82+
store.dispatch({ type: SchemaExportActions.openLegacyBanner });
83+
return;
84+
}
85+
store.dispatch(confirmedLegacySchemaShare());
8186
});
8287

8388
addCleanup(() => store.dispatch(stopAnalysis()));

packages/compass-workspaces/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ export function activateWorkspacePlugin(
157157

158158
on(globalAppRegistry, 'menu-share-schema-json', () => {
159159
const activeTab = getActiveTab(store.getState());
160+
console.log({ activeTab });
160161
if (activeTab?.type === 'Collection') {
162+
console.log('this is collection');
161163
getLocalAppRegistryForTab(activeTab.id).emit('menu-share-schema-json');
162164
}
163165
});

0 commit comments

Comments
 (0)