Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pod logs dock tab #4738

Merged
merged 1 commit into from
Jan 25, 2022
Merged
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
11 changes: 11 additions & 0 deletions src/common/utils/collection-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,14 @@ export function getOrInsert<K, V>(map: Map<K, V>, key: K, value: V): V {
export function getOrInsertMap<K, MK, MV>(map: Map<K, Map<MK, MV>>, key: K): Map<MK, MV> {
return getOrInsert(map, key, new Map<MK, MV>());
}

/**
* Like `getOrInsert` but with delayed creation of the item
*/
export function getOrInsertWith<K, V>(map: Map<K, V>, key: K, value: () => V): V {
if (!map.has(key)) {
map.set(key, value());
}

return map.get(key);
}
2 changes: 1 addition & 1 deletion src/extensions/renderer-api/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { asLegacyGlobalFunctionForExtensionApi } from "../as-legacy-globals-for-
import createTerminalTabInjectable from "../../renderer/components/dock/create-terminal-tab/create-terminal-tab.injectable";
import terminalStoreInjectable from "../../renderer/components/dock/terminal-store/terminal-store.injectable";
import { asLegacyGlobalObjectForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api";
import logTabStoreInjectable from "../../renderer/components/dock/log-tab-store/log-tab-store.injectable";
import logTabStoreInjectable from "../../renderer/components/dock/logs/tab-store.injectable";
import { asLegacyGlobalSingletonForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-singleton-for-extension-api";
import { TerminalStore as TerminalStoreClass } from "../../renderer/components/dock/terminal-store/terminal.store";

Expand Down
151 changes: 0 additions & 151 deletions src/renderer/components/dock/__test__/log-resource-selector.test.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions src/renderer/components/dock/dock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { DockTabs } from "./dock-tabs";
import { DockStore, DockTab, TabKind } from "./dock-store/dock.store";
import { EditResource } from "./edit-resource";
import { InstallChart } from "./install-chart";
import { Logs } from "./logs";
import { LogsDockTab } from "./logs/dock-tab";
import { TerminalWindow } from "./terminal-window";
import { UpgradeChart } from "./upgrade-chart";
import { withInjectables } from "@ogre-tools/injectable-react";
Expand Down Expand Up @@ -85,7 +85,7 @@ class NonInjectedDock extends React.Component<Props & Dependencies> {
case TabKind.UPGRADE_CHART:
return <UpgradeChart tab={tab} />;
case TabKind.POD_LOGS:
return <Logs />;
return <LogsDockTab tab={tab} />;
case TabKind.TERMINAL:
return <TerminalWindow tab={tab} />;
}
Expand Down

This file was deleted.

136 changes: 0 additions & 136 deletions src/renderer/components/dock/logs.tsx

This file was deleted.

Loading