Skip to content

feat(cluster-link) add cluster link crud#1563

Draft
edlerd wants to merge 1 commit intocanonical:mainfrom
edlerd:cluster-link-spike
Draft

feat(cluster-link) add cluster link crud#1563
edlerd wants to merge 1 commit intocanonical:mainfrom
edlerd:cluster-link-spike

Conversation

@edlerd
Copy link
Copy Markdown
Collaborator

@edlerd edlerd commented Oct 22, 2025

Done

Still draft as the backend api is pending from canonical/lxd#17554

@webteam-app
Copy link
Copy Markdown

@edlerd edlerd force-pushed the cluster-link-spike branch from 50712c4 to b9845a7 Compare October 22, 2025 08:01
@edlerd edlerd force-pushed the cluster-link-spike branch from b9845a7 to 48bc3db Compare December 16, 2025 08:28
@edlerd edlerd force-pushed the cluster-link-spike branch from 48bc3db to 63826b0 Compare January 9, 2026 12:17
@edlerd edlerd force-pushed the cluster-link-spike branch 3 times, most recently from f9bdb33 to 2758626 Compare February 3, 2026 17:53
@edlerd edlerd force-pushed the cluster-link-spike branch 4 times, most recently from edb906a to e843425 Compare February 17, 2026 13:55
@edlerd edlerd force-pushed the cluster-link-spike branch 5 times, most recently from bbeb79e to aa55af5 Compare February 27, 2026 07:26
@edlerd edlerd force-pushed the cluster-link-spike branch 3 times, most recently from 39994ff to 39c88bd Compare March 6, 2026 11:37
@edlerd edlerd force-pushed the cluster-link-spike branch 3 times, most recently from 14e219d to 34c2f9a Compare March 12, 2026 17:21
@edlerd edlerd force-pushed the cluster-link-spike branch from 34c2f9a to 1acd87c Compare March 20, 2026 14:27
Signed-off-by: David Edler <david.edler@canonical.com>
@edlerd edlerd force-pushed the cluster-link-spike branch from 1acd87c to ef9c5c2 Compare March 25, 2026 20:42
import { ROOT_PATH } from "util/rootPath";
import { addEntitlements } from "util/entitlements/api";

const clusterLinkEntitlements = ["can_edit", "can_delete"];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
const clusterLinkEntitlements = ["can_edit", "can_delete"];
const CLUSTER_LINK_ENTITLEMENTS = ["can_edit", "can_delete"];

If this constant is just for this file, then the cluster link prefix might not be needed but I don't have a strong opinion on this. However, let's use all capital for constants.

title={disableReason}
disabled={disableReason !== undefined}
>
<Icon name="plus" light />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sometimes we the + icon with light, sometimes without. Any reason for that ?

Comment on lines +19 to +20
appearance={"base"}
className={"u-no-margin--bottom"}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
appearance={"base"}
className={"u-no-margin--bottom"}
appearance="base"
className="u-no-margin--bottom"

No need for curl brackets around constants

);
})
.catch((e) => {
setLoading(false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I know that most our components are built this way, but should setLoading(false); be in finally ?


const EditClusterLinkBtn: FC<Props> = ({ clusterLink }) => {
const { canEditClusterLink } = useClusterLinkEntitlements();
const panel = usePanelParams();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
const panel = usePanelParams();
const panelParams = usePanelParams();

In the rest of the codebase, we call it panelParams

const [howToUseActiveTab, setHowToUseActiveTab] = useState("ui-tab");

return (
<Modal
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do you want to match exactly the beautiful CreateIdentityModal ? If so, here are the differences:

  • tooltipMessage="Copy token"
  • name of the cluster link in the title
  • onClose not called in Modal's close (but I'm not sure what are the consequences)

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.

3 participants