Skip to content

Commit

Permalink
removing copy functionality from table
Browse files Browse the repository at this point in the history
  • Loading branch information
Agrim Jain authored and Agrim Jain committed May 20, 2024
1 parent fbff6e0 commit ac9fbd9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,7 @@ const ApiTokenCell = ({ cell }: React.PropsWithChildren<CellProps<TTokenType, st

return (
<div data-testid={'token-cell'} className={styles.token_cell}>
<div>{is_hiding_token ? <HiddenToken /> : cell.value}</div>
<CopyButton has_admin={has_admin_scope} value={token} />
<button
onClick={() => setIsHidingToken(!is_hiding_token)}
className={styles.eye_button}
data-testid='eye-button'
style={{
backgroundImage: is_hiding_token ? 'url(/img/eye_closed.svg)' : 'url(/img/eye_open.svg)',
}}
/>
<div>{cell.value}</div>
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export const TokenCreationDialogSuccess = ({
setToggleModal(false);
};

const latestToken = tokens && tokens.length > 0 ? tokens[0] : null;
const latestTokenLength = tokens && tokens.length - 1;
const latestToken = tokens && tokens.length > 0 ? tokens[latestTokenLength].token : null;

return (
<Modal defaultOpen onOpenChange={onOpenChange}>
Expand All @@ -45,9 +46,7 @@ export const TokenCreationDialogSuccess = ({
</p>
</div>

<span className={styles.textField}>
{latestToken && latestToken?.scopes?.includes('admin') && latestToken.token}
</span>
<span className={styles.textField}>{latestToken && latestToken}</span>

<div className={styles.buttonWrapper}>
<Button color='primary' onClick={handleToggle} className={styles.btn}>
Expand Down

0 comments on commit ac9fbd9

Please sign in to comment.