Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ const CollectionTabWithMetadata: React.FunctionComponent<
return <ModalPlugin key={idx} {...pluginProps}></ModalPlugin>;
})}
</div>
{tabs.map(({ drawer }) => (
<>{drawer}</>
{tabs.map(({ name, drawer }) => (
<React.Fragment key={name}>{drawer}</React.Fragment>
))}
</div>
);
Expand Down
7 changes: 6 additions & 1 deletion packages/compass-collection/src/plugin-tab-title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ function PluginTitle({
isTimeSeries,
sourceName,
namespace,
// The workspace props below are not valid DOM attributes and would end up
// on the tab element through the spread of the remaining props.
tabId: _tabId,
subTab: _subTab,
Comment on lines +32 to +35

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we allow to pass them to the component if they are not valid dom attributes and not used by anything else?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

workspace-tab-context-provider.tsx#L115 is where we wrap this component and pass these props to this component. I am not sure why we are doing that though.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, can we figure out why by looking at the code? Can we maybe fix this at the source where getInitialPropsForWorkspace are extracting them erroneously for some cases? 🙂

...tabProps
}: PluginTitleProps) {
const { getConnectionById } = useConnectionsListRef();
Expand Down Expand Up @@ -83,5 +87,6 @@ export const CollectionPluginTitleComponent = connect(
isTimeSeries: state.metadata?.isTimeSeries,
isReadonly: state.metadata?.isReadonly,
sourceName: state.metadata?.sourceName,
})
}),
{}
)(PluginTitle);
13 changes: 5 additions & 8 deletions packages/compass-components/src/components/resize-handle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,14 @@ const baseResizerStyles = css({
opacity: 1,
},
WebkitAppearance: 'none',
'&::-moz-range-thumb': {
width: 0,
height: 0,
},
'&::-webkit-slider-thumb': {
WebkitAppearance: 'none',
},
'&::-ms-track': {
background: 'none',
borderColor: 'none',
color: 'none',
'@supports (-moz-appearance: none)': {
'&::-moz-range-thumb': {
width: 0,
height: 0,
},
},
});

Expand Down
6 changes: 3 additions & 3 deletions packages/compass-crud/src/stores/crud-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ class CrudStoreImpl
instance: MongoDBInstance;
connectionScopedAppRegistry: ConnectionScopedAppRegistry<EmittedAppRegistryEvents>;
queryBar: QueryBarService;
collection: Collection;
collectionModel: Collection;

constructor(
options: CrudStoreOptions & CrudStoreActionsOptions,
Expand Down Expand Up @@ -432,7 +432,7 @@ class CrudStoreImpl
this.fieldStoreService = services.fieldStoreService;
this.connectionScopedAppRegistry = services.connectionScopedAppRegistry;
this.queryBar = services.queryBar;
this.collection = services.collection;
this.collectionModel = services.collection;
}

getInitialState(): CrudState {
Expand Down Expand Up @@ -471,7 +471,7 @@ class CrudStoreImpl
isUpdatePreviewSupported:
this.instance.topologyDescription.type !== 'Single',
docsPerPage: this.getInitialDocsPerPage(),
collectionStats: extractCollectionStats(this.collection),
collectionStats: extractCollectionStats(this.collectionModel),
};
}

Expand Down
7 changes: 7 additions & 0 deletions packages/databases-collections-list/src/items-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,11 @@ export const VirtualItemsTable = <T extends Item>({
},
state: { sorting: sortState },
onSortingChange: setSortState,
// These tables are not paginated. Leaving this on makes react-table reset
// the page index in a queued microtask when sorting or data changes, which
// can land after the tab is closed and warn about setting state on an
// unmounted component.
autoResetPageIndex: false,
});

const rowItems = mapVirtualRowItems(table);
Expand Down Expand Up @@ -593,6 +598,8 @@ export const ItemsTable = <T extends Item>({
columns: columnsWithActions,
state: { sorting: sortState },
onSortingChange: setSortState,
// See the note in VirtualItemsTable above.
autoResetPageIndex: false,
});

const rowItems = mapRowItems(table);
Expand Down
Loading