Skip to content
Snippets Groups Projects
Commit 877d48d4 authored by vkovtun's avatar vkovtun
Browse files

SSDM-13579: Working on copying/moving. Added fetching of folders.

parent cf528103
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
......@@ -378,7 +378,7 @@ DataStoreServer.prototype.list = function(owner, source, recursively, action){
* Read the contents of selected file
* @param {str} owner owner of the file
* @param {str} source path to file
* @param {int} offset offset from whoch to start reading
* @param {int} offset offset from which to start reading
* @param {int} limit how many characters to read
* @param {*} action post-processing action
*/
......
......@@ -20,7 +20,7 @@ class DatabaseComponent extends React.PureComponent {
const { object } = this.props
let json = null
let showDataBrowser = false;
let showDataBrowser = false
if (object.type === objectType.SPACE) {
const spaces = await openbis.getSpaces(
[new openbis.SpacePermId(object.id)],
......@@ -39,7 +39,7 @@ class DatabaseComponent extends React.PureComponent {
new openbis.ExperimentFetchOptions()
)
json = experiments[object.id]
showDataBrowser = true;
showDataBrowser = true
} else if (object.type === objectType.OBJECT) {
const fetchOptions = new openbis.SampleFetchOptions()
fetchOptions.withSpace()
......@@ -51,7 +51,7 @@ class DatabaseComponent extends React.PureComponent {
fetchOptions
)
json = samples[object.id]
showDataBrowser = true;
showDataBrowser = true
} else if (object.type === objectType.DATA_SET) {
const fetchOptions = new openbis.DataSetFetchOptions()
fetchOptions.withExperiment()
......
......@@ -162,14 +162,13 @@ class DataBrowser extends React.Component {
}
render() {
const { classes } = this.props
const { classes, sessionToken } = this.props
const {
viewType,
files,
selectedFile,
multiselectedFiles,
showInfo,
sessionToken,
path
} = this.state
......
......@@ -53,6 +53,11 @@ export default class DataBrowserController extends ComponentController {
return files.map(file => ({ id: file.name, ...file }))
}
async loadFolders() {
const files = await this.listFiles()
return files.filter(file => file.directory).map(file => ({ id: file.name, ...file }))
}
async createNewFolder(name) {
return new Promise((resolve, reject) => {
this.component.datastoreServer.create(this.owner, this.path + name, true, async (success) => {
......
......@@ -33,7 +33,7 @@ class ItemIcon extends React.Component {
super(props, context)
autoBind(this)
const { configuration } = this.props
const configuration = this.props.configuration || []
this.extensionToIconType = new Map(
configuration.flatMap(configObject =>
......
......@@ -197,7 +197,7 @@ class LeftToolbar extends React.Component {
multiselectedFiles,
datastoreServer,
sessionToken,
path: path
path
} = this.props
const { width, hiddenButtonsPopup, deleteDialogOpen } = this.state
......
......@@ -159,7 +159,6 @@ class LocationDialog extends React.Component {
<ItemIcon
file={row}
classes={{ icon: classes.icon }}
configuration={configuration}
/>
<span>{row.name}</span>
</div>
......@@ -167,7 +166,7 @@ class LocationDialog extends React.Component {
renderFilter: null
}
]}
loadRows={this.controller.load}
loadRows={this.controller.loadFolders}
exportable={false}
selectable={false}
multiselectable={false}
......
......@@ -50,7 +50,7 @@ class Toolbar extends React.Component {
logger.log(logger.DEBUG, 'Toolbar.render')
const {
viewType: viewType,
viewType,
onViewTypeChange,
classes,
showInfo,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment