mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-20 19:08:21 +00:00
Add internal links to the dir (#3947)
* Add internal links to the dir * Indent style
This commit is contained in:
@@ -10,6 +10,7 @@ import { Utils } from '../../utils/utils';
|
||||
const propTypes = {
|
||||
path: PropTypes.string.isRequired,
|
||||
repoID: PropTypes.string.isRequired,
|
||||
direntType: PropTypes.string
|
||||
};
|
||||
|
||||
class InternalLink extends React.Component {
|
||||
@@ -21,9 +22,8 @@ class InternalLink extends React.Component {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
let repoID = this.props.repoID;
|
||||
let path = this.props.path;
|
||||
seafileAPI.getInternalLink(repoID, path).then(res => {
|
||||
let { repoID, path, direntType } = this.props;
|
||||
seafileAPI.getInternalLink(repoID, path, direntType).then(res => {
|
||||
this.setState({
|
||||
smartLink: res.data.smart_link
|
||||
});
|
||||
|
@@ -76,7 +76,7 @@ class ShareDialog extends React.Component {
|
||||
}
|
||||
|
||||
let activeTab = this.state.activeTab;
|
||||
const {repoEncrypted, userPerm, enableDirPrivateShare} = this.props;
|
||||
const {repoEncrypted, userPerm, enableDirPrivateShare, itemType} = this.props;
|
||||
const enableShareLink = !repoEncrypted && canGenerateShareLink;
|
||||
const enableUploadLink = !repoEncrypted && canGenerateUploadLink && userPerm == 'rw';
|
||||
|
||||
@@ -98,6 +98,11 @@ class ShareDialog extends React.Component {
|
||||
</NavLink>
|
||||
</NavItem>
|
||||
}
|
||||
<NavItem>
|
||||
<NavLink className={activeTab === 'internalLink' ? 'active' : ''} onClick={this.toggle.bind(this, 'internalLink')}>
|
||||
{gettext('Internal Link')}
|
||||
</NavLink>
|
||||
</NavItem>
|
||||
{enableDirPrivateShare &&
|
||||
<Fragment>
|
||||
<NavItem>
|
||||
@@ -134,6 +139,13 @@ class ShareDialog extends React.Component {
|
||||
/>
|
||||
</TabPane>
|
||||
}
|
||||
<TabPane tabId="internalLink">
|
||||
<InternalLink
|
||||
path={this.props.itemPath}
|
||||
repoID={this.props.repoID}
|
||||
direntType={itemType}
|
||||
/>
|
||||
</TabPane>
|
||||
{enableDirPrivateShare &&
|
||||
<Fragment>
|
||||
<TabPane tabId="shareToUser">
|
||||
|
Reference in New Issue
Block a user