-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [DHIS2-16922] Delete Tracked entity from profile Widget (#3545)
- Loading branch information
1 parent
b30d87d
commit fb8171e
Showing
40 changed files
with
562 additions
and
16 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
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
Binary file added
BIN
+369 KB
docs/user/resources/images/enrollment-dash-tei-profile-widget-delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
68 changes: 68 additions & 0 deletions
68
src/core_modules/capture-core/components/Buttons/OverflowButton.component.js
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,68 @@ | ||
// @flow | ||
import * as React from 'react'; | ||
import { useRef, useState } from 'react'; | ||
import { Button, Layer, Popper } from '@dhis2/ui'; | ||
|
||
type Props = { | ||
label?: string, | ||
primary?: boolean, | ||
secondary?: boolean, | ||
icon?: React.Node, | ||
onClick?: () => void, | ||
open?: boolean, | ||
component: React.Node, | ||
dataTest?: string, | ||
small?: boolean, | ||
large?: boolean, | ||
className: string, | ||
}; | ||
|
||
export const OverflowButton = ({ | ||
label, | ||
primary, | ||
secondary, | ||
small, | ||
large, | ||
onClick: handleClick, | ||
open: propsOpen, | ||
icon, | ||
dataTest, | ||
component, | ||
className, | ||
}: Props) => { | ||
const [isOpen, setIsOpen] = useState(false); | ||
const anchorRef = useRef(null); | ||
const open = propsOpen !== undefined ? propsOpen : isOpen; | ||
|
||
const toggle = () => { | ||
if (propsOpen === undefined) { | ||
setIsOpen(prev => !prev); | ||
} | ||
handleClick && handleClick(); | ||
}; | ||
|
||
return ( | ||
<div ref={anchorRef}> | ||
<Button | ||
primary={primary} | ||
secondary={secondary} | ||
dataTest={dataTest} | ||
small={small} | ||
large={large} | ||
onClick={toggle} | ||
icon={icon} | ||
className={className} | ||
> | ||
{label} | ||
</Button> | ||
|
||
{open && ( | ||
<Layer onBackdropClick={toggle} transparent> | ||
<Popper reference={anchorRef} placement="bottom-end"> | ||
{component} | ||
</Popper> | ||
</Layer> | ||
)} | ||
</div> | ||
); | ||
}; |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
// @flow | ||
export { SimpleSplitButton } from './SimpleSplitButton.component'; | ||
export { OverflowButton } from './OverflowButton.component'; |
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
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
Oops, something went wrong.