Skip to content

Commit b0e5496

Browse files
committed
PR feedback
1 parent 76fdb52 commit b0e5496

File tree

9 files changed

+14
-21
lines changed

9 files changed

+14
-21
lines changed

packages/compass-aggregations/src/modules/aggregation.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ const confirmWriteOperationIfNeeded = async ({
260260
dataService,
261261
database,
262262
collection,
263-
preferences,
264263
}));
265264
} else {
266265
isOverwritingCollection = true;

packages/compass-app-stores/src/stores/instance-store.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ export function createInstancesStore(
108108
await instance.refresh({
109109
dataService,
110110
...refreshOptions,
111-
preferences,
112111
});
113112
} catch (err: any) {
114113
log.warn(

packages/compass-preferences-model/src/preferences-schema.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { Link } from '@mongodb-js/compass-components';
1919
export const THEMES_VALUES = ['DARK', 'LIGHT', 'OS_THEME'] as const;
2020
export type THEMES = typeof THEMES_VALUES[number];
2121

22-
const EnableDbAndCollStatsDescription: React.ReactNode = (
22+
const enableDbAndCollStatsDescription: React.ReactNode = (
2323
<>
2424
The{' '}
2525
<Link href="https://www.mongodb.com/docs/manual/reference/command/dbStats/#mongodb-dbcommand-dbcmd.dbStats">
@@ -512,7 +512,7 @@ export const storedUserPreferencesProps: Required<{
512512
description: {
513513
short: 'Show Database and Collection Statistics',
514514
long: "The dbStats and collStats command returns storage statistics for a given database or collection. Disabling this setting can help reduce Compass' overhead on your MongoDB deployments.",
515-
longReact: EnableDbAndCollStatsDescription,
515+
longReact: enableDbAndCollStatsDescription,
516516
},
517517
validator: z.boolean().default(true),
518518
type: 'boolean',

packages/compass-saved-aggregations-queries/src/stores/open-item.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,6 @@ export const openSavedItem =
499499
dataService,
500500
database,
501501
collection,
502-
preferences,
503502
});
504503

505504
if (coll) {

packages/compass-settings/src/components/settings/settings-list.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,11 @@ import {
1717
Option,
1818
FormFieldContainer,
1919
Badge,
20-
palette,
2120
} from '@mongodb-js/compass-components';
2221
import { changeFieldValue } from '../../stores/settings';
2322
import type { RootState } from '../../stores';
2423
import { connect } from 'react-redux';
2524

26-
const inputDescriptionStyles = css({
27-
display: 'block',
28-
color: palette.gray.dark1,
29-
});
30-
3125
type KeysMatching<T, V> = keyof {
3226
[P in keyof T as T[P] extends V ? P : never]: P;
3327
};
@@ -88,8 +82,7 @@ function SettingLabel({ name }: { name: SupportedPreferences }) {
8882
</span>
8983
)}
9084
</Label>
91-
{long && !longReact && <Description>{long}</Description>}
92-
{longReact && <div className={inputDescriptionStyles}>{longReact}</div>}
85+
{(longReact || long) && <Description>{longReact ?? long}</Description>}
9386
</>
9487
);
9588
}

packages/compass-workspaces/src/stores/workspaces.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ const fetchCollectionInfo = (
703703
return async (
704704
dispatch,
705705
getState,
706-
{ connections, instancesManager, logger, preferences }
706+
{ connections, instancesManager, logger }
707707
) => {
708708
const namespaceId = `${workspaceOptions.connectionId}.${workspaceOptions.namespace}`;
709709
if (getState().collectionInfo[namespaceId]) {
@@ -725,7 +725,6 @@ const fetchCollectionInfo = (
725725
dataService,
726726
database,
727727
collection,
728-
preferences,
729728
});
730729

731730
if (coll) {

packages/databases-collections-list/src/collections.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ import { usePreference } from 'compass-preferences-model/provider';
1010
const COLLECTION_CARD_WIDTH = spacing[1600] * 4;
1111

1212
const COLLECTION_CARD_HEIGHT = 238;
13-
const COLLECTION_CARD_WITHOUT_STATS_HEIGHT = COLLECTION_CARD_HEIGHT - 40 - 16;
13+
const COLLECTION_CARD_WITHOUT_STATS_HEIGHT = COLLECTION_CARD_HEIGHT - 150;
1414

1515
const COLLECTION_CARD_LIST_HEIGHT = 118;
16+
const COLLECTION_CARD_LIST_WITHOUT_STATS_HEIGHT =
17+
COLLECTION_CARD_LIST_HEIGHT - 50;
1618

1719
function collectionPropertyToBadge({
1820
id,
@@ -95,7 +97,11 @@ const CollectionsList: React.FunctionComponent<{
9597
? COLLECTION_CARD_HEIGHT
9698
: COLLECTION_CARD_WITHOUT_STATS_HEIGHT
9799
}
98-
itemListHeight={COLLECTION_CARD_LIST_HEIGHT}
100+
itemListHeight={
101+
enableDbAndCollStats
102+
? COLLECTION_CARD_LIST_HEIGHT
103+
: COLLECTION_CARD_LIST_WITHOUT_STATS_HEIGHT
104+
}
99105
sortBy={[
100106
{ name: 'name', label: 'Collection Name' },
101107
{ name: 'document_count', label: 'Documents' },

packages/databases-collections-list/src/databases.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const DATABASE_CARD_HEIGHT = 154;
1313
const DATABASE_CARD_WITHOUT_STATS_HEIGHT = DATABASE_CARD_HEIGHT - 85;
1414

1515
const DATABASE_CARD_LIST_HEIGHT = 118;
16-
const DATABASE_CARD_WITHOUT_STATS_LIST_HEIGHT = DATABASE_CARD_LIST_HEIGHT - 40;
16+
const DATABASE_CARD_LIST_WITHOUT_STATS_HEIGHT = DATABASE_CARD_LIST_HEIGHT - 50;
1717

1818
const DatabasesList: React.FunctionComponent<{
1919
databases: DatabaseProps[];
@@ -44,7 +44,7 @@ const DatabasesList: React.FunctionComponent<{
4444
itemListHeight={
4545
enableDbAndCollStats
4646
? DATABASE_CARD_LIST_HEIGHT
47-
: DATABASE_CARD_WITHOUT_STATS_LIST_HEIGHT
47+
: DATABASE_CARD_LIST_WITHOUT_STATS_HEIGHT
4848
}
4949
sortBy={[
5050
{ name: 'name', label: 'Database Name' },

packages/instance-model/index.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ declare class MongoDBInstance extends MongoDBInstanceProps {
118118
}): Promise<void>;
119119
refresh(opts: {
120120
dataService: DataService;
121-
preferences: PreferencesAccess;
122121
fetchDatabases?: boolean;
123122
fetchDbStats?: boolean;
124123
fetchCollections?: boolean;
@@ -127,7 +126,6 @@ declare class MongoDBInstance extends MongoDBInstanceProps {
127126
}): Promise<void>;
128127
getNamespace(opts: {
129128
dataService: Pick<DataService, 'instance' | 'getCurrentTopologyType'>;
130-
preferences: PreferencesAccess;
131129
database: string;
132130
collection: string;
133131
}): Promise<Collection | null>;

0 commit comments

Comments
 (0)