Skip to content

Commit aabcb59

Browse files
committed
Remove unused elements
Signed-off-by: Trung Nguyen <[email protected]>
1 parent 29156c0 commit aabcb59

File tree

7 files changed

+1
-158
lines changed

7 files changed

+1
-158
lines changed

src/extension/ui/src/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { useMCPClient } from './queries/useMCPClient';
99
import { useRequiredImages } from './queries/useRequiredImages';
1010
import { useSecrets } from './queries/useSecrets';
1111
import { syncRegistryWithConfig } from './Registry';
12-
import useOAuthProvider from './queries/useOAuthProvider';
1312
export const client = createDockerDesktopClient();
1413

1514
// Memoize the CatalogGrid component to prevent unnecessary re-renders

src/extension/ui/src/Constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export const CATALOG_LAYOUT_SX = {
2020
};
2121

2222
export const ASSIGNED_SECRET_PLACEHOLDER = "********";
23-
export const UNASSIGNED_SECRET_PLACEHOLDER = "UNASSIGNED";
2423

2524
export const BUSYBOX = 'busybox@sha256:37f7b378a29ceb4c551b1b5582e27747b855bbfaa73fa11914fe0df028dc581f';
2625

src/extension/ui/src/MergeDeep.ts

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { DeepObject } from './types/utils';
55
* @param item
66
* @returns {boolean}
77
*/
8-
export function isObject(item: unknown): item is DeepObject {
8+
function isObject(item: unknown): item is DeepObject {
99
return Boolean(item && typeof item === 'object' && !Array.isArray(item));
1010
}
1111

@@ -60,27 +60,3 @@ export function buildObjectFromFlattenedObject(flattenedObject: Record<string, a
6060
return acc;
6161
}, {} as DeepObject);
6262
}
63-
64-
export function deepGet(obj: DeepObject, path: string): any {
65-
return path.split('.').reduce((acc, key) => {
66-
if (isObject(acc)) {
67-
return acc[key];
68-
}
69-
return undefined;
70-
}, obj);
71-
}
72-
73-
export function deepSet(obj: DeepObject, path: string, value: any): DeepObject {
74-
const keys = path.split('.');
75-
const key = keys.pop();
76-
if (!key) return obj;
77-
78-
const current = keys.reduce((acc, key) => {
79-
if (!acc[key]) acc[key] = {};
80-
return acc[key];
81-
}, obj);
82-
83-
current[key] = value;
84-
85-
return obj;
86-
}

src/extension/ui/src/Refs.ts

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/extension/ui/src/Registry.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -61,30 +61,6 @@ export const getStoredConfig = async (client: v1.DockerDesktopClient) => {
6161
// if that’s not true and the registry.yaml value is valid then you should sync with it
6262
// if it’s not true and the registry.yaml is invalid then the catalog item needs user assistance because the catalog has probably been updated with a breaking change
6363

64-
// Replace conflicting config values with registry values
65-
export const syncConfigWithRegistry = async (client: v1.DockerDesktopClient, registry: { [key: string]: { ref: string, config: any } }, config: { [key: string]: { [key: string]: ParsedParameters } }) => {
66-
if (Object.keys(registry).length === 0) {
67-
return;
68-
}
69-
if (Object.keys(config).length === 0) {
70-
return;
71-
}
72-
const oldConfigString = JSON.stringify(config)
73-
for (const [registryItemName, registryItem] of Object.entries(registry)) {
74-
const configInRegistry = registryItem.config
75-
const configInConfigFile = config[registryItemName]
76-
if (configInConfigFile) {
77-
const mergedConfig = mergeDeep(configInConfigFile, configInRegistry)
78-
config[registryItemName][registryItemName] = mergedConfig
79-
}
80-
}
81-
const newConfigString = JSON.stringify(config)
82-
if (oldConfigString !== newConfigString) {
83-
await writeToPromptsVolume(client, 'config.yaml', stringify(config))
84-
}
85-
return config
86-
}
87-
8864
// Replace conflicting registry values with config values
8965
export const syncRegistryWithConfig = async (client: v1.DockerDesktopClient, registry: { [key: string]: { ref: string, config: any } }, config: { [key: string]: { [key: string]: ParsedParameters } }) => {
9066
if (Object.keys(config).length === 0) {

src/extension/ui/src/Usage.tsx

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/extension/ui/src/components/CatalogGrid.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,5 +246,3 @@ export const CatalogGrid: React.FC<CatalogGridProps> = ({ appProps }) => {
246246
</Stack>
247247
);
248248
};
249-
250-
export default CatalogGrid;

0 commit comments

Comments
 (0)