1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 14:42:10 +00:00

['library view' page] added 'copy path' for the current folder (#8013)

This commit is contained in:
llj
2025-07-07 18:27:49 +08:00
committed by GitHub
parent f978509913
commit 0be15caaa0

View File

@@ -1,10 +1,11 @@
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import copy from 'copy-to-clipboard';
import { Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';
import { Utils } from '../../utils/utils';
import { seafileAPI } from '../../utils/seafile-api';
import { enableExcalidraw, enableSeadoc, enableWhiteboard, gettext } from '../../utils/constants';
import toaster from '../toast';
import { seafileAPI } from '../../utils/seafile-api';
import TipDialog from '../dialog/tip-dailog';
import { EVENT_BUS_TYPE } from '../common/event-bus-type';
@@ -64,6 +65,15 @@ class DirOperationToolbar extends React.Component {
eventBus.dispatch(EVENT_BUS_TYPE.SHARE_FILE, path, { type, name, permission: userPerm });
};
copyPath = () => {
const { path } = this.props;
copy(path);
const message = gettext('The path has been copied to the clipboard');
toaster.success((message), {
duration: 2
});
};
onCreateFolder = () => {
const { eventBus, path, direntList } = this.props;
eventBus.dispatch(EVENT_BUS_TYPE.CREATE_FOLDER, path, direntList);
@@ -220,6 +230,12 @@ class DirOperationToolbar extends React.Component {
});
}
opList.push({
'icon': 'copy1',
'text': gettext('Copy path'),
'onClick': this.copyPath
});
if (enableSeadoc && !repoEncrypted) {
opList.push('Divider', {
'icon': 'import-sdoc',