Skip to content

Commit 5019960

Browse files
committed
fixup: naming, types, comments
1 parent 657307b commit 5019960

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

packages/compass-collection/src/plugin-tab-title.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ function _PluginTitle({
9090
}
9191

9292
const ConnectedPluginTitle = connect((state: CollectionState) => ({
93-
// TODO: Need to check the implications of moving this metadata here
94-
// instead of having it passed from the workspaces store.
9593
isTimeSeries: state.metadata?.isTimeSeries,
9694
isReadonly: state.metadata?.isReadonly,
9795
sourceName: state.metadata?.sourceName,

packages/compass-components/src/components/workspace-tabs/tab.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ const draggingTabStyles = css({
149149
cursor: 'grabbing !important',
150150
});
151151

152-
// TODO: Should this have a dark mode version?
153152
const nonExistentStyles = css({
154153
color: palette.gray.base,
155154
});

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,14 @@ const CompassWorkspaces: React.FunctionComponent<CompassWorkspacesProps> = ({
131131
let isNonExistent: boolean | undefined;
132132
if ('isNonExistent' in tab && tab.isNonExistent) {
133133
if (tab.type === 'Collections') {
134-
// TODO: Can/should we move this logic into the collections plugin title?
134+
// TODO(COMPASS-9456): Move this logic and `isNonExistent` setting to the plugin.
135135
const database = tab.namespace;
136136
const namespaceId = `${tab.connectionId}.${database}`;
137137
const { isNonExistent: databaseDoesNotExist } =
138138
databaseInfo[namespaceId] ?? {};
139139
isNonExistent = databaseDoesNotExist;
140140
} else if (tab.type === 'Collection') {
141-
// TODO: Can/should we move this logic into the collection plugin title?
141+
// TODO(COMPASS-9456): Move this logic and `isNonExistent` setting to the plugin.
142142
const { ns } = toNS(tab.namespace);
143143
const namespaceId = `${tab.connectionId}.${ns}`;
144144
const { isNonExistent: collectionDoesNotExist } =
@@ -193,15 +193,25 @@ const CompassWorkspaces: React.FunctionComponent<CompassWorkspacesProps> = ({
193193
>
194194
<Provider>
195195
<WorkspaceTabContent
196-
{...(tab as any)} // TODO: This typing.
196+
// Cast to any as it can be any of the workspace types
197+
// here.
198+
{...(tab as any)}
197199
/>
198200
</Provider>
199201
</WorkspaceTabContextProvider>
200202
</ErrorBoundary>
201203
),
202204
};
203205
});
204-
}, [getWorkspacePlugins, tabs, getThemeOf, getConnectionById]);
206+
}, [
207+
getWorkspacePlugins,
208+
tabs,
209+
log,
210+
getThemeOf,
211+
mongoLogId,
212+
onNamespaceNotFound,
213+
getConnectionById,
214+
]);
205215

206216
const workspaceTabContent = workspaceTabs[activeTabIndex]?.content ?? null;
207217

packages/compass-workspaces/src/types.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,16 @@ export type WorkspacePluginProps<T extends AnyWorkspace['type']> = Omit<
104104

105105
export type WorkspacePlugin<T extends AnyWorkspace['type']> = {
106106
name: T;
107-
// TODO: Type the services and activate if we can.
108-
// provider: HadronPluginComponent<T, Record<string, () => unknown>, any>;
109-
provider: HadronPluginComponent<WorkspacePluginProps<T>, any, any>;
107+
provider: HadronPluginComponent<
108+
WorkspacePluginProps<T>,
109+
Record<string, () => unknown>,
110+
any
111+
>;
110112
content:
111113
| React.ComponentClass<WorkspacePluginProps<T>>
112114
| ((props: WorkspacePluginProps<T>) => React.ReactElement | null);
113115
header: (props: {
114116
tabProps: WorkspaceTabCoreProps;
115-
workspaceProps: any;
116-
// workspaceProps: WorkspacePluginProps<T> // TODO: Typing
117+
workspaceProps: WorkspaceTabProps;
117118
}) => ReturnType<typeof Tab>;
118119
};

0 commit comments

Comments
 (0)