-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Aviv Turgeman <aturgema@redhat.com>
- Loading branch information
Showing
439 changed files
with
5,429 additions
and
7,457 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import React, { FC, memo, useState } from 'react'; | ||
|
||
import ActionDropdownItem from '@kubevirt-utils/components/ActionDropdownItem/ActionDropdownItem'; | ||
import DropdownToggle from '@kubevirt-utils/components/toggles/DropdownToggle'; | ||
import KebabToggle from '@kubevirt-utils/components/toggles/KebabToggle'; | ||
import { useKubevirtTranslation } from '@kubevirt-utils/hooks/useKubevirtTranslation'; | ||
import { Action } from '@openshift-console/dynamic-plugin-sdk'; | ||
import { Dropdown, DropdownList } from '@patternfly/react-core'; | ||
|
||
type ActionsDropdownProps = { | ||
actions: Action[]; | ||
className?: string; | ||
id?: string; | ||
isKebabToggle?: boolean; | ||
onLazyClick?: () => void; | ||
}; | ||
|
||
const ActionsDropdown: FC<ActionsDropdownProps> = ({ | ||
actions = [], | ||
className, | ||
id, | ||
isKebabToggle, | ||
onLazyClick, | ||
}) => { | ||
const { t } = useKubevirtTranslation(); | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
const onToggle = () => { | ||
setIsOpen((prevIsOpen) => { | ||
if (onLazyClick && !prevIsOpen) onLazyClick(); | ||
|
||
return !prevIsOpen; | ||
}); | ||
}; | ||
|
||
const Toggle = isKebabToggle | ||
? KebabToggle({ isExpanded: isOpen, onClick: onToggle }) | ||
: DropdownToggle({ | ||
children: t('Actions'), | ||
isExpanded: isOpen, | ||
onClick: onToggle, | ||
}); | ||
|
||
return ( | ||
<Dropdown | ||
className={className} | ||
data-test-id={id} | ||
isOpen={isOpen} | ||
onOpenChange={(open: boolean) => setIsOpen(open)} | ||
popperProps={{ enableFlip: true, position: 'right' }} | ||
toggle={Toggle} | ||
> | ||
<DropdownList> | ||
{actions?.map((action) => ( | ||
<ActionDropdownItem action={action} key={action?.id} setIsOpen={setIsOpen} /> | ||
))} | ||
</DropdownList> | ||
</Dropdown> | ||
); | ||
}; | ||
|
||
export default memo(ActionsDropdown); |
77 changes: 0 additions & 77 deletions
77
src/utils/components/AddBootableVolumeModal/components/FilterSelect/FilterSelect.tsx
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
...eVolumeModal/components/FilterSelect/components/FilterSelectOption/FilterSelectOption.tsx
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.