-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[v16] Add Connect and Web UI support for selecting Kubernetes namespa…
…ces during access requests (#48413) * Web: add support for requesting for kube namespaces (#47345) * Teleterm: add support for access requesting kube namespaces (#47347) * WebShared: Update how request checkout handles kube resource related errors (#48168) * WebShared: Update how request checkout handles kube resource related errors * Fix bug where after create/cancel, specifiable fields were retained * Remove single toggler for kube resources * Address CR * Update snaps * Backport fixes - teleport version v16 and less uses react select version 3 which required to add manual support for initially fetching namespaces on select dropdown - hover tooltip design diffs - field select design diffs
- Loading branch information
Showing
40 changed files
with
2,371 additions
and
762 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
web/packages/shared/components/AccessRequests/NewRequest/CheckableOption.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* Teleport | ||
* Copyright (C) 2024 Gravitational, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { Flex, Text } from 'design'; | ||
import { components, OptionProps } from 'react-select'; | ||
|
||
import { Option as BaseOption } from 'shared/components/Select'; | ||
|
||
export type Option = BaseOption & { | ||
isAdded?: boolean; | ||
kind: 'app' | 'user_group' | 'namespace'; | ||
}; | ||
|
||
export const CheckableOptionComponent = ( | ||
props: OptionProps<Option> & { data: Option } | ||
) => { | ||
const { data } = props; | ||
return ( | ||
<components.Option {...props}> | ||
<Flex alignItems="center" py="8px" px="12px"> | ||
<input | ||
type="checkbox" | ||
checked={data.isAdded || props.isSelected} | ||
readOnly | ||
name={data.value} | ||
id={data.value} | ||
/>{' '} | ||
<Text ml={1}>{data.label}</Text> | ||
</Flex> | ||
</components.Option> | ||
); | ||
}; |
58 changes: 58 additions & 0 deletions
58
web/packages/shared/components/AccessRequests/NewRequest/RequestCheckout/CrossIcon.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* Teleport | ||
* Copyright (C) 2024 Gravitational, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import { Cross } from 'design/Icon'; | ||
|
||
import { Attempt } from 'shared/hooks/useAttemptNext'; | ||
|
||
export function CrossIcon<T>({ | ||
clearAttempt, | ||
toggleResource, | ||
item, | ||
createAttempt, | ||
}: { | ||
clearAttempt: () => void; | ||
toggleResource: (resource: T) => void; | ||
item: T; | ||
createAttempt: Attempt; | ||
}) { | ||
return ( | ||
<Cross | ||
size="small" | ||
borderRadius={2} | ||
p={2} | ||
onClick={() => { | ||
clearAttempt(); | ||
toggleResource(item); | ||
}} | ||
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}; | ||
} | ||
`} | ||
/> | ||
); | ||
} |
Oops, something went wrong.