Skip to content
Snippets Groups Projects
Commit 0d723504 authored by Sandro Weber's avatar Sandro Weber
Browse files

separated maps, check upload again

parent 4ba6fddf
No related branches found
No related tags found
No related merge requests found
...@@ -47,7 +47,7 @@ export default class ExperimentFilesViewer extends React.Component { ...@@ -47,7 +47,7 @@ export default class ExperimentFilesViewer extends React.Component {
if (file.localOnly) { if (file.localOnly) {
className += ' file-local-only'; className += ' file-local-only';
} }
if (!file.fileSystemHandle) { if (!RemoteExperimentFilesService.instance.mapLocalFiles.has(file.relativePath)) {
className += ' file-server-only'; className += ' file-server-only';
} }
className = className.trim(); className = className.trim();
...@@ -64,7 +64,7 @@ export default class ExperimentFilesViewer extends React.Component { ...@@ -64,7 +64,7 @@ export default class ExperimentFilesViewer extends React.Component {
if (this.state.selectedExperiment && this.state.selectedExperiment.id === experiment.id) { if (this.state.selectedExperiment && this.state.selectedExperiment.id === experiment.id) {
className += ' experiments-li-selected'; className += ' experiments-li-selected';
} }
if (!RemoteExperimentFilesService.instance.localFiles.has(experiment.id)) { if (!RemoteExperimentFilesService.instance.mapFileInfos.has(experiment.uuid)) {
className += ' experiments-li-disabled'; className += ' experiments-li-disabled';
} }
...@@ -74,19 +74,19 @@ export default class ExperimentFilesViewer extends React.Component { ...@@ -74,19 +74,19 @@ export default class ExperimentFilesViewer extends React.Component {
getInfoText() { getInfoText() {
return (<div> return (<div>
{this.state.selectedFilepaths && this.state.selectedFilepaths.map(filePath => { {this.state.selectedFilepaths && this.state.selectedFilepaths.map(filePath => {
let file = RemoteExperimentFilesService.instance.localFiles.get(filePath); let fileInfo = RemoteExperimentFilesService.instance.mapFileInfos.get(filePath);
if (file) { if (fileInfo) {
return (<div key={file.relativePath} className="fileinfo-group"> return (<div key={fileInfo.relativePath} className="fileinfo-group">
<div className="fileinfo-name">{file.name}</div> <div className="fileinfo-name">{fileInfo.name}</div>
{file.msgWarning && <div className="fileinfo-entry">{'Warning: ' + file.msgWarning}</div>} {fileInfo.msgWarning && <div className="fileinfo-entry">{'Warning: ' + fileInfo.msgWarning}</div>}
{file.msgError && <div className="fileinfo-entry">{'Error: ' + file.msgError}</div>} {fileInfo.msgError && <div className="fileinfo-entry">{'Error: ' + fileInfo.msgError}</div>}
{file.localOnly && <div className="fileinfo-entry">{'File exists only locally.'}</div>} {fileInfo.localOnly && <div className="fileinfo-entry">{'File exists only locally.'}</div>}
{file.hasLocalChanges && {fileInfo.serverOnly &&
<div className="fileinfo-entry">{'File exists only on server.'}</div>}
{fileInfo.hasLocalChanges &&
<div className="fileinfo-entry">{'File has local changes not synced with server.'}</div>} <div className="fileinfo-entry">{'File has local changes not synced with server.'}</div>}
{file.isOutOfSync && {fileInfo.isOutOfSync &&
<div className="fileinfo-entry">{'File on server has newer changes.'}</div>} <div className="fileinfo-entry">{'File on server has newer changes.'}</div>}
{!file.fileSystemHandle &&
<div className="fileinfo-entry">{'File exists on server but not locally.'}</div>}
</div>); </div>);
} }
else { else {
...@@ -98,7 +98,7 @@ export default class ExperimentFilesViewer extends React.Component { ...@@ -98,7 +98,7 @@ export default class ExperimentFilesViewer extends React.Component {
render() { render() {
let selectedExperimentFiles = this.state.selectedExperiment ? let selectedExperimentFiles = this.state.selectedExperiment ?
RemoteExperimentFilesService.instance.localFiles.get(this.state.selectedExperiment.id) : undefined; RemoteExperimentFilesService.instance.mapFileInfos.get(this.state.selectedExperiment.uuid) : undefined;
return ( return (
<div> <div>
...@@ -157,8 +157,8 @@ export default class ExperimentFilesViewer extends React.Component { ...@@ -157,8 +157,8 @@ export default class ExperimentFilesViewer extends React.Component {
<ol className='experiment-files-list'> <ol className='experiment-files-list'>
{this.props.experiments.map(experiment => { {this.props.experiments.map(experiment => {
let experimentServerFiles = RemoteExperimentFilesService.instance let experimentServerFiles = RemoteExperimentFilesService.instance
.serverFiles.get(experiment.id); .mapServerFiles.get(experiment.uuid);
let experimentLocalFiles = RemoteExperimentFilesService.instance.localFiles.get(experiment.uuid); let experimentLocalFiles = RemoteExperimentFilesService.instance.mapLocalFiles.get(experiment.uuid);
return ( return (
<li key={experiment.id || experiment.configuration.id} <li key={experiment.id || experiment.configuration.id}
...@@ -184,7 +184,7 @@ export default class ExperimentFilesViewer extends React.Component { ...@@ -184,7 +184,7 @@ export default class ExperimentFilesViewer extends React.Component {
</button> </button>
<button className='nrp-btn' <button className='nrp-btn'
disabled={!experimentServerFiles disabled={!experimentServerFiles
|| !RemoteExperimentFilesService.instance.localFiles.has(experiment.uuid)} || !RemoteExperimentFilesService.instance.mapLocalFiles.has(experiment.uuid)}
onClick={() => { onClick={() => {
RemoteExperimentFilesService.instance.uploadExperimentFromLocalFS(experiment); RemoteExperimentFilesService.instance.uploadExperimentFromLocalFS(experiment);
}} }}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment