Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit 00b8ecf

Browse files
myan9starpit
authored andcommitted
fix(plugins/plugin-client-common): reverse the dependency of Card and DropDown
Fixes #4641
1 parent fe21671 commit 00b8ecf

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

plugins/plugin-client-common/src/components/spi/Card/impl/PatternFly.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
*/
1616

1717
import * as React from 'react'
18-
import Props, { Action } from '../model'
19-
2018
import {
2119
Card,
2220
CardActions,
@@ -28,6 +26,9 @@ import {
2826
KebabToggle
2927
} from '@patternfly/react-core'
3028

29+
import Props from '../model'
30+
import { DropDownAction } from '../../DropDown'
31+
3132
import '../../../../../web/scss/components/Card/Patternfly.scss'
3233

3334
interface State {
@@ -43,7 +44,7 @@ export default class PatternflyCard extends React.PureComponent<Props, State> {
4344
}
4445
}
4546

46-
private renderDropDownItems(actions: Action[]) {
47+
private renderDropDownItems(actions: DropDownAction[]) {
4748
return actions.map((item, idx) => (
4849
<DropdownItem key={idx} component="button" onClick={item.handler} data-mode={item.label}>
4950
{item.label}

plugins/plugin-client-common/src/components/spi/Card/model.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616

1717
import { ReactNode } from 'react'
1818

19-
export interface Action {
20-
label: string
21-
handler: () => void
22-
}
19+
import { DropDownAction } from '../DropDown'
2320

2421
interface Props {
2522
/** Place the given header node at the top of the Card */
@@ -29,7 +26,7 @@ interface Props {
2926
children: ReactNode
3027

3128
/** [Optional] Actions to be rendered in an overflow menu associated with the Card */
32-
actions?: Action[]
29+
actions?: DropDownAction[]
3330

3431
/** [Optional] CSS class to associate with the outermost Card element */
3532
className?: string

plugins/plugin-client-common/src/components/spi/DropDown/model.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { Action } from '../Card/model'
18-
export { Action }
17+
export interface Action {
18+
label: string
19+
handler: () => void
20+
}
1921

2022
interface Props {
2123
/** Actions to be rendered in an overflow menu associated with the Card */

0 commit comments

Comments
 (0)