Skip to content

Commit

Permalink
run yarn format:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig O'Donnell committed Feb 9, 2024
1 parent fc0fbd1 commit 8943e24
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions web/src/components/apps/EmbeddedClusterManagement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,6 @@ const EmbeddedClusterManagement = ({
retry: false,
});

useEffect(() => {
const nodeTypes = rolesData?.roles || NODE_TYPES;
if (nodeTypes.length === 1) {
// if there's only one node type, select it by default
setSelectedNodeTypes(nodeTypes);
} else {
setSelectedNodeTypes([]);
}
}, [rolesData]);

type AddNodeCommandResponse = {
command: string;
expiry: string;
Expand Down Expand Up @@ -243,6 +233,16 @@ const EmbeddedClusterManagement = ({
// #region node type logic
const NODE_TYPES = ["controller"];

useEffect(() => {
const nodeTypes = rolesData?.roles || NODE_TYPES;
if (nodeTypes.length === 1) {
// if there's only one node type, select it by default
setSelectedNodeTypes(nodeTypes);
} else {
setSelectedNodeTypes([]);
}
}, [rolesData]);

const determineDisabledState = () => {
return false;
};
Expand Down Expand Up @@ -284,8 +284,8 @@ const EmbeddedClusterManagement = ({
>
{value}
</Link>
)
}
);
},
},
{
accessorKey: "roles",
Expand All @@ -307,8 +307,8 @@ const EmbeddedClusterManagement = ({
</span>
))}
</div>
)
}
);
},
},
{
accessorKey: "status",
Expand Down Expand Up @@ -467,9 +467,8 @@ const EmbeddedClusterManagement = ({
/>
</div>
<p className="tw-text-base tw-text-gray-600">
Select one or more roles to assign to the new node.
Copy the join command and run it on the machine you'd like
to join to the cluster.
Select one or more roles to assign to the new node. Copy the join
command and run it on the machine you'd like to join to the cluster.
</p>
{rolesLoading && (
<p className="tw-text-base tw-w-full tw-text-center tw-py-4 tw-text-gray-500 tw-font-semibold">
Expand All @@ -481,7 +480,7 @@ const EmbeddedClusterManagement = ({
{rolesError?.message}
</p>
)}
{(rolesData?.roles || NODE_TYPES).length > 1 &&
{(rolesData?.roles || NODE_TYPES).length > 1 && (
<div className="tw-grid tw-gap-2 tw-grid-cols-4 tw-auto-rows-auto">
{(rolesData?.roles || NODE_TYPES).map((nodeType) => (
<div
Expand Down Expand Up @@ -510,7 +509,7 @@ const EmbeddedClusterManagement = ({
</div>
))}
</div>
}
)}
<div>
{selectedNodeTypes.length > 0 && generateAddNodeCommandLoading && (
<p className="tw-text-base tw-w-full tw-text-center tw-py-4 tw-text-gray-500 tw-font-semibold">
Expand Down

0 comments on commit 8943e24

Please sign in to comment.