forked from openmrs/openmrs-esm-stock-management
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ft : edit user role scope (openmrs#44)
- Loading branch information
Showing
5 changed files
with
87 additions
and
28 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
35 changes: 35 additions & 0 deletions
35
...ck-user-role-scopes/edit-stock-user-scope/edit-stock-user-scope-action-menu.component.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,35 @@ | ||
import { Button } from "@carbon/react"; | ||
import { Edit } from "@carbon/react/icons"; | ||
|
||
import React, { useCallback } from "react"; | ||
import { useTranslation } from "react-i18next"; | ||
import { launchOverlay } from "../../core/components/overlay/hook"; | ||
import AddStockUserRoleScope from "../add-stock-user-scope/add-stock-user-role-scope.component"; | ||
import { UserRoleScope } from "../../core/api/types/identity/UserRoleScope"; | ||
|
||
interface EditStockUserRoleActionsMenuProps { | ||
data: UserRoleScope; | ||
} | ||
|
||
const EditStockUserRoleActionsMenu: React.FC< | ||
EditStockUserRoleActionsMenuProps | ||
> = ({ data }) => { | ||
const { t } = useTranslation(); | ||
|
||
const handleClick = useCallback(() => { | ||
launchOverlay( | ||
"Edit Stock User Role", | ||
<AddStockUserRoleScope model={data} /> | ||
); | ||
}, [data]); | ||
|
||
return ( | ||
<Button | ||
kind="ghost" | ||
onClick={handleClick} | ||
iconDescription={t("editUserScope", "Edit UserScope")} | ||
renderIcon={(props) => <Edit size={16} {...props} />} | ||
/> | ||
); | ||
}; | ||
export default EditStockUserRoleActionsMenu; |
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