Commit be5db55d authored by François Agneray's avatar François Agneray
Browse files

#53 => done

parent 8d543619
Pipeline #2427 passed with stages
in 7 minutes and 28 seconds
......@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- #44: Adding the doctrine production mode (see readme)
- #52: Changing metamodel attribute table (uri_action field deleted and renderer_config field added)
- #53: Changing metamodel dataset table (add config field)
### Deprecated
- For soon-to-be removed features.
......
......@@ -65,6 +65,7 @@ final class DatasetAction extends AbstractAction
'vo',
'data_path',
'selectable_row',
'config',
'id_dataset_family'
);
foreach ($fields as $a) {
......@@ -117,6 +118,7 @@ final class DatasetAction extends AbstractAction
$dataset->setVo($parsedBody['vo']);
$dataset->setDataPath($parsedBody['data_path']);
$dataset->setSelectableRow($parsedBody['selectable_row']);
$dataset->setConfig($parsedBody['config']);
$this->em->flush();
}
}
......@@ -84,6 +84,7 @@ final class DatasetListAction extends AbstractAction
'vo',
'data_path',
'selectable_row',
'config',
'project_name'
);
foreach ($fields as $a) {
......@@ -136,6 +137,7 @@ final class DatasetListAction extends AbstractAction
$dataset->setVo($parsedBody['vo']);
$dataset->setDataPath($parsedBody['data_path']);
$dataset->setSelectableRow($parsedBody['selectable_row']);
$dataset->setConfig($parsedBody['config']);
$dataset->setProject($project);
$dataset->setDatasetFamily($datasetFamily);
......
......@@ -83,6 +83,13 @@ class Dataset implements \JsonSerializable
* @Column(type="boolean", name="selectable_row", nullable=false)
*/
protected $selectableRow;
/**
* @var string
*
* @Column(type="json", nullable=true)
*/
protected $config;
/**
* @var Anis\Entity\Project
......@@ -198,6 +205,16 @@ class Dataset implements \JsonSerializable
$this->selectableRow = $selectableRow;
}
public function getConfig()
{
return $this->config;
}
public function setConfig($config)
{
$this->config = $config;
}
public function getProject()
{
return $this->project;
......@@ -235,6 +252,7 @@ class Dataset implements \JsonSerializable
'vo' => $this->getVo(),
'data_path' => $this->getDataPath(),
'selectable_row' => $this->getSelectableRow(),
'config' => $this->getConfig(),
'project_name' => $this->getProject()->getName(),
'id_dataset_family' => $this->getDatasetFamily()->getId()
];
......
......@@ -135,6 +135,7 @@ final class DatasetActionTest extends TestCase
'vo' => false,
'data_path' => '/mnt/dataset1',
'selectable_row' => false,
'config' => '{}',
'id_dataset_family' => 1
);
}
......
......@@ -126,6 +126,7 @@ final class DatasetListActionTest extends TestCase
'vo' => false,
'data_path' => '/mnt/dataset1',
'selectable_row' => false,
'config' => '{}',
'project_name' => 'anis_project',
'id_dataset_family' => 1
);
......
Markdown is supported
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