whatwedo / crudbundle Goto Github PK
View Code? Open in Web Editor NEWeasy CRUD operations to rapid prototype a web application
Home Page: https://whatwedo.github.io/CrudBundle/
License: MIT License
easy CRUD operations to rapid prototype a web application
Home Page: https://whatwedo.github.io/CrudBundle/
License: MIT License
basierend auf Klassennamen
Wird aktuell bei allen Actions ausser der indexActions mitgegeben
Wenn per Query-Parameter Informationen zu einer Entity erwartet werden, wird normalerweise als Form Type EntityHiddenType
verwendet. Dies funktioniert jedoch nicht, wenn es nicht sicher ist, ob eine mitgegeben wird. In diesem Fall muss ein AjaxSelectFormType
genommen werden.
Aktuell muss dies mit Konditionen programmiert werden. Mittels einer Kreuzung der beiden (PreselectEntityFormType
) könnte eine einfachere Lösung umgesetzt werden.
Konsequent durch den Alias ersetzen
->addContent('trainer', null, [
'label' => 'Trainer',
'preselect_definition' => TrainerDefinition::class, // to know which parameter is the preselected user
'form_type' => EntityHiddenType::class,
'form_options' => [
'class' => TrainerDefinition::getEntity(),
],
])
Clear route cache automatically
since PHP can be written typesafe, adding a __toString() Method to the Entities is bad.
here is a Sample Issue found in a project:
/**
* @ORM\Entity
*/
class Locale
{
...
public function __toString(): string
{
return (string)$this->getName();
}
}
class Translator {
/*
* @param string $locale The locale (en, ru, fr) | null If null, will try with current locale
*/
public function translate(?string $locale = null): TranslationInterface
{
return $this->doTranslate($locale);
}
}
$locale = new Locale();
$locale->setName('German');
$locale->setLocale('de');
$translator = new Translator()
// works, but is wrong
$translator->translate($locale);
// should be
$translator->translate($locale->getLocale());
Possible Solution:
Automatically add require=true to form input if entity value is not nullable and require is not already set
how can we better handle Inheritance Mapping?
instead of using the LinkIt() method to link the Entity use a "EntityLinkFormatter" instead
Easily possible when we inject the container into Content.php
Als getQueryAlias den generierten Alias von #30 verwenden
Optimizing and simplifying AJAX integration
Varianten:
Bundle installation fails if the whatwedo/search-bundle
is not installed:
/var/www $ composer require whatwedo/crud-bundle
Using version ^0.4.5 for whatwedo/crud-bundle
./composer.json has been updated
Running composer update whatwedo/crud-bundle
Loading composer repositories with package information
Updating dependencies
Lock file operations: 3 installs, 0 updates, 0 removals
- Locking whatwedo/core-bundle (v0.4.0)
- Locking whatwedo/crud-bundle (v0.4.5)
- Locking whatwedo/table-bundle (v0.4.7)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 3 installs, 0 updates, 0 removals
- Downloading whatwedo/core-bundle (v0.4.0)
- Downloading whatwedo/table-bundle (v0.4.7)
- Downloading whatwedo/crud-bundle (v0.4.5)
- Installing whatwedo/core-bundle (v0.4.0): Extracting archive
- Installing whatwedo/table-bundle (v0.4.7): Extracting archive
- Installing whatwedo/crud-bundle (v0.4.5): Extracting archive
Generating optimized autoload files
composer/package-versions-deprecated: Generating version class...
composer/package-versions-deprecated: ...done generating version class
109 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Symfony operations: 3 recipes (63010ebfeaa3ff87c890bec156fcfc37)
- Configuring whatwedo/core-bundle (>=v0.4.0): From auto-generated recipe
- Configuring whatwedo/table-bundle (>=v0.4.7): From auto-generated recipe
- Configuring whatwedo/crud-bundle (>=v0.4.5): From auto-generated recipe
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 1
!!
!! In DefinitionErrorExceptionPass.php line 54:
!!
!! Cannot autowire service "whatwedo\TableBundle\EventListener\AjaxFilterSearc
!! hListener": argument "$indexRepository" of method "__construct()" has type
!! "whatwedo\SearchBundle\Repository\IndexRepository" but this class was not f
!! ound.
!!
!!
!!
Script @auto-scripts was called via post-update-cmd
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
If you overwrite the default Crud-controller to add an Action, the definition on the Parent-controller is null.
To overcome this you have to set ,defaults={ "_resource"=XXXDefinition::class }
inside the Route annotation; eg
@Route("/feature/xxx", name="whatwedo_feature_xxx",defaults={ "_resource"=XXXDefinition::class })
This should be updated in the documentation.
Es soll möglich sein den letzten Filter zu entfernen. Beim entfernen des letzten Filter, wird das Filter Formular ausgeblendet
Allow sort Entity.
indexAction
benötigt das Request-Objektthe RelationContent needs a security voter to hide or show the add button => add_voter_attribute
Currently it's used "Übersicht". On the index page it should display the entityTitle by default
Repository->find()
Make request parameters globally available (in CRUD classes)
Um mehr Daten an einer Stelle zu konfigurieren, welche unabhängig vom View sind
Alle automatischen Filter, welche eine Relation durchsuchen (z.B. Gruppen -> Personen oder umgekehrt) sollen per AJAX geladen werden. Bei grösseren Tabellen (> 10'000 Einträge) werden die Ladezeiten ansonsten unzumutbar oder wir laufen in Timeouts / Memory Limits
Gleiches in Ticket #2 für Formularfelder
how can we auto-configure relation's?
Referencing controllers with whatwedoCrudBundle:Relation:ajax is deprecated since Symfony 4.1, use "whatwedo\CrudBundle\Controller\RelationController::ajaxAction" instead.
1x in DefinitionTest::testDefinitions from App\Tests\Common
1x in DefinitionTest::testOrdering from App\Tests\Common
Mit commit e161ea0 wurde es Möglich die box Templates zu überschreiben. Zurzeit gibt es erst einen Twig Block (show.html.twig - add_button):
Überall wo es Sinn gibt einen Block hinzufügen.
CrudBundle/Form/EntityAjaxType.php
Line 28 in 97694f2
sollte das nicht 'namespace whatwedo\CrudBundle\Form;' sein?
if a FormType has set the attr
Option as default. For example a Custom DateTime Picker. The attr
option will be overwritten be the Content::getFormOptions()
function
Because the function sets the help
in the attr
array.
[
'attr' => [
'help' => 'my help'
]
]
The correct way to set the Help on an FormType is to use the help
option.
For to achive this Content::getFormOptions()
, edit.html.twig
and create.html.twig
must be changed and the
Build the form according to the Asserts defined in the Entity
See: http://symfony.com/blog/helping-prepare-for-symfony-4-bundle-support
Formulare, welche eine Relation zu einer anderen Tabelle haben, sollen per AJAX durchsucht werden, statt select
-Felder mit (schlimmstenfalls) mehreren tausend Einträgen vorzuladen. Siehe #1
Dazu ein eigener Form-Type erstellen, damit es optional ist
Make request object globally available (in CRUD classes)
Es soll möglich sein, die Filter zu speichern. Aktuell ist zwar das Formular aber keine Aktion verfügbar.
Der Filter soll auch für die ID funktionieren.
There is not a single event fired. needs to be added
it would be nice to use the translator for the labeling of fields, titles, ...
http://symfony.com/doc/current/translation.html
TBD
die möglichen Routen müssen direkt aus der Definition generiert werden können, um solche Workarounds zu vermeiden:
$definitionObject::getRoutePrefix().'_'.RouteEnum::INDEX
Use whatwedo Table in RelationContent instead of jQuery Datatables
CrudBundle/Content/AbstractContent.php
Line 149 in ef8aefc
Is it necessary to wrap the $row
parameter into an array?
Method CrudController:: denyAccessUnlessGranted
is overriding final method Symfony\Bundle\FrameworkBundle\Controller\AbstractController::denyAccessUnlessGranted()
. Symfony\Bundle\FrameworkBundle\Controller\AbstractController::denyAccessUnlessGranted()
will crash if CrudBundle is used with disabled firewall authentication.
@lukasluecke @xarem do you have any idea how to implement this beautifully?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.