diff --git a/frontend/src/components/shared-repo-list-view/shared-repo-list-item.js b/frontend/src/components/shared-repo-list-view/shared-repo-list-item.js index b575759df1..09854e2ec8 100644 --- a/frontend/src/components/shared-repo-list-view/shared-repo-list-item.js +++ b/frontend/src/components/shared-repo-list-view/shared-repo-list-item.js @@ -5,6 +5,8 @@ import { Dropdown, DropdownMenu, DropdownToggle, DropdownItem } from 'reactstrap import { Link } from '@reach/router'; import { Utils } from '../../utils/utils'; import { gettext, siteRoot, isPro, username, folderPermEnabled } from '../../utils/constants'; +import ModalPotal from '../../components/modal-portal'; +import ShareDialog from '../../components/dialog/share-dialog'; const propTypes = { currentGroup: PropTypes.object, @@ -22,6 +24,7 @@ class SharedRepoListItem extends React.Component { highlight: false, isOperationShow: false, isItemMenuShow: false, + isShowSharedDialog: false, }; this.isDeparementOnwerGroupMember = false; } @@ -109,7 +112,7 @@ class SharedRepoListItem extends React.Component { this.onItemDetails(); break; case 'Share': - this.onItemShared(); + this.onItemShare(); break; case 'Unshare': this.onItemUnshare(); @@ -133,6 +136,7 @@ class SharedRepoListItem extends React.Component { onItemShare = () => { // todo + this.setState({isShowSharedDialog: true}); } onItemUnshare = () => { @@ -144,6 +148,10 @@ class SharedRepoListItem extends React.Component { // todo } + toggleShareDialog = () => { + this.setState({isShowSharedDialog: false}); + } + generatorOperations = () => { let { repo, currentGroup } = this.props; //todo this have a bug; use current api is not return admins param; @@ -217,7 +225,7 @@ class SharedRepoListItem extends React.Component { // scene one: (share, delete, itemToggle and other operations); // scene two: (share, unshare), (share), (unshare) let operations = this.generatorOperations(); - const shareOperation = ; + const shareOperation = ; const unshareOperation = const deleteOperation = ; @@ -267,14 +275,27 @@ class SharedRepoListItem extends React.Component { let { iconUrl, iconTitle, libPath } = this.getRepoComputeParams(); let { repo } = this.props; return ( -