diff --git a/frontend/src/components/share-link-panel/link-item.js b/frontend/src/components/share-link-panel/link-item.js index f7256762d7..fc8608f5eb 100644 --- a/frontend/src/components/share-link-panel/link-item.js +++ b/frontend/src/components/share-link-panel/link-item.js @@ -43,22 +43,32 @@ class LinkItem extends React.Component { return link.slice(0, 9) + '...' + link.slice(length-5); } + onDeleteIconClicked = (e) => { + e.preventDefault(); + e.stopPropagation(); + this.toggleDeleteShareLinkDialog(); + } + toggleDeleteShareLinkDialog = () => { this.setState({isDeleteShareLinkDialogOpen: !this.state.isDeleteShareLinkDialogOpen}); } - copyLink = (e) => { + onCopyIconClicked = (e) => { e.preventDefault(); + e.stopPropagation(); const { item } = this.props; copy(item.link); toaster.success(gettext('Share link is copied to the clipboard.')); } - viewDetails = (e) => { - e.preventDefault(); + clickItem = (e) => { this.props.showLinkDetails(this.props.item); } + onCheckboxClicked = (e) => { + e.stopPropagation(); + } + toggleSelectLink = (e) => { const { item } = this.props; this.props.toggleSelectLink(item, e.target.checked); @@ -76,12 +86,23 @@ class LinkItem extends React.Component { const currentPermission = Utils.getShareLinkPermissionStr(permissions); return ( - + - + - {this.cutLink(link)} + {this.cutLink(link)} {(isPro && permissions) && ( @@ -98,9 +119,8 @@ class LinkItem extends React.Component { {expire_date ? moment(expire_date).format('YYYY-MM-DD HH:mm') : '--'} - - - + + {this.state.isDeleteShareLinkDialogOpen && ( diff --git a/frontend/src/components/share-link-panel/link-list.js b/frontend/src/components/share-link-panel/link-list.js index 482d5375a7..b28b230212 100644 --- a/frontend/src/components/share-link-panel/link-list.js +++ b/frontend/src/components/share-link-panel/link-list.js @@ -80,10 +80,10 @@ class LinkList extends React.Component { - {gettext('Link')} + {gettext('Link')} {gettext('Permission')} - {gettext('Expiration')} - + {gettext('Expiration')} +