1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-07 09:51:26 +00:00

Add internal links to the dir (#3947)

* Add internal links to the dir

* Indent style
This commit is contained in:
zxj96
2019-08-05 17:31:15 +08:00
committed by Daniel Pan
parent affa4f8d12
commit c7933c7f63
4 changed files with 20 additions and 8 deletions

View File

@@ -11325,9 +11325,9 @@
}
},
"seafile-js": {
"version": "0.2.110",
"resolved": "https://registry.npmjs.org/seafile-js/-/seafile-js-0.2.110.tgz",
"integrity": "sha512-h9Nc/cnUdg4u9TVpTSDMcBZY+xY1B/HRaruZlLqu9TluoCQeXD2lij3KG+yXS1aPgAfEg2gfCMWbDGw9QneE+g==",
"version": "0.2.111",
"resolved": "https://registry.npmjs.org/seafile-js/-/seafile-js-0.2.111.tgz",
"integrity": "sha512-PsaU3VUledLrs8guKRm0nJ99s0g3bgQmpvIb00b1ESjdsgRIcyvQsgCrG3fTJQYn+fMdGJaSP1tiDbuOZLoqrA==",
"requires": {
"axios": "^0.18.0",
"form-data": "^2.3.2",

View File

@@ -36,7 +36,7 @@
"react-responsive": "^6.1.2",
"react-select": "^2.4.1",
"reactstrap": "^6.4.0",
"seafile-js": "^0.2.110",
"seafile-js": "^0.2.111",
"socket.io-client": "^2.2.0",
"sw-precache-webpack-plugin": "0.11.4",
"unified": "^7.0.0",

View File

@@ -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
});

View File

@@ -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">