1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-09 00:00:01 +01:00

scenario: we shouldnt make any assumptions in the frontend on how an IC will use any files. This is IC specific behaviour.

This commit is contained in:
Steffen Vogel 2021-03-08 14:56:48 +01:00
parent 0da8791056
commit 72fb224bb6

View file

@ -580,22 +580,18 @@ class Scenario extends React.Component {
* File modification methods
############################################## */
getListOfFiles(fileIDs, types) {
let fileList = '';
getListOfFiles(files, fileIDs) {
let fileList = [];
for (let id of fileIDs) {
for (let file of this.state.files) {
if (file.id === id && types.some(e => file.type.includes(e))) {
if (fileList === '') {
fileList = file.name
} else {
fileList = fileList + ';' + file.name;
}
for (let file of files) {
if (file.id === id) {
fileList.push(file.name)
}
}
}
return fileList;
return fileList.join(';');
}
/* ##############################################
@ -837,13 +833,14 @@ class Scenario extends React.Component {
checkboxDisabled={(index) => !this.usesExternalIC(index)}
onChecked={(index, event) => this.onConfigChecked(index, event)}
width='30' />
<TableColumn title='Name' dataKey='name' />
<TableColumn title='Configuration file(s)' dataKey='fileIDs' modifier={(fileIDs) => this.getListOfFiles(fileIDs, ['json', 'JSON'])} />
<TableColumn
title='Model file(s)'
title='Name'
dataKey='name'
/>
<TableColumn
title='Files'
dataKey='fileIDs'
modifier={(fileIDs) => this.getListOfFiles(fileIDs, ['xml'])}
editButton
modifier={(fileIDs) => this.getListOfFiles(this.state.files, fileIDs)}
onEdit={(index) => this.startPintura(index)}
/>
<TableColumn