TagSpaces is an offline, open source, document manager with tagging support
Merge remote-tracking branch 'remotes/origin/develop' into TSN411-Migration-to-MUI-treeview-component
stanimir41ec6ec5c8fc
diff --cc app/components/LocationManager.tsxindex 53a063dd0,6edfda69c..f8276d336--- a/app/components/LocationManager.tsx+++ b/app/components/LocationManager.tsx@@@ -72,9 -75,9 +72,10 @@@ import i18n from '../services/i18n'import AppConfig from '../config';import PlatformIO from '../services/platform-io';import TargetMoveFileBox from './TargetMoveFileBox';+ import TargetTableMoveFileBox from './TargetTableMoveFileBox';import DragItemTypes from './DragItemTypes';import IOActions from '../reducers/io-actions';+import DirectoryTreeView from '-/components/DirectoryTreeView';const isLocationsReadOnly = window.ExtLocationsReadOnly;@@@ -336,15 -489,21 +338,16 @@@ class LocationManager extends React.Com});};+ //todo https://stackoverflow.com/questions/37949981/call-child-method-from-parent+ //const directoryTreeRef = useRef();+handleLocationClick = (location: Location) => {+ this.directoryTreeRef[location.uuid].changeLocation(location);if (location.uuid === this.props.currentLocationId) {- if (this.state.dirs[location.uuid] !== undefined) {- const dirsTree = this.state.dirs;- dirsTree[location.uuid] = undefined;- this.setState({- dirs: dirsTree- });- } else {- this.loadSubDirectories(location, 1);- }this.props.loadDirectoryContent(location.paths[0]);} else {+ //this.directoryTreeRef[location.uuid].loadSubDir(location, 1);+ this.props.setSelectedEntries([]);- this.loadSubDirectories(location, 1);this.props.openLocation(location);this.state.locationRootPath = location.paths[0];if (this.props.hideDrawer) {@@@ -387,21 -546,21 +390,17 @@@children,props: {}};- };+ };*/++ /*handleCellClick = (record, index) => ({- /!* onContextMenu: (e) => {- this.handleFileContextMenu(e, record.path);- }, *!/+- handleCellClick = (record, index) => ({- /* onContextMenu: (e) => {- this.handleFileContextMenu(e, record.path);- }, */onClick: () => {this.onRowClick(record);}- /!* onDoubleClick: (e) => {- /* onDoubleClick: (e) => {-- this.onRowClick(record, index, e);- } *!/- } */- });+- onExpand = (expanded, record) => {+ });*/++ /*onExpand = (expanded, record) => {// console.log('onExpand', expanded + JSON.stringify(record));if (expanded) {// this.onRowClick(record);@@@ -472,11 -649,47 +489,47 @@@// <Tooltip id="tooltip-icon" title={i18n.t('core:moreOperations')} placement="bottom"></Tooltip>renderLocation = (location: Location) => {- let table;+ /* if (this.directoryTreeRef[location.uuid] === undefined) {+ this.directoryTreeRef[location.uuid] = React.createRef();+ }*/const isCloudLocation = location.type === locationType.TYPE_CLOUD;-- if (this.state.dirs[location.uuid] !== undefined) {++ /* if (this.state.dirs[location.uuid] !== undefined) {+ const columns = [+ {+ title: undefined,+ dataIndex: 'name',+ key: 'name',+ width: '80%',+ render: this.renderNameColumnAction,+ onCell: this.handleCellClick+ }+ ];+ table = (+ <Table+ // defaultExpandAllRows+ // className={classes.locationListArea}+ components={{+ // header: { cell: this.renderHeaderRow },+ body: { row: this.renderBodyRow }+ }}+ showHeader={false}+ // className="table"+ rowKey="path"+ data={this.state.dirs[location.uuid]}+ columns={columns}+ indentSize={20}+ // expandedRowRender={this.expandedRowRender}+ expandable={{ onExpand: this.onExpand }}+ // expandIcon={this.CustomExpandIcon}+ // expandIconAsCell- /* onRow={(record, index) => ({- onClick: this.onRowClick.bind(null, record, index),- })} */+++ onRow={(record, index) => ({+ index,+ location: record+ })}+ />+ );- }++ } */return (<div key={location.uuid}><ListItem