Skip to content

Commit

Permalink
fix conditional
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin <[email protected]>
  • Loading branch information
KPostOffice committed Dec 16, 2024
1 parent 0c9dd1e commit 635df77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const DistributedWorkloadsContextProvider =

const allClusterQueues = useMakeFetchObject<ClusterQueueKind[]>(useClusterQueues(refreshRate));

const cqExists = allClusterQueues.data.length > 0;
const validCQExists = allClusterQueues.data.some((cq) => cq.spec.resourceGroups?.length);

const clusterQueues = {
...allClusterQueues,
Expand Down Expand Up @@ -130,7 +130,7 @@ export const DistributedWorkloadsContextProvider =
refreshAllData,
namespace,
projectDisplayName: getDisplayNameFromK8sResource(project),
cqExists,
cqExists: validCQExists,
}}
>
{children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ const GlobalDistributedWorkloadsTabs: React.FC<GlobalDistributedWorkloadsTabsPro
}

if (clusterQueues.data.length === 0 || localQueues.data.length === 0) {
const nonAdmin = cqExists;
const title = `Configure the ${ cqExists ? 'cluster queue' : 'project queue' }`;
const nonAdmin = !cqExists;
const title = `Configure the ${!cqExists ? 'cluster queue' : 'project queue'}`;
const message = nonAdmin
? 'Ask your cluster admin to configure the cluster queue.'
: 'Configure the queue for this project, or select a different project.';
Expand Down

0 comments on commit 635df77

Please sign in to comment.