Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Commit

Permalink
add entity + easyadmin
Browse files Browse the repository at this point in the history
  • Loading branch information
macintoshplus committed Jun 10, 2020
1 parent 7ce9c8b commit 139a597
Show file tree
Hide file tree
Showing 23 changed files with 1,746 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ APP_SECRET=1cfb268791faa36148b27cf29db67cbe
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# For a PostgreSQL database, use: "postgresql://db_user:[email protected]:5432/db_name?serverVersion=11&charset=utf8"
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7
DATABASE_URL=mysql://root:nopassword@127.0.0.1:3306/cua?serverVersion=mariadb-10.5.0
###< doctrine/doctrine-bundle ###
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###

/mysql
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"php": "^7.2.5",
"ext-ctype": "*",
"ext-iconv": "*",
"easycorp/easyadmin-bundle": "^2.3",
"sensio/framework-extra-bundle": "^5.1",
"symfony/asset": "5.1.*",
"symfony/console": "5.1.*",
Expand Down
152 changes: 151 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
EasyCorp\Bundle\EasyAdminBundle\EasyAdminBundle::class => ['all' => true],
];
71 changes: 71 additions & 0 deletions config/packages/easy_admin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
easy_admin:
list:
max_results: 30
entities:
# List the entity class name you want to manage
Customer:
class: App\Entity\Customer
label: Customers
form:
fields:
- property: 'name'

- property: 'contacts'
type: 'collection'
type_options:
entry_type: App\Form\ContactEmbeddedFormType
allow_delete: true
allow_add: true
by_reference: false
Project:
class: App\Entity\Project
list:
fields: ['code', 'customer', 'name', 'enabled', 'checkDependencies', 'checkSecurity', 'contacts']
form:
fields:
-
property: 'code'
help: 'Need unique. Max 10 char'
-
property: 'customer'
help: 'Customer owner of this project'
-
property: 'name'
-
property: 'path'
help: 'Path of the project on server'
-
property: 'lockPath'
help: 'Project composer.lock path. relativ to the path project.'
-
property: 'phpPath'
help: 'PHP executable name or absolute path.'
-
property: 'privateDependencies'
help: 'List here (one per line) all private depdendencies included in this project.'
-
property: 'privateDependenciesStrategy'
type: 'choice'
type_options:
choices: {'Remove': 'remove', 'Hash': 'hash'}
help: 'Select the strategy to proccess the private dependencies before send composer.lock to the security check service.'
-
property: 'checkDependencies'
-
property: 'checkSecurity'
-
property: 'enabled'
-
property: 'contacts'
type: 'entity'
type_options: { class: 'App\Entity\Contact', multiple: true, attr: { data-widget: 'select2'} }
Dependency:
class: App\Entity\Dependency
list:
fields: ['id', 'project', 'library', 'version', 'state', 'toVersion', 'deprecated', 'updatedAt']
actions: ['-edit', '-remove', '-new']
SecurityIssue:
class: App\Entity\SecurityIssue
list:
fields: ['id', 'project', 'library', 'version', 'state', 'updatedAt']
actions: ['-edit', '-remove', '-new', 'show']
4 changes: 4 additions & 0 deletions config/routes/easy_admin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
easy_admin_bundle:
resource: '@EasyAdminBundle/Controller/EasyAdminController.php'
prefix: /
type: annotation
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3.1'

services:
db:
image: library/mariadb:10.5
environment:
MYSQL_ROOT_PASSWORD: nopassword
volumes:
- ./mysql/data:/var/lib/mysql
ports:
- "3306:3306"

Loading

0 comments on commit 139a597

Please sign in to comment.