Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
187 changes: 0 additions & 187 deletions docs/features/access-control.md

This file was deleted.

165 changes: 0 additions & 165 deletions docs/features/multi-tenancy.md

This file was deleted.

16 changes: 16 additions & 0 deletions lib/Controller/ConfigurationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,12 @@ public function import(): JSONResponse
$configuration->setOwner($this->request->getParam('owner') ?? $this->userId);
$configuration->setCreated(new DateTime());
$configuration->setUpdated(new DateTime());
$configuration->setRegisters([]);
$configuration->setSchemas([]);
$configuration->setObjects([]);

// Persist the configuration entity so it appears in the configurations list.
$configuration = $this->configurationMapper->insert($configuration);

// Import the data.
$force = $this->request->getParam('force') === 'true' || $this->request->getParam('force') === true;
Expand All @@ -410,6 +416,16 @@ public function import(): JSONResponse
force: $force
);

// Link the imported registers, schemas and objects to the configuration.
$registerIds = array_map(static fn($r) => $r->getId(), $result['registers']);
$schemaIds = array_map(static fn($s) => $s->getId(), $result['schemas']);
$objectIds = array_map(static fn($o) => $o->getId(), $result['objects']);

$configuration->setRegisters(array_values(array_unique($registerIds)));
$configuration->setSchemas(array_values(array_unique($schemaIds)));
$configuration->setObjects(array_values(array_unique($objectIds)));
$this->configurationMapper->update($configuration);

return new JSONResponse(
data: [
'message' => 'Import successful',
Expand Down
Loading
Loading