ryohek 5 лет назад
Родитель
Сommit
0c29e42e1b

+ 3 - 1
src/client/js/components/OutsideShareLinkModal.jsx

@@ -87,7 +87,8 @@ class OutsideShareLinkModal extends React.Component {
   }
 
   render() {
-    const { t } = this.props;
+    const { t, pageContainer } = this.props;
+    const { path } = pageContainer.state;
     return (
       <Modal size="lg" isOpen={this.props.isOpen} toggle={this.props.onClose}>
         <ModalHeader tag="h4" toggle={this.props.onClose} className="bg-primary text-light">{t('share_links.Shere this page link to public')}
@@ -103,6 +104,7 @@ class OutsideShareLinkModal extends React.Component {
               <ShareLinkList
                 shareLinks={this.state.shareLinks}
                 onClickDeleteButton={this.deleteLinkById}
+                pagePath={path}
               />
               <button
                 className="btn btn-outline-secondary d-block mx-auto px-5 mb-3"

+ 2 - 1
src/client/js/components/ShareLinkList.jsx

@@ -27,7 +27,7 @@ const ShareLinkList = (props) => {
           <tr key={shareLink._id}>
             <td className="d-flex justify-content-between align-items-center">
               <span>{shareLink._id}</span>
-              <CopyDropdown isShareLinkMode="true" shareLinkId={shareLink._id} pageId={shareLink.relatedPage} />
+              <CopyDropdown isShareLinkMode="true" shareLinkId={shareLink._id} pageId={shareLink.relatedPage} pagePath={props.pagePath} />
             </td>
             <td>{shareLink.expiredAt && <span>{dateFnsFormat(new Date(shareLink.expiredAt), 'yyyy-MM-dd HH:mm')}</span>}</td>
             <td>{shareLink.description}</td>
@@ -66,6 +66,7 @@ const ShareLinkListWrapper = withUnstatedContainers(ShareLinkList, [AppContainer
 ShareLinkList.propTypes = {
   t: PropTypes.func.isRequired, //  i18next
   appContainer: PropTypes.instanceOf(AppContainer).isRequired,
+  pagePath: PropTypes.string.isRequired,
 
   shareLinks: PropTypes.array.isRequired,
   onClickDeleteButton: PropTypes.func,