diff --git a/assets/app.js b/assets/app.js index 0706665..b5b06dd 100644 --- a/assets/app.js +++ b/assets/app.js @@ -44,10 +44,12 @@ if (location.pathname.includes('login')) { if (! location.pathname.includes('login')) { const vocabs = document.querySelector('#vocabs'); + const records = document.querySelector('#records'); const userMenu = document.querySelector('.dropdown-trigger'); const userCaret = document.querySelector('#user-caret'); const forVocabs = document.querySelector('#for-vocabs') + const forRecords = document.querySelector('#for-records') if (forVocabs) { forVocabs.addEventListener('click', function () { @@ -63,6 +65,20 @@ if (! location.pathname.includes('login')) { }); } + if (forRecords) { + forRecords.addEventListener('click', function () { + records.classList.toggle('is-hidden'); + + if (this.firstElementChild.classList.contains('fa-angle-right')) { + this.firstElementChild.classList.remove('fa-angle-right'); + this.firstElementChild.classList.add('fa-angle-down'); + } else { + this.firstElementChild.classList.remove('fa-angle-down'); + this.firstElementChild.classList.add('fa-angle-right'); + } + }); + } + userMenu.addEventListener('click', function () { document.querySelector('.dropdown').classList.toggle('is-active'); if (userCaret.classList.contains('fa-caret-down')) { diff --git a/assets/styles/app.css b/assets/styles/app.css index 6bf1be2..27a418c 100755 --- a/assets/styles/app.css +++ b/assets/styles/app.css @@ -1,6 +1,6 @@ -@import url('../vendor/bulma/css/bulma.min.css'); @import url('../fonts/stylesheet.css'); @import url('../fontawesome-free-6.6.0-web/css/all.min.css'); +@import url('../vendor/bulma/css/bulma.min.css'); :root { --arcoa-blue: rgba(66,135,199,0.98); @@ -15,13 +15,11 @@ body { min-height: 100vh; overflow-y: auto; } -#vocabs a { + +#vocabs a, +#records a { color: #fff; } -/* For dev only*/ -.sf-toolbar-clearer { - display: none !important; -} .table.record td, .table.record th { @@ -29,5 +27,13 @@ body { } .table.record th { - min-width: 220px; + min-width: 240px; +} + +.table td { + vertical-align: middle; +} + +.results tr > th { + text-align: center !important; } \ No newline at end of file diff --git a/composer.json b/composer.json index 7f03200..bb2a8d8 100644 --- a/composer.json +++ b/composer.json @@ -7,10 +7,13 @@ "php": ">=8.2", "ext-ctype": "*", "ext-iconv": "*", + "api-platform/doctrine-orm": "^4.0", + "api-platform/symfony": "^4.0", "doctrine/dbal": "^3", "doctrine/doctrine-bundle": "^2.13", "doctrine/doctrine-migrations-bundle": "^3.3", "doctrine/orm": "^3.3", + "nelmio/cors-bundle": "^2.5", "phpdocumentor/reflection-docblock": "^5.4", "phpstan/phpdoc-parser": "^1.33", "symfony/asset": "7.1.*", diff --git a/composer.lock b/composer.lock index 5eb85c2..c4de598 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,1110 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cbfd39241bfc4f138325400d618edfb5", + "content-hash": "e16fc7fb94eadef727d1183bf982538b", "packages": [ + { + "name": "api-platform/doctrine-common", + "version": "v4.0.6", + "source": { + "type": "git", + "url": "https://github.com/api-platform/doctrine-common.git", + "reference": "eb82d8531ed9a4b59ea0028f3429c464d0530bc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/api-platform/doctrine-common/zipball/eb82d8531ed9a4b59ea0028f3429c464d0530bc4", + "reference": "eb82d8531ed9a4b59ea0028f3429c464d0530bc4", + "shasum": "" + }, + "require": { + "api-platform/metadata": "^3.4 || ^4.0", + "api-platform/state": "^3.4 || ^4.0", + "doctrine/collections": "^2.1", + "doctrine/common": "^3.2.2", + "doctrine/persistence": "^3.2", + "php": ">=8.2" + }, + "conflict": { + "doctrine/persistence": "<1.3" + }, + "require-dev": { + "doctrine/mongodb-odm": "^2.6", + "doctrine/orm": "^2.17 || ^3.0", + "phpspec/prophecy-phpunit": "^2.2", + "phpunit/phpunit": "^11.2" + }, + "suggest": { + "api-platform/graphql": "For GraphQl mercure subscriptions.", + "api-platform/http-cache": "For HTTP cache invalidation.", + "phpstan/phpdoc-parser": "For PHP documentation support.", + "symfony/config": "For XML resource configuration.", + "symfony/mercure-bundle": "For mercure updates publisher.", + "symfony/yaml": "For YAML resource configuration." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0.x-dev", + "dev-3.4": "3.4.x-dev" + }, + "symfony": { + "require": "^6.4 || ^7.0" + }, + "thanks": { + "name": "api-platform/api-platform", + "url": "https://github.com/api-platform/api-platform" + } + }, + "autoload": { + "psr-4": { + "ApiPlatform\\Doctrine\\Common\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kévin Dunglas", + "email": "kevin@dunglas.fr", + "homepage": "https://dunglas.fr" + }, + { + "name": "API Platform Community", + "homepage": "https://api-platform.com/community/contributors" + } + ], + "description": "Common files used by api-platform/doctrine-orm and api-platform/doctrine-odm", + "homepage": "https://api-platform.com", + "keywords": [ + "doctrine", + "graphql", + "odm", + "orm", + "rest" + ], + "support": { + "source": "https://github.com/api-platform/doctrine-common/tree/v4.0.6" + }, + "time": "2024-09-21T11:01:16+00:00" + }, + { + "name": "api-platform/doctrine-orm", + "version": "v4.0.6", + "source": { + "type": "git", + "url": "https://github.com/api-platform/doctrine-orm.git", + "reference": "8be3b6e621ee88a4356903b4932be85b82584ed5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/api-platform/doctrine-orm/zipball/8be3b6e621ee88a4356903b4932be85b82584ed5", + "reference": "8be3b6e621ee88a4356903b4932be85b82584ed5", + "shasum": "" + }, + "require": { + "api-platform/doctrine-common": "^3.4 || ^4.0", + "api-platform/metadata": "^3.4 || ^4.0", + "api-platform/state": "^3.4 || ^4.0", + "doctrine/orm": "^2.17 || ^3.0", + "php": ">=8.2", + "symfony/property-info": "^6.4 || ^7.0" + }, + "require-dev": { + "doctrine/doctrine-bundle": "^2.11", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^10.0", + "ramsey/uuid": "^4.7", + "ramsey/uuid-doctrine": "^2.0", + "symfony/cache": "^6.4 || ^7.0", + "symfony/framework-bundle": "^6.4 || ^7.0", + "symfony/property-access": "^6.4 || ^7.0", + "symfony/serializer": "^6.4 || ^7.0", + "symfony/uid": "^6.4 || ^7.0", + "symfony/validator": "^6.4 || ^7.0", + "symfony/yaml": "^6.4 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0.x-dev", + "dev-3.4": "3.4.x-dev" + }, + "symfony": { + "require": "^6.4 || ^7.0" + }, + "thanks": { + "name": "api-platform/api-platform", + "url": "https://github.com/api-platform/api-platform" + } + }, + "autoload": { + "psr-4": { + "ApiPlatform\\Doctrine\\Orm\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kévin Dunglas", + "email": "kevin@dunglas.fr", + "homepage": "https://dunglas.fr" + }, + { + "name": "API Platform Community", + "homepage": "https://api-platform.com/community/contributors" + } + ], + "description": "Doctrine ORM bridge", + "homepage": "https://api-platform.com", + "keywords": [ + "api", + "doctrine", + "graphql", + "orm", + "rest" + ], + "support": { + "source": "https://github.com/api-platform/doctrine-orm/tree/v4.0.6" + }, + "time": "2024-09-21T11:01:16+00:00" + }, + { + "name": "api-platform/documentation", + "version": "v4.0.6", + "source": { + "type": "git", + "url": "https://github.com/api-platform/documentation.git", + "reference": "e0fef856ccf0af34d7bcc8f789c521f9ace3fcf7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/api-platform/documentation/zipball/e0fef856ccf0af34d7bcc8f789c521f9ace3fcf7", + "reference": "e0fef856ccf0af34d7bcc8f789c521f9ace3fcf7", + "shasum": "" + }, + "require": { + "api-platform/metadata": "^3.4 || ^4.0", + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.2" + }, + "type": "project", + "extra": { + "branch-alias": { + "dev-main": "4.0.x-dev", + "dev-3.4": "3.4.x-dev" + }, + "symfony": { + "require": "^6.4 || ^7.0" + }, + "thanks": { + "name": "api-platform/api-platform", + "url": "https://github.com/api-platform/api-platform" + } + }, + "autoload": { + "psr-4": { + "ApiPlatform\\Documentation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kévin Dunglas", + "email": "kevin@dunglas.fr", + "homepage": "https://dunglas.fr" + }, + { + "name": "API Platform Community", + "homepage": "https://api-platform.com/community/contributors" + } + ], + "description": "API Platform documentation controller.", + "support": { + "source": "https://github.com/api-platform/documentation/tree/v4.0.6" + }, + "time": "2024-09-21T11:01:16+00:00" + }, + { + "name": "api-platform/http-cache", + "version": "v4.0.6", + "source": { + "type": "git", + "url": "https://github.com/api-platform/http-cache.git", + "reference": "b21433319d93e90ae7b1df098cd604dc8555b632" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/api-platform/http-cache/zipball/b21433319d93e90ae7b1df098cd604dc8555b632", + "reference": "b21433319d93e90ae7b1df098cd604dc8555b632", + "shasum": "" + }, + "require": { + "api-platform/metadata": "^3.4 || ^4.0", + "api-platform/state": "^3.4 || ^4.0", + "php": ">=8.2", + "symfony/http-foundation": "^6.4 || ^7.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^6.0 || ^7.0", + "phpspec/prophecy-phpunit": "^2.2", + "phpunit/phpunit": "^11.2", + "symfony/dependency-injection": "^6.4 || ^7.0", + "symfony/http-client": "^6.4 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0.x-dev", + "dev-3.4": "3.4.x-dev" + }, + "symfony": { + "require": "^6.4 || ^7.0" + }, + "thanks": { + "name": "api-platform/api-platform", + "url": "https://github.com/api-platform/api-platform" + } + }, + "autoload": { + "psr-4": { + "ApiPlatform\\HttpCache\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kévin Dunglas", + "email": "kevin@dunglas.fr", + "homepage": "https://dunglas.fr" + }, + { + "name": "API Platform Community", + "homepage": "https://api-platform.com/comunnity/contributors" + } + ], + "description": "API Platform HttpCache component", + "homepage": "https://api-platform.com", + "keywords": [ + "api", + "cache", + "http", + "rest" + ], + "support": { + "source": "https://github.com/api-platform/http-cache/tree/v4.0.6" + }, + "time": "2024-10-28T09:21:17+00:00" + }, + { + "name": "api-platform/hydra", + "version": "v4.0.6", + "source": { + "type": "git", + "url": "https://github.com/api-platform/hydra.git", + "reference": "a14326bf4debec324c303a1cbb626d384c49d6a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/api-platform/hydra/zipball/a14326bf4debec324c303a1cbb626d384c49d6a0", + "reference": "a14326bf4debec324c303a1cbb626d384c49d6a0", + "shasum": "" + }, + "require": { + "api-platform/documentation": "^3.4 || ^4.0", + "api-platform/json-schema": "^3.4 || ^4.0", + "api-platform/jsonld": "^3.4 || ^4.0", + "api-platform/metadata": "^3.4 || ^4.0", + "api-platform/serializer": "^3.4 || ^4.0", + "api-platform/state": "^3.4 || ^4.0", + "php": ">=8.2", + "symfony/web-link": "^6.4 || ^7.0" + }, + "require-dev": { + "api-platform/doctrine-common": "^3.4 || ^4.0", + "api-platform/doctrine-odm": "^3.4 || ^4.0", + "api-platform/doctrine-orm": "^3.4 || ^4.0", + "phpspec/prophecy": "^1.19", + "phpspec/prophecy-phpunit": "^2.2", + "phpunit/phpunit": "^11.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0.x-dev", + "dev-3.4": "3.4.x-dev" + }, + "symfony": { + "require": "^6.4 || ^7.0" + }, + "thanks": { + "name": "api-platform/api-platform", + "url": "https://github.com/api-platform/api-platform" + } + }, + "autoload": { + "psr-4": { + "ApiPlatform\\Hydra\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kévin Dunglas", + "email": "kevin@dunglas.fr", + "homepage": "https://dunglas.fr" + }, + { + "name": "API Platform Community", + "homepage": "https://api-platform.com/community/contributors" + } + ], + "description": "API Hydra support", + "homepage": "https://api-platform.com", + "keywords": [ + "Hydra", + "JSON-LD", + "api", + "graphql", + "jsonapi", + "rest" + ], + "support": { + "source": "https://github.com/api-platform/hydra/tree/v4.0.6" + }, + "time": "2024-10-28T09:21:17+00:00" + }, + { + "name": "api-platform/json-schema", + "version": "v4.0.6", + "source": { + "type": "git", + "url": "https://github.com/api-platform/json-schema.git", + "reference": "8546df9eab8c8f664181e5cf67ba2eff927d5539" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/api-platform/json-schema/zipball/8546df9eab8c8f664181e5cf67ba2eff927d5539", + "reference": "8546df9eab8c8f664181e5cf67ba2eff927d5539", + "shasum": "" + }, + "require": { + "api-platform/metadata": "^3.4 || ^4.0", + "php": ">=8.2", + "symfony/console": "^6.4 || ^7.0", + "symfony/property-info": "^6.4 || ^7.0", + "symfony/serializer": "^6.4 || ^7.0", + "symfony/uid": "^6.4 || ^7.0" + }, + "require-dev": { + "phpspec/prophecy-phpunit": "^2.2", + "phpunit/phpunit": "^11.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0.x-dev", + "dev-3.4": "3.4.x-dev" + }, + "symfony": { + "require": "^6.4 || ^7.0" + }, + "thanks": { + "name": "api-platform/api-platform", + "url": "https://github.com/api-platform/api-platform" + } + }, + "autoload": { + "psr-4": { + "ApiPlatform\\JsonSchema\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kévin Dunglas", + "email": "kevin@dunglas.fr", + "homepage": "https://dunglas.fr" + }, + { + "name": "API Platform Community", + "homepage": "https://api-platform.com/community/contributors" + } + ], + "description": "Generate a JSON Schema from a PHP class", + "homepage": "https://api-platform.com", + "keywords": [ + "JSON Schema", + "api", + "json", + "openapi", + "rest", + "swagger" + ], + "support": { + "source": "https://github.com/api-platform/json-schema/tree/v4.0.6" + }, + "time": "2024-10-22T05:47:01+00:00" + }, + { + "name": "api-platform/jsonld", + "version": "v4.0.6", + "source": { + "type": "git", + "url": "https://github.com/api-platform/jsonld.git", + "reference": "6e8eef727161da1fa585ebc8c29807e41527d20b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/api-platform/jsonld/zipball/6e8eef727161da1fa585ebc8c29807e41527d20b", + "reference": "6e8eef727161da1fa585ebc8c29807e41527d20b", + "shasum": "" + }, + "require": { + "api-platform/metadata": "^3.4 || ^4.0", + "api-platform/serializer": "^3.4 || ^4.0", + "api-platform/state": "^3.4 || ^4.0", + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0.x-dev", + "dev-3.4": "3.4.x-dev" + }, + "symfony": { + "require": "^6.4 || ^7.0" + }, + "thanks": { + "name": "api-platform/api-platform", + "url": "https://github.com/api-platform/api-platform" + } + }, + "autoload": { + "psr-4": { + "ApiPlatform\\JsonLd\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kévin Dunglas", + "email": "kevin@dunglas.fr", + "homepage": "https://dunglas.fr" + }, + { + "name": "API Platform Community", + "homepage": "https://api-platform.com/community/contributors" + } + ], + "description": "API JSON-LD support", + "homepage": "https://api-platform.com", + "keywords": [ + "Hydra", + "JSON-LD", + "api", + "graphql", + "rest" + ], + "support": { + "source": "https://github.com/api-platform/jsonld/tree/v4.0.6" + }, + "time": "2024-10-22T16:20:37+00:00" + }, + { + "name": "api-platform/metadata", + "version": "v4.0.6", + "source": { + "type": "git", + "url": "https://github.com/api-platform/metadata.git", + "reference": "2b0b00d7b77e19c94031755818ab2a3a71e3cbe6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/api-platform/metadata/zipball/2b0b00d7b77e19c94031755818ab2a3a71e3cbe6", + "reference": "2b0b00d7b77e19c94031755818ab2a3a71e3cbe6", + "shasum": "" + }, + "require": { + "doctrine/inflector": "^1.0 || ^2.0", + "php": ">=8.2", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "symfony/property-info": "^6.4 || ^7.0", + "symfony/string": "^6.4 || ^7.0", + "symfony/type-info": "^7.1" + }, + "require-dev": { + "api-platform/json-schema": "^3.4 || ^4.0", + "api-platform/openapi": "^3.4 || ^4.0", + "api-platform/state": "^3.4 || ^4.0", + "phpspec/prophecy-phpunit": "^2.2", + "phpstan/phpdoc-parser": "^1.13", + "phpunit/phpunit": "^11.2", + "symfony/config": "^6.4 || ^7.0", + "symfony/routing": "^6.4 || ^7.0", + "symfony/var-dumper": "^6.4 || ^7.0", + "symfony/web-link": "^6.4 || ^7.0", + "symfony/yaml": "^6.4 || ^7.0" + }, + "suggest": { + "phpstan/phpdoc-parser": "For PHP documentation support.", + "symfony/config": "For XML resource configuration.", + "symfony/yaml": "For YAML resource configuration." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0.x-dev", + "dev-3.4": "3.4.x-dev" + }, + "symfony": { + "require": "^6.4 || ^7.0" + }, + "thanks": { + "name": "api-platform/api-platform", + "url": "https://github.com/api-platform/api-platform" + } + }, + "autoload": { + "psr-4": { + "ApiPlatform\\Metadata\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kévin Dunglas", + "email": "kevin@dunglas.fr", + "homepage": "https://dunglas.fr" + }, + { + "name": "API Platform Community", + "homepage": "https://api-platform.com/community/contributors" + } + ], + "description": "API Resource-oriented metadata attributes and factories", + "homepage": "https://api-platform.com", + "keywords": [ + "Hydra", + "JSON-LD", + "api", + "graphql", + "hal", + "jsonapi", + "openapi", + "rest", + "swagger" + ], + "support": { + "source": "https://github.com/api-platform/metadata/tree/v4.0.6" + }, + "time": "2024-10-28T09:21:17+00:00" + }, + { + "name": "api-platform/openapi", + "version": "v4.0.6", + "source": { + "type": "git", + "url": "https://github.com/api-platform/openapi.git", + "reference": "d03c25b55bd9991d237f58973eb0179b43cf4aa2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/api-platform/openapi/zipball/d03c25b55bd9991d237f58973eb0179b43cf4aa2", + "reference": "d03c25b55bd9991d237f58973eb0179b43cf4aa2", + "shasum": "" + }, + "require": { + "api-platform/json-schema": "^3.4 || ^4.0", + "api-platform/metadata": "^3.4 || ^4.0", + "api-platform/state": "^3.4 || ^4.0", + "php": ">=8.2", + "symfony/console": "^6.4 || ^7.0", + "symfony/property-access": "^6.4 || ^7.0", + "symfony/serializer": "^6.4 || ^7.0" + }, + "require-dev": { + "api-platform/doctrine-common": "^3.4 || ^4.0", + "api-platform/doctrine-odm": "^3.4 || ^4.0", + "api-platform/doctrine-orm": "^3.4 || ^4.0", + "phpspec/prophecy-phpunit": "^2.2", + "phpunit/phpunit": "^11.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0.x-dev", + "dev-3.4": "3.4.x-dev" + }, + "symfony": { + "require": "^6.4 || ^7.0" + }, + "thanks": { + "name": "api-platform/api-platform", + "url": "https://github.com/api-platform/api-platform" + } + }, + "autoload": { + "psr-4": { + "ApiPlatform\\OpenApi\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kévin Dunglas", + "email": "kevin@dunglas.fr", + "homepage": "https://dunglas.fr" + }, + { + "name": "API Platform Community", + "homepage": "https://api-platform.com/community/contributors" + } + ], + "description": "Models to build and serialize an OpenAPI specification.", + "homepage": "https://api-platform.com", + "keywords": [ + "Hydra", + "JSON-LD", + "api", + "graphql", + "hal", + "jsonapi", + "openapi", + "rest", + "swagger" + ], + "support": { + "source": "https://github.com/api-platform/openapi/tree/v4.0.6" + }, + "time": "2024-10-28T09:21:17+00:00" + }, + { + "name": "api-platform/serializer", + "version": "v4.0.6", + "source": { + "type": "git", + "url": "https://github.com/api-platform/serializer.git", + "reference": "a88247b1c3344ab19b3fa18c5f6487b114649114" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/api-platform/serializer/zipball/a88247b1c3344ab19b3fa18c5f6487b114649114", + "reference": "a88247b1c3344ab19b3fa18c5f6487b114649114", + "shasum": "" + }, + "require": { + "api-platform/metadata": "^3.4 || ^4.0", + "api-platform/state": "^3.4 || ^4.0", + "php": ">=8.2", + "symfony/property-access": "^6.4 || ^7.0", + "symfony/property-info": "^6.4 || ^7.0", + "symfony/serializer": "^6.4 || ^7.0", + "symfony/validator": "^6.4 || ^7.0" + }, + "require-dev": { + "api-platform/doctrine-common": "^3.4 || ^4.0", + "api-platform/doctrine-odm": "^3.4 || ^4.0", + "api-platform/doctrine-orm": "^3.4 || ^4.0", + "api-platform/json-schema": "^3.4 || ^4.0", + "api-platform/openapi": "^3.4 || ^4.0", + "doctrine/collections": "^2.1", + "phpspec/prophecy-phpunit": "^2.2", + "phpunit/phpunit": "^11.2", + "symfony/mercure-bundle": "*", + "symfony/var-dumper": "^6.4 || ^7.0", + "symfony/yaml": "^6.4 || ^7.0" + }, + "suggest": { + "api-platform/doctrine-odm": "To support Doctrine MongoDB ODM state options.", + "api-platform/doctrine-orm": "To support Doctrine ORM state options." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0.x-dev", + "dev-3.4": "3.4.x-dev" + }, + "symfony": { + "require": "^6.4 || ^7.0" + }, + "thanks": { + "name": "api-platform/api-platform", + "url": "https://github.com/api-platform/api-platform" + } + }, + "autoload": { + "psr-4": { + "ApiPlatform\\Serializer\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kévin Dunglas", + "email": "kevin@dunglas.fr", + "homepage": "https://dunglas.fr" + }, + { + "name": "API Platform Community", + "homepage": "https://api-platform.com/community/contributors" + } + ], + "description": "API Platform core Serializer", + "homepage": "https://api-platform.com", + "keywords": [ + "api", + "graphql", + "rest", + "serializer" + ], + "support": { + "source": "https://github.com/api-platform/serializer/tree/v4.0.6" + }, + "time": "2024-10-11T11:13:21+00:00" + }, + { + "name": "api-platform/state", + "version": "v4.0.6", + "source": { + "type": "git", + "url": "https://github.com/api-platform/state.git", + "reference": "c3f91ce3158729305f88654d2ca3d20912c67520" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/api-platform/state/zipball/c3f91ce3158729305f88654d2ca3d20912c67520", + "reference": "c3f91ce3158729305f88654d2ca3d20912c67520", + "shasum": "" + }, + "require": { + "api-platform/metadata": "^3.4 || ^4.0", + "php": ">=8.2", + "psr/container": "^1.0 || ^2.0", + "symfony/http-kernel": "^6.4 || ^7.0" + }, + "require-dev": { + "api-platform/serializer": "^3.4 || ^4.0", + "api-platform/validator": "^3.4 || ^4.0", + "phpunit/phpunit": "^11.2", + "symfony/http-foundation": "^6.4 || ^7.0", + "symfony/web-link": "^6.4 || ^7.0", + "willdurand/negotiation": "^3.1" + }, + "suggest": { + "api-platform/serializer": "To use API Platform serializer.", + "api-platform/validator": "To use API Platform validation.", + "symfony/http-foundation": "To use our HTTP providers and processor.", + "symfony/web-link": "To support adding web links to the response headers.", + "willdurand/negotiation": "To use the API Platform content negoatiation provider." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0.x-dev", + "dev-3.4": "3.4.x-dev" + }, + "symfony": { + "require": "^6.4 || ^7.0" + }, + "thanks": { + "name": "api-platform/api-platform", + "url": "https://github.com/api-platform/api-platform" + } + }, + "autoload": { + "psr-4": { + "ApiPlatform\\State\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kévin Dunglas", + "email": "kevin@dunglas.fr", + "homepage": "https://dunglas.fr" + }, + { + "name": "API Platform Community", + "homepage": "https://api-platform.com/community/contributors" + } + ], + "description": "API Platform State component ", + "homepage": "https://api-platform.com", + "keywords": [ + "Hydra", + "JSON-LD", + "api", + "graphql", + "hal", + "jsonapi", + "openapi", + "rest", + "swagger" + ], + "support": { + "source": "https://github.com/api-platform/state/tree/v4.0.6" + }, + "time": "2024-10-25T13:28:30+00:00" + }, + { + "name": "api-platform/symfony", + "version": "v4.0.6", + "source": { + "type": "git", + "url": "https://github.com/api-platform/symfony.git", + "reference": "4f63a53f6057ce80a71225aedb704e68f474c3f1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/api-platform/symfony/zipball/4f63a53f6057ce80a71225aedb704e68f474c3f1", + "reference": "4f63a53f6057ce80a71225aedb704e68f474c3f1", + "shasum": "" + }, + "require": { + "api-platform/documentation": "^3.4 || ^4.0", + "api-platform/http-cache": "^3.4 || ^4.0", + "api-platform/hydra": "^3.4 || ^4.0", + "api-platform/json-schema": "^3.4 || ^4.0", + "api-platform/jsonld": "^3.4 || ^4.0", + "api-platform/metadata": "^3.4 || ^4.0", + "api-platform/openapi": "^3.4 || ^4.0", + "api-platform/serializer": "^3.4 || ^4.0", + "api-platform/state": "^3.4 || ^4.0", + "api-platform/validator": "^3.4 || ^4.0", + "php": ">=8.2", + "symfony/property-access": "^6.4 || ^7.0", + "symfony/property-info": "^6.4 || ^7.0", + "symfony/security-core": "^6.4 || ^7.0", + "symfony/serializer": "^6.4 || ^7.0", + "willdurand/negotiation": "^3.1" + }, + "require-dev": { + "api-platform/doctrine-common": "^3.4 || ^4.0", + "api-platform/doctrine-odm": "^3.4 || ^4.0", + "api-platform/doctrine-orm": "^3.4 || ^4.0", + "api-platform/elasticsearch": "^3.4 || ^4.0", + "api-platform/graphql": "^3.4 || ^4.0", + "api-platform/parameter-validator": "^3.1", + "phpspec/prophecy-phpunit": "^2.2", + "phpunit/phpunit": "^11.2", + "symfony/expression-language": "^6.4 || ^7.0", + "symfony/mercure-bundle": "*", + "symfony/routing": "^6.4 || ^7.0", + "symfony/validator": "^6.4 || ^7.0", + "webonyx/graphql-php": "^15.0" + }, + "suggest": { + "api-platform/doctrine-odm": "To support MongoDB. Only versions 4.0 and later are supported.", + "api-platform/doctrine-orm": "To support Doctrine ORM.", + "api-platform/elasticsearch": "To support Elasticsearch.", + "api-platform/graphql": "To support GraphQL.", + "api-platform/ramsey-uuid": "To support Ramsey's UUID identifiers.", + "ocramius/package-versions": "To display the API Platform's version in the debug bar.", + "phpstan/phpdoc-parser": "To support extracting metadata from PHPDoc.", + "psr/cache-implementation": "To use metadata caching.", + "symfony/cache": "To have metadata caching when using Symfony integration.", + "symfony/config": "To load XML configuration files.", + "symfony/expression-language": "To use authorization and mercure advanced features.", + "symfony/http-client": "To use the HTTP cache invalidation system.", + "symfony/mercure-bundle": "To support mercure integration.", + "symfony/messenger": "To support messenger integration and asynchronous Mercure updates.", + "symfony/security": "To use authorization features.", + "symfony/twig-bundle": "To use the Swagger UI integration.", + "symfony/uid": "To support Symfony UUID/ULID identifiers.", + "symfony/web-profiler-bundle": "To use the data collector." + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-main": "4.0.x-dev", + "dev-3.4": "3.4.x-dev" + }, + "symfony": { + "require": "^6.4 || ^7.0" + }, + "thanks": { + "name": "api-platform/api-platform", + "url": "https://github.com/api-platform/api-platform" + } + }, + "autoload": { + "psr-4": { + "ApiPlatform\\Symfony\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kévin Dunglas", + "email": "kevin@dunglas.fr", + "homepage": "https://dunglas.fr" + }, + { + "name": "API Platform Community", + "homepage": "https://api-platform.com/community/contributors" + } + ], + "description": "Symfony API Platform integration", + "homepage": "https://api-platform.com", + "keywords": [ + "Hydra", + "JSON-LD", + "api", + "graphql", + "hal", + "jsonapi", + "openapi", + "rest", + "swagger", + "symfony" + ], + "support": { + "source": "https://github.com/api-platform/symfony/tree/v4.0.6" + }, + "time": "2024-10-22T05:47:01+00:00" + }, + { + "name": "api-platform/validator", + "version": "v4.0.6", + "source": { + "type": "git", + "url": "https://github.com/api-platform/validator.git", + "reference": "b9e6bb22f4973f2c8e3a4f597a868eb15dc51638" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/api-platform/validator/zipball/b9e6bb22f4973f2c8e3a4f597a868eb15dc51638", + "reference": "b9e6bb22f4973f2c8e3a4f597a868eb15dc51638", + "shasum": "" + }, + "require": { + "api-platform/metadata": "^3.4 || ^4.0", + "php": ">=8.2", + "symfony/web-link": "^6.4 || ^7.0" + }, + "require-dev": { + "phpspec/prophecy-phpunit": "^2.2", + "phpunit/phpunit": "^11.2", + "symfony/http-kernel": "^6.4 || ^7.0", + "symfony/serializer": "^6.4 || ^7.0", + "symfony/validator": "^6.4 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0.x-dev", + "dev-3.4": "3.4.x-dev" + }, + "symfony": { + "require": "^6.4 || ^7.0" + }, + "thanks": { + "name": "api-platform/api-platform", + "url": "https://github.com/api-platform/api-platform" + } + }, + "autoload": { + "psr-4": { + "ApiPlatform\\Validator\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kévin Dunglas", + "email": "kevin@dunglas.fr", + "homepage": "https://dunglas.fr" + }, + { + "name": "API Platform Community", + "homepage": "https://api-platform.com/community/contributors" + } + ], + "description": "API Platform validator component", + "homepage": "https://api-platform.com", + "keywords": [ + "api", + "graphql", + "rest", + "validator" + ], + "support": { + "source": "https://github.com/api-platform/validator/tree/v4.0.6" + }, + "time": "2024-10-26T07:16:49+00:00" + }, { "name": "composer/semver", "version": "3.4.3", @@ -266,6 +1368,97 @@ ], "time": "2024-04-18T06:56:21+00:00" }, + { + "name": "doctrine/common", + "version": "3.4.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/common.git", + "reference": "6c8fef961f67b8bc802ce3e32e3ebd1022907286" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/common/zipball/6c8fef961f67b8bc802ce3e32e3ebd1022907286", + "reference": "6c8fef961f67b8bc802ce3e32e3ebd1022907286", + "shasum": "" + }, + "require": { + "doctrine/persistence": "^2.0 || ^3.0", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9.0 || ^10.0", + "doctrine/collections": "^1", + "phpstan/phpstan": "^1.4.1", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5.20 || ^8.5 || ^9.0", + "squizlabs/php_codesniffer": "^3.0", + "symfony/phpunit-bridge": "^6.1", + "vimeo/psalm": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "PHP Doctrine Common project is a library that provides additional functionality that other Doctrine projects depend on such as better reflection support, proxies and much more.", + "homepage": "https://www.doctrine-project.org/projects/common.html", + "keywords": [ + "common", + "doctrine", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/common/issues", + "source": "https://github.com/doctrine/common/tree/3.4.5" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcommon", + "type": "tidelift" + } + ], + "time": "2024-10-08T15:53:43+00:00" + }, { "name": "doctrine/dbal", "version": "3.9.3", @@ -1482,6 +2675,68 @@ ], "time": "2024-06-28T09:40:51+00:00" }, + { + "name": "nelmio/cors-bundle", + "version": "2.5.0", + "source": { + "type": "git", + "url": "https://github.com/nelmio/NelmioCorsBundle.git", + "reference": "3a526fe025cd20e04a6a11370cf5ab28dbb5a544" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nelmio/NelmioCorsBundle/zipball/3a526fe025cd20e04a6a11370cf5ab28dbb5a544", + "reference": "3a526fe025cd20e04a6a11370cf5ab28dbb5a544", + "shasum": "" + }, + "require": { + "psr/log": "^1.0 || ^2.0 || ^3.0", + "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0" + }, + "require-dev": { + "mockery/mockery": "^1.3.6", + "symfony/phpunit-bridge": "^5.4 || ^6.0 || ^7.0" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Nelmio\\CorsBundle\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nelmio", + "homepage": "http://nelm.io" + }, + { + "name": "Symfony Community", + "homepage": "https://github.com/nelmio/NelmioCorsBundle/contributors" + } + ], + "description": "Adds CORS (Cross-Origin Resource Sharing) headers support in your Symfony application", + "keywords": [ + "api", + "cors", + "crossdomain" + ], + "support": { + "issues": "https://github.com/nelmio/NelmioCorsBundle/issues", + "source": "https://github.com/nelmio/NelmioCorsBundle/tree/2.5.0" + }, + "time": "2024-06-24T21:25:28+00:00" + }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", @@ -3469,16 +4724,16 @@ }, { "name": "symfony/form", - "version": "v7.1.5", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/form.git", - "reference": "6b8b53ad6d42f14b158c896163b96ff260d78222" + "reference": "7a48dda96fe16711fc042df38ca1a7dd4d9d6387" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/form/zipball/6b8b53ad6d42f14b158c896163b96ff260d78222", - "reference": "6b8b53ad6d42f14b158c896163b96ff260d78222", + "url": "https://api.github.com/repos/symfony/form/zipball/7a48dda96fe16711fc042df38ca1a7dd4d9d6387", + "reference": "7a48dda96fe16711fc042df38ca1a7dd4d9d6387", "shasum": "" }, "require": { @@ -3546,7 +4801,7 @@ "description": "Allows to easily create, process and reuse HTML forms", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/form/tree/v7.1.5" + "source": "https://github.com/symfony/form/tree/v7.1.6" }, "funding": [ { @@ -3562,7 +4817,7 @@ "type": "tidelift" } ], - "time": "2024-09-20T08:28:38+00:00" + "time": "2024-10-09T08:46:59+00:00" }, { "name": "symfony/framework-bundle", @@ -5268,6 +6523,85 @@ ], "time": "2024-09-09T11:45:10+00:00" }, + { + "name": "symfony/polyfill-uuid", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-uuid.git", + "reference": "21533be36c24be3f4b1669c4725c7d1d2bab4ae2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/21533be36c24be3f4b1669c4725c7d1d2bab4ae2", + "reference": "21533be36c24be3f4b1669c4725c7d1d2bab4ae2", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-uuid": "*" + }, + "suggest": { + "ext-uuid": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Uuid\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for uuid functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "uuid" + ], + "support": { + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.31.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, { "name": "symfony/process", "version": "v7.1.5", @@ -6844,6 +8178,80 @@ ], "time": "2024-09-19T21:48:23+00:00" }, + { + "name": "symfony/uid", + "version": "v7.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/uid.git", + "reference": "65befb3bb2d503bbffbd08c815aa38b472999917" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/uid/zipball/65befb3bb2d503bbffbd08c815aa38b472999917", + "reference": "65befb3bb2d503bbffbd08c815aa38b472999917", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-uuid": "^1.15" + }, + "require-dev": { + "symfony/console": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Uid\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to generate and represent UIDs", + "homepage": "https://symfony.com", + "keywords": [ + "UID", + "ulid", + "uuid" + ], + "support": { + "source": "https://github.com/symfony/uid/tree/v7.1.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:20:29+00:00" + }, { "name": "symfony/ux-turbo", "version": "v2.21.0", @@ -7562,6 +8970,62 @@ "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, "time": "2022-06-03T18:03:27+00:00" + }, + { + "name": "willdurand/negotiation", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/willdurand/Negotiation.git", + "reference": "68e9ea0553ef6e2ee8db5c1d98829f111e623ec2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/willdurand/Negotiation/zipball/68e9ea0553ef6e2ee8db5c1d98829f111e623ec2", + "reference": "68e9ea0553ef6e2ee8db5c1d98829f111e623ec2", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Negotiation\\": "src/Negotiation" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "William Durand", + "email": "will+git@drnd.me" + } + ], + "description": "Content Negotiation tools for PHP provided as a standalone library.", + "homepage": "http://williamdurand.fr/Negotiation/", + "keywords": [ + "accept", + "content", + "format", + "header", + "negotiation" + ], + "support": { + "issues": "https://github.com/willdurand/Negotiation/issues", + "source": "https://github.com/willdurand/Negotiation/tree/3.1.0" + }, + "time": "2022-01-30T20:08:53+00:00" } ], "packages-dev": [ @@ -9844,5 +11308,5 @@ "ext-iconv": "*" }, "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.6.0" } diff --git a/config/bundles.php b/config/bundles.php index 4e3a560..14a7523 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -13,4 +13,6 @@ return [ Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], + Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], + ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], ]; diff --git a/config/packages/api_platform.yaml b/config/packages/api_platform.yaml new file mode 100644 index 0000000..02f295a --- /dev/null +++ b/config/packages/api_platform.yaml @@ -0,0 +1,7 @@ +api_platform: + title: Hello API Platform + version: 1.0.0 + defaults: + stateless: true + cache_headers: + vary: ['Content-Type', 'Authorization', 'Origin'] diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml index 4b88a05..7151546 100644 --- a/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -4,7 +4,9 @@ framework: csrf_protection: true # Note that the session will be started ONLY if you read or write from it. - session: true + session: + enabled: true + cookie_lifetime: 3600 #esi: true #fragments: true diff --git a/config/packages/nelmio_cors.yaml b/config/packages/nelmio_cors.yaml new file mode 100644 index 0000000..c766508 --- /dev/null +++ b/config/packages/nelmio_cors.yaml @@ -0,0 +1,10 @@ +nelmio_cors: + defaults: + origin_regex: true + allow_origin: ['%env(CORS_ALLOW_ORIGIN)%'] + allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE'] + allow_headers: ['Content-Type', 'Authorization'] + expose_headers: ['Link'] + max_age: 3600 + paths: + '^/': null diff --git a/config/packages/security.yaml b/config/packages/security.yaml index 448631d..3f96452 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -38,6 +38,9 @@ security: - { path: ^/admin, roles: ROLE_ADMIN } - { path: ^/profile, roles: ROLE_USER } - { path: ^/bibliography, roles: ROLE_USER } + - { path: ^/collection, roles: ROLE_USER } + - { path: ^/object, roles: ROLE_USER } + - { path: ^/site, roles: ROLE_USER } when@test: security: diff --git a/config/routes/api_platform.yaml b/config/routes/api_platform.yaml new file mode 100644 index 0000000..38f11cb --- /dev/null +++ b/config/routes/api_platform.yaml @@ -0,0 +1,4 @@ +api_platform: + resource: . + type: api_platform + prefix: /api diff --git a/src/Controller/BibliographyController.php b/src/Controller/BibliographyController.php index dd5cf80..d1308ee 100644 --- a/src/Controller/BibliographyController.php +++ b/src/Controller/BibliographyController.php @@ -3,6 +3,7 @@ namespace App\Controller; use App\Entity\Bibliography; +use App\Form\BibliographyType; //use App\Security\Voter\VocabVoter; use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; @@ -23,10 +24,18 @@ class BibliographyController extends AbstractController } #[Route('/bibliography', name: 'app_bibliography_landing')] - public function landing(): Response + public function landing(EntityManagerInterface $em): Response { + $repo = $em->getRepository(Bibliography::class); + $records = $repo->findBy([], ['modifiedAt' => 'DESC']); + $count = count($records); + + $records = array_slice($records, 0, 15); + return $this->render('bibliography/landing.html.twig', [ 'controller_name' => 'BibliographyController', + 'records' => $records, + 'count' => $count, ]); } @@ -38,11 +47,30 @@ class BibliographyController extends AbstractController ]); } - #[Route('/bibliography/add', name: 'app_bibliography_add')] + /** + * @todo Permissions with voter + */ + #[Route('/bibliography/add', name: 'app_bibliography_create')] public function add(): Response { - return $this->render('bibliography/add.html.twig', [ + $form = $this->createForm(BibliographyType::class); + + return $this->render('bibliography/create.html.twig', [ 'controller_name' => 'BibliographyController', + 'form' => $form, ]); } + /** + * @todo Permissions! + */ + #[Route('/bibliography/delete/{id<\d+>}', name: 'app_bibliography_del')] + public function delete(Bibliography $bibliography, EntityManagerInterface $em): Response + { + $em->remove($bibliography); + $em->flush(); + + $this->addFlash('notice', 'Term deleted successfully'); + + return $this->redirectToRoute('app_bibliography_landing'); + } } diff --git a/src/Controller/CollectionController.php b/src/Controller/CollectionController.php new file mode 100644 index 0000000..9968433 --- /dev/null +++ b/src/Controller/CollectionController.php @@ -0,0 +1,26 @@ +}', name: 'app_collection')] + public function index(Collection $collection, EntityManagerInterface $em): Response + { + $bibliographies = $em->getRepository(Bibliography::class)->findAllCollection($collection->getId()); + + $collection->setBibliographies($bibliographies); + + return $this->render('collection/index.html.twig', [ + 'controller_name' => 'CollectionController', + 'record' => $collection, + ]); + } +} diff --git a/src/Controller/VocabObjectTypeController.php b/src/Controller/VocabObjectTypeController.php new file mode 100644 index 0000000..e921a62 --- /dev/null +++ b/src/Controller/VocabObjectTypeController.php @@ -0,0 +1,34 @@ +getUser()->getRoles(); + + if (in_array('ROLE_READER', $roles)) { + $this->addFlash('warning', 'Only editors, revisors and administrators can view vocabularies'); + return $this->redirectToRoute('app_home'); + } + + $terms = $em->getRepository(VocabObjectType::class) + ->findBy([], ['term' => 'ASC']); + + return $this->render('vocab_object_type/index.html.twig', [ + 'controller_name' => 'VocabObjectTypeController', + 'terms' => $terms + ]); + } +} diff --git a/src/Entity/Bibliography.php b/src/Entity/Bibliography.php index 261ae0d..fdf4ef6 100644 --- a/src/Entity/Bibliography.php +++ b/src/Entity/Bibliography.php @@ -2,14 +2,14 @@ namespace App\Entity; -//use App\Repository\UserRepository; - +use App\Repository\BibliographyRepository; use DateTimeImmutable; use Doctrine\ORM\Mapping as ORM; use Doctrine\DBAL\Types\Types; use App\RecordStatus; +use Doctrine\Common\Collections\Collection as DoctrineCollection; -#[ORM\Entity()] +#[ORM\Entity(repositoryClass: BibliographyRepository::class)] #[ORM\Table(name: 'bibliography')] class Bibliography { @@ -42,6 +42,20 @@ class Bibliography #[ORM\Column(length: 100, name: 'creator')] private ?string $creator = null; + #[ORM\JoinTable(name: 'rel_riferimento_collezione')] + #[ORM\JoinColumn(name: 'Bibliografia_id_bib', referencedColumnName: 'id')] + #[ORM\InverseJoinColumn(name: 'Collezione_id_coll', referencedColumnName: 'id')] + #[ORM\ManyToMany(targetEntity: Collection::class)] + private DoctrineCollection $collections; + + private DoctrineCollection $documents; + + private DoctrineCollection $objects; + + private DoctrineCollection $persons; + + private DoctrineCollection $sites; + public function getId(): ?int { return $this->id; @@ -143,4 +157,16 @@ class Bibliography return $this; } + + public function getCollections(): ?DoctrineCollection + { + return $this->collections; + } + + public function setCollections(DoctrineCollection $collections): static + { + $this->collections = $collections; + + return $this; + } } diff --git a/src/Entity/Collection.php b/src/Entity/Collection.php new file mode 100644 index 0000000..05d7e27 --- /dev/null +++ b/src/Entity/Collection.php @@ -0,0 +1,295 @@ +id; + } + + public function getStatus(): ?string + { + $status = RecordStatus::tryFrom($this->status); + return $status->toString(); + } + + public function setStatus(int $status): static + { + $this->status = $status; + + return $this; + } + + public function getModifiedAt(): ?DateTimeImmutable + { + return $this->modifiedAt; + } + + public function setModifiedAt(DateTimeImmutable $modifiedAt): static + { + $this->modifiedAt = $modifiedAt; + + return $this; + } + + public function getOwner(): ?string + { + return $this->owner; + } + + public function setOwner(string $owner): static + { + $this->owner = $owner; + + return $this; + } + + public function getEditor(): ?string + { + return $this->editor; + } + + public function setEditor(string $editor): static + { + $this->editor = $editor; + + return $this; + } + + public function getCreator(): ?string + { + return $this->creator; + } + + public function setCreator(string $creator): static + { + $this->creator = $creator; + + return $this; + } + + public function getTitle(): ?string + { + return $this->title; + } + + public function setTitle(string $title): static + { + $this->title = $title; + + return $this; + } + + public function getChronology(): ?string + { + return $this->chronology; + } + + public function setChronology(string $chronology): static + { + $this->chronology = $chronology; + + return $this; + } + + public function getStartDate(): ?int + { + return $this->startDate; + } + + public function setStartDate(int $startDate): static + { + $this->startDate = $startDate; + + return $this; + } + + public function getEndDate(): ?int + { + return $this->endDate; + } + + public function setEndDate(int $endDate): static + { + $this->endDate = $endDate; + + return $this; + } + + public function getDescription(): ?string + { + return $this->description; + } + + public function setDescription(string $description): static + { + $this->description = $description; + + return $this; + } + + public function getShortDescription(): ?string + { + return $this->shortDescription; + } + + public function setShortDescription(string $shortDescription): static + { + $this->shortDescription = $shortDescription; + + return $this; + } + + public function getExternalIdentifier(): ?string + { + return $this->externalIdentifier; + } + + public function setExternalIdentifier(string $externalIdentifier): static + { + $this->externalIdentifier = $externalIdentifier; + + return $this; + } + + public function getLink(): ?string + { + return $this->link; + } + + public function setLink(string $link): static + { + $this->link = $link; + + return $this; + } + + public function getSubjectHeadings(): ?string + { + return $this->link; + } + + public function setSubjectHeadings(string $subjectHeadings): static + { + $this->subjectHeadings = $subjectHeadings; + + return $this; + } + + public function getUri(): ?string + { + return $this->uri; + } + + public function setUri(string $uri): static + { + $this->uri = $uri; + + return $this; + } + + public function getNotes(): ?string + { + return $this->notes; + } + + public function setNotes(string $notes): static + { + $this->notes = $notes; + + return $this; + } + + public function getBibliographies(): ?DoctrineCollection + { + return $this->bibliographies; + } + + public function setBibliographies(DoctrineCollection $bibliographies): static + { + $this->bibliographies = $bibliographies; + + return $this; + } +} diff --git a/src/Entity/VocabObjectType.php b/src/Entity/VocabObjectType.php new file mode 100644 index 0000000..18d6f0a --- /dev/null +++ b/src/Entity/VocabObjectType.php @@ -0,0 +1,37 @@ +id; + } + + public function getTerm(): ?string + { + return $this->term; + } + + public function setTerm(string $term): static + { + $this->term = $term; + + return $this; + } +} + diff --git a/src/Form/BibliographyType.php b/src/Form/BibliographyType.php new file mode 100644 index 0000000..1906b0e --- /dev/null +++ b/src/Form/BibliographyType.php @@ -0,0 +1,51 @@ +add('status', ChoiceType::class, [ + 'choices' => [ + '-- Select status --' => '', + 'Draft' => 1, + 'Complete' => 2, + 'Unindexed' => 3, + 'Published' => 4, + ], + 'label' => 'Status (*)' + ]) + ->add( + 'editor', + TextType::class, + [ + 'label' => 'Editor(s) (*)' + ] + ) + ->add('citation', TextType::class, ['label' => 'Citation (*)']) + ->add('reference', TextareaType::class, ['label' => 'Reference (*)']) + ->add('notes', TextareaType::class, ['label' => 'Editorial notes', 'required' => false]) + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Bibliography::class, + ]); + } +} diff --git a/src/Repository/BibliographyRepository.php b/src/Repository/BibliographyRepository.php index a00ccda..b4db3d9 100644 --- a/src/Repository/BibliographyRepository.php +++ b/src/Repository/BibliographyRepository.php @@ -5,6 +5,8 @@ namespace App\Repository; use App\Entity\Bibliography; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; +use Doctrine\Common\Collections\ArrayCollection; +use Doctrine\ORM\Query\ResultSetMappingBuilder; /** * @extends ServiceEntityRepository @@ -15,5 +17,24 @@ class BibliographyRepository extends ServiceEntityRepository { parent::__construct($registry, Bibliography::class); } + + public function findAllCollection(int $collectionId): ?ArrayCollection + { + $rsm = new ResultSetMappingBuilder($this->getEntityManager()); + $rsm->addRootEntityFromClassMetadata('App\Entity\Bibliography', 'b'); + + $query = $this->getEntityManager()->createNativeQuery( + "SELECT id, stato, editor, cit_bib, rif_bib FROM bibliography b + JOIN rel_riferimento_collezione + ON Bibliografia_id_bib = id + WHERE Collezione_id_coll = :collId", + $rsm + ); + $query->setParameter('collId', $collectionId); + + $bibliographies = new ArrayCollection($query->getResult()); + + return $bibliographies; + } } diff --git a/src/Repository/CollectionRepository.php b/src/Repository/CollectionRepository.php new file mode 100644 index 0000000..73bdd51 --- /dev/null +++ b/src/Repository/CollectionRepository.php @@ -0,0 +1,20 @@ + + */ +class CollectionRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Collection::class); + } +} + diff --git a/src/Repository/VocabObjectTypeRepository.php b/src/Repository/VocabObjectTypeRepository.php new file mode 100644 index 0000000..3a47a3b --- /dev/null +++ b/src/Repository/VocabObjectTypeRepository.php @@ -0,0 +1,18 @@ + + */ +class VocabObjectTypeRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, VocabObjectType::class); + } +} diff --git a/symfony.lock b/symfony.lock index 246a271..faf19f5 100644 --- a/symfony.lock +++ b/symfony.lock @@ -1,4 +1,18 @@ { + "api-platform/symfony": { + "version": "4.0", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "4.0", + "ref": "e9952e9f393c2d048f10a78f272cd35e807d972b" + }, + "files": [ + "config/packages/api_platform.yaml", + "config/routes/api_platform.yaml", + "src/ApiResource/.gitignore" + ] + }, "doctrine/doctrine-bundle": { "version": "2.13", "recipe": { @@ -26,6 +40,18 @@ "migrations/.gitignore" ] }, + "nelmio/cors-bundle": { + "version": "2.5", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "1.5", + "ref": "6bea22e6c564fba3a1391615cada1437d0bde39c" + }, + "files": [ + "config/packages/nelmio_cors.yaml" + ] + }, "phpunit/phpunit": { "version": "9.6", "recipe": { @@ -248,6 +274,15 @@ "templates/base.html.twig" ] }, + "symfony/uid": { + "version": "7.1", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "7.0", + "ref": "0df5844274d871b37fc3816c57a768ffc60a43a5" + } + }, "symfony/ux-turbo": { "version": "v2.21.0" }, diff --git a/templates/bibliography/create.html.twig b/templates/bibliography/create.html.twig new file mode 100644 index 0000000..9242752 --- /dev/null +++ b/templates/bibliography/create.html.twig @@ -0,0 +1,72 @@ +{% extends 'data_entry.html.twig' %} + +{% block title %}Bibliography - Add new | ArCOA{% endblock %} + +{% block rightpanel %} +
+

Bibliography

+

Add new record

+ + +
+ {{ form_start(form) }} +
+ +
+ {{ form_widget(form.status) }} +
+
+
+ +
+ {{ + form_widget( + form.editor, + {'attr': {'class': 'input', 'placeholder': 'Name of the editor (mandatory)'}} + ) + }} +
+
+
+ +
+ {{ form_widget(form.citation, {'attr': {'class': 'input'}}) }} +
+
+
+ +
+ {{ form_widget(form.reference, {'attr': {'class': 'textarea'}}) }} +
+
+
+ +
+ {{ form_widget(form.notes, {'attr': {'class': 'textarea'}}) }} +
+
+
+
+ +
+
+ {{ form_end(form) }} +
+
+ +{% endblock %} \ No newline at end of file diff --git a/templates/bibliography/index.html.twig b/templates/bibliography/index.html.twig index 724cad8..effa97c 100644 --- a/templates/bibliography/index.html.twig +++ b/templates/bibliography/index.html.twig @@ -1,6 +1,6 @@ {% extends 'data_entry.html.twig' %} -{% block title %}Bibliography | ArCOA{% endblock %} +{% block title %}Bibliography - {{ record.citation }} | ArCOA{% endblock %} {% block rightpanel %}
@@ -16,6 +16,7 @@

Editor: {{ record.editor }}

+
{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_REVISOR') %}
@@ -27,12 +28,18 @@ - + Delete - +
{% endif %} @@ -55,7 +62,56 @@ - + - + + + + {% endblock %} \ No newline at end of file diff --git a/templates/bibliography/landing.html.twig b/templates/bibliography/landing.html.twig index a83ca67..a79f02a 100644 --- a/templates/bibliography/landing.html.twig +++ b/templates/bibliography/landing.html.twig @@ -7,19 +7,25 @@

Bibliography

Choose action

+ {% for message in app.flashes('notice') %} +
+ + {{ message }} +
+ {% endfor %}
{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_REVISOR') or is_granted('ROLE_EDITOR') %}
+ +

Records

+

{{ count }} result(s) found

+ + + + + + + + + + + {% for record in records %} + + + + + + + + + + {% endfor %} +
IDCitationStatusEditorReferenceLast modifiedActions
{{ record.id }}{{ record.citation }}{{ record.status }}{{ record.owner }}{{ record.reference }} + {{ record.modifiedAt.format('Y-m-d') }}
+ {{ record.editor }} at {{ record.modifiedAt.format('H:i:s') }} +
+
+ + +
+
- + {% endblock %} diff --git a/templates/collection/index.html.twig b/templates/collection/index.html.twig new file mode 100644 index 0000000..28035ea --- /dev/null +++ b/templates/collection/index.html.twig @@ -0,0 +1,89 @@ +{% extends 'data_entry.html.twig' %} + +{% block title %}Collection - {{ record.title }} | ArCOA{% endblock %} + +{% block rightpanel %} +
+

Collection

+

{{ record.title }}

+ +
+
+

+ Last modified: {{ record.modifiedAt.format('Y-m-d') }} + at {{ record.modifiedAt.format('H:i:s') }} +

+

Editor: {{ record.editor }}

+
+
+
+ {% if is_granted('ROLE_ADMIN') or is_granted('ROLE_REVISOR') %} +
+
+
+ + + +
+
+ {% endif %} +
+
    +
  • Record
  • +
  • Relations
  • +
+
+
+ + + + + + + + + + + + + + + +
Record ID{{ record.id }}
Status{{ record.getStatus() }}
Editor(s){{ record.editor }}
Collection name{{ record.title }}
Chronology{{ record.chronology }}
Start date{{ record.startDate }}
End date{{ record.endDate }}
Description{{ record.description }}
Short description{{ record.shortDescription }}
External identifier(s){{ record.externalIdentifier }}
External link(s){{ record.link }}
Subject headings{{ record.subjectHeadings }}
ArCOA URI{{ record.uri }}
Editorial notes{{ record.notes }}
+
+ +
+
+ +{% endblock %} \ No newline at end of file diff --git a/templates/data_entry.html.twig b/templates/data_entry.html.twig index 1c2f65d..da3c035 100644 --- a/templates/data_entry.html.twig +++ b/templates/data_entry.html.twig @@ -3,9 +3,12 @@ {% block body %}
-
diff --git a/templates/vocab_func_context/index.html.twig b/templates/vocab_func_context/index.html.twig index e44298e..95e8d0f 100644 --- a/templates/vocab_func_context/index.html.twig +++ b/templates/vocab_func_context/index.html.twig @@ -87,7 +87,7 @@ terms.addEventListener('click', async (event) => { const clicked = event.target; - if (clicked.classList.contains('is-danger')) { + if (clicked.getAttribute('data-id-delete')) { const termId = clicked.getAttribute('data-id-delete'); const data = new FormData; @@ -103,7 +103,7 @@ if (res.status === 200) { notice.innerHTML = ` - Term updated successfully + Term deleted successfully `; notice.classList.remove('is-hidden'); notice.querySelector('.delete').addEventListener('click', () => { diff --git a/templates/vocab_object_type/index.html.twig b/templates/vocab_object_type/index.html.twig new file mode 100644 index 0000000..9cf33af --- /dev/null +++ b/templates/vocab_object_type/index.html.twig @@ -0,0 +1,167 @@ +{% extends 'data_entry.html.twig' %} + +{% block title %}Vocab - Functional context | ArCOA{% endblock %} + +{% block rightpanel %} +
+

Vocabulary

+

Object type

+ +
+ + {% if is_granted('ROLE_ADMIN') or is_granted('ROLE_REVISOR') %} +
+ +
+
+ +
+
+ +
+
+
+ {% endif %} + + + {% for message in app.flashes('notice') %} +
+ + {{ message }} +
+ {% endfor %} +

Terms in vocabulary

+ + {% if is_granted('ROLE_ADMIN') or is_granted('ROLE_REVISOR') %}{% endif %} + {% for term in terms %} + + + {% if is_granted('ROLE_ADMIN') or is_granted('ROLE_REVISOR') %} + + {% endif %} + + {% endfor %} +
TermActions
+ + +
+ + + +
+
+ +
+
+ +{% endblock %} \ No newline at end of file