Skip to content

Conversation

fabianwolski
Copy link
Contributor

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Copy link
Contributor

@enrico-kaack-comp enrico-kaack-comp left a comment

Choose a reason for hiding this comment

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

The Dialog when deleting an MCP is the Delete a workspace dialog. That should be changed to be Delete a MCP.

Copy link
Contributor

@enrico-kaack-comp enrico-kaack-comp left a comment

Choose a reason for hiding this comment

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

Please extract strings to the localization file

Copy link
Contributor

@andreaskienle andreaskienle left a comment

Choose a reason for hiding this comment

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

Hey Fabian, awesome work! I’ve done a first review and it looks really cool, I really like this feature!

For the user-facing texts, let’s move them to en.json, since we’re using i18next. Just add your texts to the JSON file somewhere and get them with useTranslation. I’ve not marked all occasions, just a few, to give you a start.

Copy link
Contributor

@andreaskienle andreaskienle left a comment

Choose a reason for hiding this comment

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

Looks much better, still a few things to do, especially with regard to naming. But overall good work!

Please delete the yarn.lock file and switch to npm to manage dependencies, e.g. npm i to install them etc.

As we discussed, let’s handle the refactoring in a follow-up task.

import { useDialog } from '../../UseDialog';

interface KubectlDeleteMcpProps {
projectName?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this ever be undefined? Can there be MCPs without any project? If no, there’s no need to care about this use case

Suggested change
projectName?: string;
projectName: string;

(also adjust ? further down the line)

yarn.lock Outdated
@@ -0,0 +1,4751 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please delete the yarn.lock file completely as we’ve moved to npm as a package manager.

Comment on lines 7 to 9
interface KubectlDialogProps extends ButtonPropTypes {
style?: CSSProperties;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The type for props should have the same name as the component.

It’s great that you extended the ButtonPropTypes but we should be more restrictive, as we don’t want to allow the consumer to pass any children (it’s we who set them). Also, there’s no need to explicitly mention style since it should already be optional.

Do you think it’s necessary to set style explicitly? Anything gained from specifying it as inline-block?

Anyway, here’s a suggestion on how we might write it

Suggested change
interface KubectlDialogProps extends ButtonPropTypes {
style?: CSSProperties;
}
interface KubectlInfoButtonProps extends Omit<ButtonPropTypes, 'children'> {}

isOpen: boolean;
}

export const KubectlProjectDialog = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export const KubectlProjectDialog = ({
export const KubectlCreateProjectDialog = ({

(also the props)

project?: string;
}

export const KubectlWorkspaceDialog = ({
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export const KubectlWorkspaceDialog = ({
export const KubectlCreateWorkspaceDialog = ({

(also the props)

interface KubectlWorkspaceDialogProps {
onClose: () => void;
isOpen: boolean;
project?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can’t we assume that project is always defined? 🤔

@fabianwolski fabianwolski merged commit b3ef407 into main Apr 3, 2025
7 checks passed
@fabianwolski fabianwolski deleted the feature/kubectl-command-helper-dialogs branch April 3, 2025 11:36
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.

4 participants