Skip to content

Commit

Permalink
[ML] Pass id only to clone action.
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Feb 18, 2020
1 parent b1d03d0 commit 8bd67d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ import {
AuthorizationContext,
} from '../../../../lib/authorization';

import { TransformListRow } from '../../../../common';

import { CLIENT_BASE_PATH, SECTION_SLUG } from '../../../../constants';

interface CloneActionProps {
item: TransformListRow;
itemId: string;
}

export const CloneAction: FC<CloneActionProps> = ({ item }) => {
export const CloneAction: FC<CloneActionProps> = ({ itemId }) => {
const history = useHistory();

const { canCreateTransform } = useContext(AuthorizationContext).capabilities;
Expand All @@ -32,7 +30,7 @@ export const CloneAction: FC<CloneActionProps> = ({ item }) => {
});

function clickHandler() {
history.push(`${CLIENT_BASE_PATH}/${SECTION_SLUG.CLONE_TRANSFORM}/${item.id}`);
history.push(`${CLIENT_BASE_PATH}/${SECTION_SLUG.CLONE_TRANSFORM}/${itemId}`);
}

const cloneButton = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const getActions = ({ forceDisable }: { forceDisable: boolean }) => {
},
{
render: (item: TransformListRow) => {
return <CloneAction item={item} />;
return <CloneAction itemId={item.id} />;
},
},
{
Expand Down

0 comments on commit 8bd67d8

Please sign in to comment.