- {createAttempt.status === 'success' ? (
- <>
-
-
- Resources Requested Successfully
-
- You've successfully requested {numRequestedResources}{' '}
- {pluralize(numRequestedResources, 'resource')}
-
-
-
-
-
-
-
- >
- ) : (
- <>
- {Header?.() || DefaultHeader()}
- {createAttempt.status === 'failed' && (
-
- )}
-
(
- {getPrettyResourceKind(item.kind)} |
- ),
- },
- {
- key: 'name',
- headerText: 'Name',
- },
- {
- altKey: 'delete-btn',
- render: resource => (
-
- {
- clearAttempt();
- toggleResource(resource);
- }}
- disabled={createAttempt.status === 'processing'}
- css={`
- cursor: pointer;
-
- background-color: ${({ theme }) =>
- theme.colors.buttons.trashButton.default};
- border-radius: 2px;
-
- &:hover {
- background-color: ${({ theme }) =>
- theme.colors.buttons.trashButton.hover};
- }
- `}
- />
- |
- ),
- },
- ]}
- emptyText="No resources are selected"
- />
- {userGroupFetchAttempt?.status === 'processing' && (
-
-
+ function customRow(item: T) {
+ if (item.kind === 'kube_cluster') {
+ return (
+
+
+
+
+
+ {getPrettyResourceKind(item.kind)}
+ {item.name}
- )}
- {userGroupFetchAttempt?.status === 'failed' && (
- {userGroupFetchAttempt.statusText}
- )}
- {userGroupFetchAttempt?.status === 'success' &&
- appsGrantedByUserGroup.length > 0 && (
-
- )}
- {isResourceRequest && (
-
- )}
-
- r.name) ?? []}
- selectedReviewers={selectedReviewers}
- setSelectedReviewers={setSelectedReviewers}
+
+
+
+
+ |
+ );
+ }
+ }
+
+ return (
+
+ {({ validator }) => (
+ <>
+ {showRequestRoleErrBanner &&
+ fetchResourceRequestRolesAttempt.status === 'failed' && (
+
+ )}
+ {hasUnsupportedKubeRequestModes && (
+
+
+ You can only request Kubernetes resource{' '}
+ {pluralize(unsupportedKubeRequestModes.length, 'kind')}{' '}
+ {listToSentence(unsupportedKubeRequestModes)} for
+ cluster {affectedKubeClusterName}. Requesting those
+ resource kinds is currently only supported through the{' '}
+
+ tsh CLI tool
+
+ . Use the{' '}
+
+ tsh request search
+ {' '}
+ command that will help you construct the request.
+
+
+ Example:
+
-
- {({ validator }) => (
+
+ )}
+ {fetchStatus === 'loading' && (
+
+
+
+ )}
+
+ {fetchStatus === 'loaded' && (
+
+ {createAttempt.status === 'success' ? (
+ <>
+
+
+ Resources Requested Successfully
+
+ You've successfully requested {numRequestedResources}{' '}
+ {pluralize(numRequestedResources, 'resource')}
+
+
+
+
+
+
+
+ >
+ ) : (
+ <>
+ {Header?.() || DefaultHeader()}
+ {createAttempt.status === 'failed' && (
+
+ )}
+
d.kind !== 'namespace'
+ )}
+ row={{
+ customRow,
+ }}
+ columns={[
+ {
+ key: 'clusterName',
+ headerText: 'Cluster Name',
+ isNonRender: !showClusterNameColumn,
+ },
+ {
+ key: 'kind',
+ headerText: 'Type',
+ render: item => (
+ {getPrettyResourceKind(item.kind)} |
+ ),
+ },
+ {
+ key: 'name',
+ headerText: 'Name',
+ },
+ {
+ altKey: 'delete-btn',
+ render: resource => (
+
+
+ |
+ ),
+ },
+ ]}
+ emptyText="No resources are selected"
+ />
+ {userGroupFetchAttempt?.status === 'processing' && (
+
+
+
+ )}
+ {userGroupFetchAttempt?.status === 'failed' && (
+ {userGroupFetchAttempt.statusText}
+ )}
+ {userGroupFetchAttempt?.status === 'success' &&
+ appsGrantedByUserGroup.length > 0 && (
+
+ )}
+ {isResourceRequest && (
+
+ )}
+
+ r.name) ?? []
+ }
+ selectedReviewers={selectedReviewers}
+ setSelectedReviewers={setSelectedReviewers}
+ />
+
{dryRunResponse && (
@@ -394,19 +487,19 @@ export function RequestCheckout({
reset();
onClose();
}}
- disabled={submitBtnDisabled}
+ disabled={cancelBtnDisabled}
>
Cancel
- )}
-
- >
+ >
+ )}
+
)}
-
+ >
)}
- >
+
);
}
@@ -549,7 +642,7 @@ function ResourceRequestRoles({
{roles.map((roleName, index) => {
const checked = selectedRoles.includes(roleName);
return (
-