Skip to content

Conversation

@andreaskienle
Copy link
Contributor

additionalText={
currentContext === context.name ? '(default IdP)' : undefined
}
additionalText={`(${
Copy link
Contributor

Choose a reason for hiding this comment

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

please use the mcp resource and check the spec.authentication.enableSystemIdentityProvider === true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed as discussed

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds logic to disable connections when the system identity provider (IdP) is not enabled and surface a warning, and updates the ConnectButton to disable non-default IdP contexts with proper translation keys.

  • Fetches the managed control plane resource to check enableSystemIdentityProvider, disables the Connect button if false, and shows an Infobox warning.
  • Updates ConnectButton to disable menu items for non-default IdPs, using translation keys for “default” and “unsupported” IdP labels.
  • Adds defaultIdP and unsupportedIdP entries to the English locale file.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/components/ControlPlanes/ControlPlaneCard/ControlPlaneCard.tsx Import useResource to fetch config, disable Connect when IdP off, and show warning Infobox
src/components/ControlPlanes/ConnectButton.tsx Disable non-openmcp contexts, update additionalText to use translations
public/locales/en.json Add defaultIdP and unsupportedIdP translation strings
Comments suppressed due to low confidence (2)

src/components/ControlPlanes/ControlPlaneCard/ControlPlaneCard.tsx:137

  • Add a unit or integration test to verify that the warning Infobox is displayed when enableSystemIdentityProvider is disabled and the Connect button is rendered.
                {showWarningBecauseOfDisabledSystemIdentityProvider && (

src/components/ControlPlanes/ConnectButton.tsx:110

  • Add tests to ensure that menu items for non-openmcp contexts are correctly disabled and that the appropriate additional text is shown.
            disabled={context.context.user !== 'openmcp'}

Comment on lines +20 to +22
import useResource, {
useApiResourceMutation,
} from '../../../lib/api/useApiResource.ts';
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

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

The imported useApiResourceMutation is not used in this file. Remove it to clean up unused imports.

Suggested change
import useResource, {
useApiResourceMutation,
} from '../../../lib/api/useApiResource.ts';
import useResource from '../../../lib/api/useApiResource.ts';

Copilot uses AI. Check for mistakes.
Comment on lines +79 to +80
// @ts-ignore
!!controlPlaneConfig.data?.spec?.authentication
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

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

Avoid using // @ts-ignore to suppress type errors. Consider updating the type definitions for controlPlaneConfig.data.spec.authentication so you can safely access enableSystemIdentityProvider without ignoring TypeScript.

Suggested change
// @ts-ignore
!!controlPlaneConfig.data?.spec?.authentication
!!(controlPlaneConfig.data as ControlPlaneConfigData)?.spec?.authentication

Copilot uses AI. Check for mistakes.
Comment on lines +106 to +110
context.context.user === 'openmcp'
? t('ConnectButton.defaultIdP')
: t('ConnectButton.unsupportedIdP')
})`}
disabled={context.context.user !== 'openmcp'}
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

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

[nitpick] The string 'openmcp' is used directly to detect the system IdP. Consider extracting this into a named constant to avoid magic strings and improve readability.

Suggested change
context.context.user === 'openmcp'
? t('ConnectButton.defaultIdP')
: t('ConnectButton.unsupportedIdP')
})`}
disabled={context.context.user !== 'openmcp'}
context.context.user === SYSTEM_IDP
? t('ConnectButton.defaultIdP')
: t('ConnectButton.unsupportedIdP')
})`}
disabled={context.context.user !== SYSTEM_IDP}

Copilot uses AI. Check for mistakes.
@enrico-kaack-comp enrico-kaack-comp merged commit a84b9ff into main Jul 10, 2025
5 checks passed
@enrico-kaack-comp enrico-kaack-comp deleted the feat/unsupported-idp branch July 10, 2025 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User feedback for unsupported IdP scenarios for an MCP

2 participants