Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V cluster node count removal #368

Merged
merged 2 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions components/clusterDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ import {

import Typography from '@/components/typography';
import Column from '@/components/column';
import { Cluster, ClusterType, DraftCluster, ManagementCluster } from '@/types/provision';
import {
Cluster,
ClusterStatus,
ClusterType,
DraftCluster,
ManagementCluster,
} from '@/types/provision';
import StatusIndicator from '@/components/statusIndicator';
import { BISCAY, VOLCANIC_SAND } from '@/constants/colors';
import Tag from '@/components/tag';
Expand Down Expand Up @@ -42,10 +48,11 @@ const ClusterDetails: FunctionComponent<ClusterDetailsProps> = ({
instanceSize,
environment,
type,
status,
gitAuth: { gitUser } = {},
} = cluster;

const [available, setAvailable] = useState(false);
const [available, setAvailable] = useState(status === ClusterStatus.PROVISIONED ?? false);

useEffect(() => {
setTimeout(() => setAvailable(true), 10000);
Expand Down Expand Up @@ -122,10 +129,12 @@ const ClusterDetails: FunctionComponent<ClusterDetailsProps> = ({
<StyledLabel variant="labelLarge">Cloud region</StyledLabel>
<StyledValue variant="body2">{cloudRegion}</StyledValue>
</ColumnInfo>
<ColumnInfo>
<StyledLabel variant="labelLarge">Number of nodes</StyledLabel>
<StyledValue variant="body2">{nodeCount}</StyledValue>
</ColumnInfo>
{type !== ClusterType.WORKLOAD_V_CLUSTER && (
<ColumnInfo>
<StyledLabel variant="labelLarge">Number of nodes</StyledLabel>
<StyledValue variant="body2">{nodeCount}</StyledValue>
</ColumnInfo>
)}
</RowInfo>

{/* Fifth Row */}
Expand Down
2 changes: 1 addition & 1 deletion components/graphNode/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const GraphNode: FunctionComponent<NodeProps<Cluster>> = ({
<Typography variant="body3">{cloudRegion}</Typography>
</LabelContainer>
)}
{nodeCount && (
{nodeCount && type !== ClusterType.WORKLOAD_V_CLUSTER && (
<LabelContainer>
<Nodes>NODES:</Nodes>
<Typography variant="body3">{nodeCount}</Typography>
Expand Down
16 changes: 8 additions & 8 deletions containers/clusterForms/clusterCreation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,16 +229,16 @@ const ClusterCreationForm: FunctionComponent<Omit<ComponentPropsWithoutRef<'div'
]}
defaultValue={draftCluster?.instanceSize}
/>
<Box sx={{ width: 136 }}>
<ControlledNumberInput
label="Number of nodes"
control={control}
name="nodeCount"
numberInputProps={{ min: MIN_NODE_COUNT }}
/>
</Box>
</>
)}
<Box sx={{ width: 136 }}>
<ControlledNumberInput
label="Number of nodes"
control={control}
name="nodeCount"
numberInputProps={{ min: MIN_NODE_COUNT }}
/>
</Box>
</Container>
);
};
Expand Down
1 change: 0 additions & 1 deletion hooks/useQueue/queue.provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ const QueueProvider: FunctionComponent<PropsWithChildren> = ({ children }) => {
!queue[clusterId] &&
[ClusterStatus.DELETING, ClusterStatus.PROVISIONING].includes(status)
) {
console.log('should be added');
queue[clusterId] = getClusterInterval(clusterQueue[clusterId]);
}
});
Expand Down