diff --git a/packages/common/src/config.ts b/packages/common/src/config.ts index d0d1c789c..3e4619cf4 100644 --- a/packages/common/src/config.ts +++ b/packages/common/src/config.ts @@ -36,6 +36,7 @@ export type Config = { internalUseDevEndpoints: boolean; internalDisableLogRedaction: boolean; internalRegisterMcp: boolean; + host: "vscode" | "jetbrains" | "eclipse" | "visual-studio"; }; export type ConnectionTestResult = { success: true } | { success: false; message: string }; diff --git a/packages/web/src/app/config/Config.tsx b/packages/web/src/app/config/Config.tsx index 246ec6089..18305ec8a 100644 --- a/packages/web/src/app/config/Config.tsx +++ b/packages/web/src/app/config/Config.tsx @@ -8,6 +8,7 @@ import { useFeatureDispatch, useFeatureSelector, ConfigScreenId, + ConfigScreen, } from "../../features/config/slice"; import Form from "../../new-components/Form"; import platformConnection from "./screen/platform-connection"; @@ -32,6 +33,9 @@ export default function Config() { const mandatoryTags = mandatoryTagsMaker(); const temporaryCollection = temporaryCollectionMaker(data.platformCollectionNamingConvention); + const skipVisualStudio = (screen: ConfigScreen) => + data.host !== "visual-studio" ? screen : undefined; + const sections = [ { id: "platform", @@ -39,21 +43,25 @@ export default function Config() { items: [ platformConnection, platformServices, - temporaryCollection, - mandatoryTags, - auditRuntime, - scanRuntime, + skipVisualStudio(temporaryCollection), + skipVisualStudio(mandatoryTags), + skipVisualStudio(auditRuntime), + skipVisualStudio(scanRuntime), ], }, { id: "runtime", title: "Runtimes", - items: [runtimeBinary, runtimeScandManager, runtimeDocker], + items: [ + runtimeBinary, + skipVisualStudio(runtimeScandManager), + skipVisualStudio(runtimeDocker), + ], }, { id: "openapi", title: "OpenAPI", - items: [openapiExternalRefs], + items: [skipVisualStudio(openapiExternalRefs)], }, ]; @@ -79,6 +87,13 @@ export default function Config() { [internalSettings.id]: internalSettings, }; + const sectionsForHost = sections + .map((section) => ({ + ...section, + items: section.items.filter((item) => item !== undefined) as ConfigScreen[], + })) + .filter((section) => section.items.length > 0); + useEffect(() => { const formData = wrapFormValues(data); for (const screenId of Object.keys(screenById)) { @@ -102,7 +117,7 @@ export default function Config() { return ( { diff --git a/packages/web/src/features/config/slice.ts b/packages/web/src/features/config/slice.ts index 162f20b25..72add5c12 100644 --- a/packages/web/src/features/config/slice.ts +++ b/packages/web/src/features/config/slice.ts @@ -92,6 +92,7 @@ const initialState: ConfigState = { internalFeatures: false, internalDisableLogRedaction: false, internalRegisterMcp: false, + host: "vscode", }, platformConnectionTestResult: undefined, waitingForPlatformConnectionTest: false, diff --git a/src/util/config.ts b/src/util/config.ts index 9f093a32e..eec282253 100644 --- a/src/util/config.ts +++ b/src/util/config.ts @@ -75,6 +75,7 @@ export async function loadConfig( internalUseDevEndpoints, internalDisableLogRedaction, internalRegisterMcp, + host: "vscode", }; }