From b725a03ef845b49903be7512f47719658227c949 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 8 Nov 2024 15:25:06 +0000 Subject: [PATCH 01/15] Bump version to 0.1.23 --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index b11b60225c..c97a9bc2e0 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -22,7 +22,7 @@ Create a [bug report](https://github.com/OpenRegister/.github/issues/new/choose) Create a [feature request](https://github.com/OpenRegister/.github/issues/new/choose) ]]> - 0.1.22 + 0.1.23 agpl Conduction OpenRegister From dd541e010b51c29cdd5c832168a7556dfbc84cf9 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 21 Nov 2024 21:17:46 +0000 Subject: [PATCH 02/15] Bump version to 0.1.24 --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index c97a9bc2e0..61d39cd360 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -22,7 +22,7 @@ Create a [bug report](https://github.com/OpenRegister/.github/issues/new/choose) Create a [feature request](https://github.com/OpenRegister/.github/issues/new/choose) ]]> - 0.1.23 + 0.1.24 agpl Conduction OpenRegister From ad71bf4d3fced84a22adf980e2c47c2bd8ea7671 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 28 Nov 2024 13:59:39 +0000 Subject: [PATCH 03/15] Bump version to 0.1.25 --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index 61d39cd360..5c9b1eab17 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -22,7 +22,7 @@ Create a [bug report](https://github.com/OpenRegister/.github/issues/new/choose) Create a [feature request](https://github.com/OpenRegister/.github/issues/new/choose) ]]> - 0.1.24 + 0.1.25 agpl Conduction OpenRegister From 11015ae7bab7953862fe15efb2ae24fd68959ee1 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 30 Nov 2024 20:50:14 +0000 Subject: [PATCH 04/15] Bump version to 0.1.26 --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index 5c9b1eab17..4ab345abc8 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -22,7 +22,7 @@ Create a [bug report](https://github.com/OpenRegister/.github/issues/new/choose) Create a [feature request](https://github.com/OpenRegister/.github/issues/new/choose) ]]> - 0.1.25 + 0.1.26 agpl Conduction OpenRegister From 0ddb194d7785beb6bdde33f29eb78a535b874092 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 3 Dec 2024 10:34:48 +0000 Subject: [PATCH 05/15] Bump version to 0.1.27 --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index 4ab345abc8..3ed90c6008 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -22,7 +22,7 @@ Create a [bug report](https://github.com/OpenRegister/.github/issues/new/choose) Create a [feature request](https://github.com/OpenRegister/.github/issues/new/choose) ]]> - 0.1.26 + 0.1.27 agpl Conduction OpenRegister From c7a38ff8deeb99cca77fbc55d6a326fecef9ff48 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 3 Dec 2024 12:00:16 +0000 Subject: [PATCH 06/15] Bump version to 0.1.28 --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index 3ed90c6008..d3396edf08 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -22,7 +22,7 @@ Create a [bug report](https://github.com/OpenRegister/.github/issues/new/choose) Create a [feature request](https://github.com/OpenRegister/.github/issues/new/choose) ]]> - 0.1.27 + 0.1.28 agpl Conduction OpenRegister From 2332739fc70bc1c6d3fc5fbd2c5a0a15ea65196c Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 4 Dec 2024 12:51:51 +0000 Subject: [PATCH 07/15] Bump version to 0.1.29 --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index d3396edf08..d779f60c2f 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -22,7 +22,7 @@ Create a [bug report](https://github.com/OpenRegister/.github/issues/new/choose) Create a [feature request](https://github.com/OpenRegister/.github/issues/new/choose) ]]> - 0.1.28 + 0.1.29 agpl Conduction OpenRegister From 5799d7a910a60812de3c20cc2f4016eee805aaa0 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 5 Dec 2024 15:44:17 +0000 Subject: [PATCH 08/15] Bump version to 0.1.30 --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index d779f60c2f..c590e792de 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -22,7 +22,7 @@ Create a [bug report](https://github.com/OpenRegister/.github/issues/new/choose) Create a [feature request](https://github.com/OpenRegister/.github/issues/new/choose) ]]> - 0.1.29 + 0.1.30 agpl Conduction OpenRegister From 07e6dd1fd8f27cfd97d9d042c5846edebabd3fa0 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 9 Dec 2024 16:12:18 +0000 Subject: [PATCH 09/15] Bump version to 0.1.31 --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index c590e792de..16aca8e4b3 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -22,7 +22,7 @@ Create a [bug report](https://github.com/OpenRegister/.github/issues/new/choose) Create a [feature request](https://github.com/OpenRegister/.github/issues/new/choose) ]]> - 0.1.30 + 0.1.31 agpl Conduction OpenRegister From 1738cb378a0fd961fbe2c5bfe0cb06bffc5b2a52 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 19 Dec 2024 11:10:17 +0000 Subject: [PATCH 10/15] Bump version to 0.1.32 --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index 16aca8e4b3..b0801855b6 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -22,7 +22,7 @@ Create a [bug report](https://github.com/OpenRegister/.github/issues/new/choose) Create a [feature request](https://github.com/OpenRegister/.github/issues/new/choose) ]]> - 0.1.31 + 0.1.32 agpl Conduction OpenRegister From 8a8f047f58ad268964827d2761c7660f1ae2693c Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 28 Dec 2024 07:47:35 +0000 Subject: [PATCH 11/15] Bump version to 0.1.33 --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index b0801855b6..d013b1f08f 100755 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -22,7 +22,7 @@ Create a [bug report](https://github.com/OpenRegister/.github/issues/new/choose) Create a [feature request](https://github.com/OpenRegister/.github/issues/new/choose) ]]> - 0.1.32 + 0.1.33 agpl Conduction OpenRegister From a5ed54220c0561cb500738d0ed06d9734a871fa1 Mon Sep 17 00:00:00 2001 From: Ruben van der Linde Date: Tue, 31 Dec 2024 14:08:35 +0100 Subject: [PATCH 12/15] Allow extending on creation and update --- lib/Service/ObjectService.php | 56 ++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/lib/Service/ObjectService.php b/lib/Service/ObjectService.php index 32a6190cb0..1e313e6645 100755 --- a/lib/Service/ObjectService.php +++ b/lib/Service/ObjectService.php @@ -154,12 +154,13 @@ public function find(int|string $id, ?array $extend = []): ?ObjectEntity * @return ObjectEntity The created object * @throws ValidationException */ - public function createFromArray(array $object): ObjectEntity + public function createFromArray(array $object, ?array $extend = []): array { return $this->saveObject( register: $this->getRegister(), schema: $this->getSchema(), - object: $object + object: $object, + extend: $extend ); } @@ -168,12 +169,14 @@ public function createFromArray(array $object): ObjectEntity * * @param string $id The object ID to update * @param array $object The new object data - * @param bool $updatedObject Whether this is an update operation + * @param bool $updateVersion Whether this is an update operation + * @param bool $patch Whether this is a patch operation + * @param array|null $extend Properties to extend with related data * * @return ObjectEntity The updated object * @throws ValidationException */ - public function updateFromArray(string $id, array $object, bool $updatedObject, bool $patch = false): ObjectEntity + public function updateFromArray(string $id, array $object, bool $updateVersion, bool $patch = false, ?array $extend = []): array { // Add ID to object data for update $object['id'] = $id; @@ -188,7 +191,8 @@ public function updateFromArray(string $id, array $object, bool $updatedObject, return $this->saveObject( register: $this->getRegister(), schema: $this->getSchema(), - object: $object + object: $object, + extend: $extend ); } @@ -462,12 +466,13 @@ public function getObjects( * @param int $register The register to save the object to. * @param int $schema The schema to save the object to. * @param array $object The data to be saved. + * @param array|null $extend Properties to extend with related data * * @return ObjectEntity The resulting object. * @throws ValidationException When the validation fails and returns an error. * @throws Exception */ - public function saveObject(int $register, int $schema, array $object): ObjectEntity + public function saveObject(int $register, int $schema, array $object, ?array $extend = []): array { // Remove system properties (starting with _) $object = array_filter($object, function($key) { @@ -536,6 +541,14 @@ public function saveObject(int $register, int $schema, array $object): ObjectEnt $this->auditTrailMapper->createAuditTrail(new: $objectEntity); } + // Lets turn the whole thing into an array + $objectEntity = $objectEntity->jsonSerialize(); + + // Extend object with properties if requested + if (empty($extend) === false) { + $objectEntity = $this->extendEntity(entity: $objectEntity, extend: $extend); + } + return $objectEntity; } @@ -1099,18 +1112,27 @@ public function getRegisters(): array // Get all registers $registers = $this->registerMapper->findAll(); - // Convert to arrays - $registers = array_map(function($object) { - return $object->jsonSerialize(); - }, $registers); + // Convert to arrays and extend schemas + $registers = array_map(function($register) { + $registerArray = is_array($register) ? $register : $register->jsonSerialize(); + + // Replace schema IDs with actual schema objects if schemas property exists + if (isset($registerArray['schemas']) && is_array($registerArray['schemas'])) { + $registerArray['schemas'] = array_map( + function($schemaId) { + try { + return $this->schemaMapper->find($schemaId)->jsonSerialize(); + } catch (Exception $e) { + // If schema can't be found, return the ID + return $schemaId; + } + }, + $registerArray['schemas'] + ); + } - // Extend with schemas - $extend = ['schemas']; - if (empty($extend) === false) { - $registers = array_map(function($object) use ($extend) { - return $this->extendEntity(entity: $object, extend: $extend); - }, $registers); - } + return $registerArray; + }, $registers); return $registers; } From 32bc4e04d640d3d7a8fa41a67e69543516a0276c Mon Sep 17 00:00:00 2001 From: Ruben van der Linde Date: Wed, 1 Jan 2025 14:15:00 +0100 Subject: [PATCH 13/15] Small refactor --- lib/Service/ObjectService.php | 40 ++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 15 deletions(-) mode change 100755 => 100644 lib/Service/ObjectService.php diff --git a/lib/Service/ObjectService.php b/lib/Service/ObjectService.php old mode 100755 new mode 100644 index 1e313e6645..e7efe23372 --- a/lib/Service/ObjectService.php +++ b/lib/Service/ObjectService.php @@ -156,12 +156,21 @@ public function find(int|string $id, ?array $extend = []): ?ObjectEntity */ public function createFromArray(array $object, ?array $extend = []): array { - return $this->saveObject( + $objectEntity = $this->saveObject( register: $this->getRegister(), schema: $this->getSchema(), - object: $object, - extend: $extend - ); + object: $object + ); + + // Lets turn the whole thing into an array + $objectEntity = $objectEntity->jsonSerialize(); + + // Extend object with properties if requested + if (empty($extend) === false) { + $objectEntity = $this->extendEntity(entity: $objectEntity, extend: $extend); + } + + return $objectEntity; } /** @@ -188,12 +197,21 @@ public function updateFromArray(string $id, array $object, bool $updateVersion, $object = array_merge($oldObject, $object); } - return $this->saveObject( + $objectEntity = $this->saveObject( register: $this->getRegister(), schema: $this->getSchema(), object: $object, - extend: $extend ); + + // Lets turn the whole thing into an array + $objectEntity = $objectEntity->jsonSerialize(); + + // Extend object with properties if requested + if (empty($extend) === false) { + $objectEntity = $this->extendEntity(entity: $objectEntity, extend: $extend); + } + + return $objectEntity; } /** @@ -472,7 +490,7 @@ public function getObjects( * @throws ValidationException When the validation fails and returns an error. * @throws Exception */ - public function saveObject(int $register, int $schema, array $object, ?array $extend = []): array + public function saveObject(int $register, int $schema, array $object): ObjectEntity { // Remove system properties (starting with _) $object = array_filter($object, function($key) { @@ -541,14 +559,6 @@ public function saveObject(int $register, int $schema, array $object, ?array $ex $this->auditTrailMapper->createAuditTrail(new: $objectEntity); } - // Lets turn the whole thing into an array - $objectEntity = $objectEntity->jsonSerialize(); - - // Extend object with properties if requested - if (empty($extend) === false) { - $objectEntity = $this->extendEntity(entity: $objectEntity, extend: $extend); - } - return $objectEntity; } From 7dd702dc56688d481a26b1df7fc1ebd2857beec7 Mon Sep 17 00:00:00 2001 From: Ruben van der Linde Date: Wed, 1 Jan 2025 14:15:01 +0100 Subject: [PATCH 14/15] Better code for extending from external applicaitons e commit. --- .babelrc | 0 .eslintrc.js | 0 .gitattributes | 0 .gitignore | 0 .nvmrc | 0 .php-cs-fixer.dist.php | 0 .prettierrc | 0 LICENSE | 0 README.md | 0 appinfo/info.xml | 0 appinfo/routes.php | 0 composer-setup.php | 0 composer.json | 0 composer.lock | 0 css/main.css | 0 docs/styleguide.md | 0 img/app-dark.svg | 0 img/app.svg | 0 jest.config.js | 0 lib/AppInfo/Application.php | 0 lib/Controller/DashboardController.php | 0 lib/Migration/Version1Date20240924200009.php | 0 lib/Migration/Version1Date20241019205009.php | 0 lib/Migration/Version1Date20241020231700.php | 0 lib/Migration/Version1Date20241022135300.php | 0 lib/Service/MongoDbService.php | 0 lib/Service/ValidationService.php | 0 openapi.json | 0 package-lock.json | 0 package.json | 0 phpmd.xml | 0 phpunit.xml | 0 psalm copy.xml | 0 psalm.xml | 0 src/App.vue | 0 src/dialogs/Dialogs.vue | 0 src/entities/index.js | 0 src/entities/register/index.js | 0 src/entities/schema/index.js | 0 src/entities/source/index.js | 0 src/main.js | 0 src/modals/Modals.vue | 0 src/navigation/Configuration.vue | 0 src/navigation/MainMenu.vue | 0 src/pinia.js | 0 src/sidebars/SideBars.vue | 0 src/sidebars/dashboard/DashboardSideBar.vue | 0 src/sidebars/search/SearchSideBar.vue | 0 src/store/modules/navigation.js | 0 src/store/modules/navigation.spec.js | 0 src/store/store.js | 0 src/views/Views.vue | 0 src/views/dashboard/DashboardIndex.vue | 0 stylelint.config.js | 0 templates/index.php | 0 tsconfig.json | 0 webpack.config.js | 0 57 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 .babelrc mode change 100755 => 100644 .eslintrc.js mode change 100755 => 100644 .gitattributes mode change 100755 => 100644 .gitignore mode change 100755 => 100644 .nvmrc mode change 100755 => 100644 .php-cs-fixer.dist.php mode change 100755 => 100644 .prettierrc mode change 100755 => 100644 LICENSE mode change 100755 => 100644 README.md mode change 100755 => 100644 appinfo/info.xml mode change 100755 => 100644 appinfo/routes.php mode change 100755 => 100644 composer-setup.php mode change 100755 => 100644 composer.json mode change 100755 => 100644 composer.lock mode change 100755 => 100644 css/main.css mode change 100755 => 100644 docs/styleguide.md mode change 100755 => 100644 img/app-dark.svg mode change 100755 => 100644 img/app.svg mode change 100755 => 100644 jest.config.js mode change 100755 => 100644 lib/AppInfo/Application.php mode change 100755 => 100644 lib/Controller/DashboardController.php mode change 100755 => 100644 lib/Migration/Version1Date20240924200009.php mode change 100755 => 100644 lib/Migration/Version1Date20241019205009.php mode change 100755 => 100644 lib/Migration/Version1Date20241020231700.php mode change 100755 => 100644 lib/Migration/Version1Date20241022135300.php mode change 100755 => 100644 lib/Service/MongoDbService.php mode change 100755 => 100644 lib/Service/ValidationService.php mode change 100755 => 100644 openapi.json mode change 100755 => 100644 package-lock.json mode change 100755 => 100644 package.json mode change 100755 => 100644 phpmd.xml mode change 100755 => 100644 phpunit.xml mode change 100755 => 100644 psalm copy.xml mode change 100755 => 100644 psalm.xml mode change 100755 => 100644 src/App.vue mode change 100755 => 100644 src/dialogs/Dialogs.vue mode change 100755 => 100644 src/entities/index.js mode change 100755 => 100644 src/entities/register/index.js mode change 100755 => 100644 src/entities/schema/index.js mode change 100755 => 100644 src/entities/source/index.js mode change 100755 => 100644 src/main.js mode change 100755 => 100644 src/modals/Modals.vue mode change 100755 => 100644 src/navigation/Configuration.vue mode change 100755 => 100644 src/navigation/MainMenu.vue mode change 100755 => 100644 src/pinia.js mode change 100755 => 100644 src/sidebars/SideBars.vue mode change 100755 => 100644 src/sidebars/dashboard/DashboardSideBar.vue mode change 100755 => 100644 src/sidebars/search/SearchSideBar.vue mode change 100755 => 100644 src/store/modules/navigation.js mode change 100755 => 100644 src/store/modules/navigation.spec.js mode change 100755 => 100644 src/store/store.js mode change 100755 => 100644 src/views/Views.vue mode change 100755 => 100644 src/views/dashboard/DashboardIndex.vue mode change 100755 => 100644 stylelint.config.js mode change 100755 => 100644 templates/index.php mode change 100755 => 100644 tsconfig.json mode change 100755 => 100644 webpack.config.js diff --git a/.babelrc b/.babelrc old mode 100755 new mode 100644 diff --git a/.eslintrc.js b/.eslintrc.js old mode 100755 new mode 100644 diff --git a/.gitattributes b/.gitattributes old mode 100755 new mode 100644 diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/.nvmrc b/.nvmrc old mode 100755 new mode 100644 diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php old mode 100755 new mode 100644 diff --git a/.prettierrc b/.prettierrc old mode 100755 new mode 100644 diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 diff --git a/appinfo/info.xml b/appinfo/info.xml old mode 100755 new mode 100644 diff --git a/appinfo/routes.php b/appinfo/routes.php old mode 100755 new mode 100644 diff --git a/composer-setup.php b/composer-setup.php old mode 100755 new mode 100644 diff --git a/composer.json b/composer.json old mode 100755 new mode 100644 diff --git a/composer.lock b/composer.lock old mode 100755 new mode 100644 diff --git a/css/main.css b/css/main.css old mode 100755 new mode 100644 diff --git a/docs/styleguide.md b/docs/styleguide.md old mode 100755 new mode 100644 diff --git a/img/app-dark.svg b/img/app-dark.svg old mode 100755 new mode 100644 diff --git a/img/app.svg b/img/app.svg old mode 100755 new mode 100644 diff --git a/jest.config.js b/jest.config.js old mode 100755 new mode 100644 diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php old mode 100755 new mode 100644 diff --git a/lib/Controller/DashboardController.php b/lib/Controller/DashboardController.php old mode 100755 new mode 100644 diff --git a/lib/Migration/Version1Date20240924200009.php b/lib/Migration/Version1Date20240924200009.php old mode 100755 new mode 100644 diff --git a/lib/Migration/Version1Date20241019205009.php b/lib/Migration/Version1Date20241019205009.php old mode 100755 new mode 100644 diff --git a/lib/Migration/Version1Date20241020231700.php b/lib/Migration/Version1Date20241020231700.php old mode 100755 new mode 100644 diff --git a/lib/Migration/Version1Date20241022135300.php b/lib/Migration/Version1Date20241022135300.php old mode 100755 new mode 100644 diff --git a/lib/Service/MongoDbService.php b/lib/Service/MongoDbService.php old mode 100755 new mode 100644 diff --git a/lib/Service/ValidationService.php b/lib/Service/ValidationService.php old mode 100755 new mode 100644 diff --git a/openapi.json b/openapi.json old mode 100755 new mode 100644 diff --git a/package-lock.json b/package-lock.json old mode 100755 new mode 100644 diff --git a/package.json b/package.json old mode 100755 new mode 100644 diff --git a/phpmd.xml b/phpmd.xml old mode 100755 new mode 100644 diff --git a/phpunit.xml b/phpunit.xml old mode 100755 new mode 100644 diff --git a/psalm copy.xml b/psalm copy.xml old mode 100755 new mode 100644 diff --git a/psalm.xml b/psalm.xml old mode 100755 new mode 100644 diff --git a/src/App.vue b/src/App.vue old mode 100755 new mode 100644 diff --git a/src/dialogs/Dialogs.vue b/src/dialogs/Dialogs.vue old mode 100755 new mode 100644 diff --git a/src/entities/index.js b/src/entities/index.js old mode 100755 new mode 100644 diff --git a/src/entities/register/index.js b/src/entities/register/index.js old mode 100755 new mode 100644 diff --git a/src/entities/schema/index.js b/src/entities/schema/index.js old mode 100755 new mode 100644 diff --git a/src/entities/source/index.js b/src/entities/source/index.js old mode 100755 new mode 100644 diff --git a/src/main.js b/src/main.js old mode 100755 new mode 100644 diff --git a/src/modals/Modals.vue b/src/modals/Modals.vue old mode 100755 new mode 100644 diff --git a/src/navigation/Configuration.vue b/src/navigation/Configuration.vue old mode 100755 new mode 100644 diff --git a/src/navigation/MainMenu.vue b/src/navigation/MainMenu.vue old mode 100755 new mode 100644 diff --git a/src/pinia.js b/src/pinia.js old mode 100755 new mode 100644 diff --git a/src/sidebars/SideBars.vue b/src/sidebars/SideBars.vue old mode 100755 new mode 100644 diff --git a/src/sidebars/dashboard/DashboardSideBar.vue b/src/sidebars/dashboard/DashboardSideBar.vue old mode 100755 new mode 100644 diff --git a/src/sidebars/search/SearchSideBar.vue b/src/sidebars/search/SearchSideBar.vue old mode 100755 new mode 100644 diff --git a/src/store/modules/navigation.js b/src/store/modules/navigation.js old mode 100755 new mode 100644 diff --git a/src/store/modules/navigation.spec.js b/src/store/modules/navigation.spec.js old mode 100755 new mode 100644 diff --git a/src/store/store.js b/src/store/store.js old mode 100755 new mode 100644 diff --git a/src/views/Views.vue b/src/views/Views.vue old mode 100755 new mode 100644 diff --git a/src/views/dashboard/DashboardIndex.vue b/src/views/dashboard/DashboardIndex.vue old mode 100755 new mode 100644 diff --git a/stylelint.config.js b/stylelint.config.js old mode 100755 new mode 100644 diff --git a/templates/index.php b/templates/index.php old mode 100755 new mode 100644 diff --git a/tsconfig.json b/tsconfig.json old mode 100755 new mode 100644 diff --git a/webpack.config.js b/webpack.config.js old mode 100755 new mode 100644 From b8aefeec279e41e1419454e7e3996984c63855c9 Mon Sep 17 00:00:00 2001 From: Ruben van der Linde Date: Thu, 2 Jan 2025 09:34:16 +0100 Subject: [PATCH 15/15] Extend registers withs schema's --- lib/Service/ObjectService.php | 39 +++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/lib/Service/ObjectService.php b/lib/Service/ObjectService.php index d4a6ce9c82..39d64fe0a4 100644 --- a/lib/Service/ObjectService.php +++ b/lib/Service/ObjectService.php @@ -1588,30 +1588,37 @@ public function extendEntity(array $entity, array $extend): array } /** - * Retrieves all registers with their associated schema data. + * Get all registers extended with their schemas * - * Converts registers to arrays and extends them with schema information as needed. - * - * @return array The list of registers with extended schema details. - * @throws Exception If extending schemas fails. + * @return array The registers with schema data + * @throws Exception If extension fails */ public function getRegisters(): array { // Get all registers $registers = $this->registerMapper->findAll(); - // Convert to arrays - $registers = array_map(function ($object) { - return $object->jsonSerialize(); - }, $registers); + // Convert to arrays and extend schemas + $registers = array_map(function($register) { + $registerArray = is_array($register) ? $register : $register->jsonSerialize(); + + // Replace schema IDs with actual schema objects if schemas property exists + if (isset($registerArray['schemas']) && is_array($registerArray['schemas'])) { + $registerArray['schemas'] = array_map( + function($schemaId) { + try { + return $this->schemaMapper->find($schemaId)->jsonSerialize(); + } catch (Exception $e) { + // If schema can't be found, return the ID + return $schemaId; + } + }, + $registerArray['schemas'] + ); + } - // Extend with schemas - $extend = ['schemas']; - if (empty($extend) === false) { - $registers = array_map(function ($object) use ($extend) { - return $this->extendEntity(entity: $object, extend: $extend); - }, $registers); - } + return $registerArray; + }, $registers); return $registers; }