Giter Site home page Giter Site logo

whatwedo / crudbundle Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 4.0 1.14 MB

easy CRUD operations to rapid prototype a web application

Home Page: https://whatwedo.github.io/CrudBundle/

License: MIT License

PHP 77.77% JavaScript 5.23% CSS 0.20% Twig 16.53% Makefile 0.20% SCSS 0.08%
bundle hacktoberfest php symfony symfony-bundle

crudbundle's People

Contributors

71m024 avatar arnoegli avatar kusiboss avatar lukasluecke avatar marcwieland95 avatar ruesa18 avatar rugbymauri avatar s4mpl3d avatar tuxes3 avatar xarem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crudbundle's Issues

Form Type für preselect definitions

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.

Update DOC for EntityHiddenType

            ->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(),
                ],
            ])

remove __toString() Method in Entities

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:

  • Move the "__toString()" Method to the Definition
  • introduce a TwigFilter for calling the "toString()" Definition

Optimizing AJAX

Optimizing and simplifying AJAX integration

Varianten:

  • AjaxListenExtension (o.ä.)
  • Form Type wrappen

Bundle without whatwedo/search-bundle broken

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.

Update documentation for routing

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.

Filter entfernen

Es soll möglich sein den letzten Filter zu entfernen. Beim entfernen des letzten Filter, wird das Filter Formular ausgeblendet

Verbesserungsideen

Ideen

  • Relationen müssen immer eigenständig mit Filterungen programmiert werden

Anpassungen

  • indexAction benötigt das Request-Objekt

RelationContent Voter

the RelationContent needs a security voter to hide or show the add button => add_voter_attribute

getRepository aus DefinitionInterface entfernen

  • getRepository() muss komplett aus dem DefinitionInterface entfernt werden, damit nur der QueryBuilder der Definition genutzt wird
  • CrudController muss via QueryBuilder die aktuelle Entity holen, nicht via Repository->find()

CSV Export auslagern

  • Alle Infos aus dem DefinitionBuilder nehmen
  • Als Extension
  • ähnlich wie FilterExtension: allow add / remove of content / columns

Filter mit Relationen per AJAX laden

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

screenshot 2017-01-24 13 34 02

Usage of deprecated whatwedoCrudBundle:Relation:ajax

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

Content::getFormOptions() overwrite 'attr' Defaults

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

Relationen in Formularfelder per AJAX laden

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

Filter speichern

Es soll möglich sein, die Filter zu speichern. Aktuell ist zwar das Formular aber keine Aktion verfügbar.

Routen aus der Definition generieren

die möglichen Routen müssen direkt aus der Definition generiert werden können, um solche Workarounds zu vermeiden:

$definitionObject::getRoutePrefix().'_'.RouteEnum::INDEX

CrudController:: denyAccessUnlessGranted overriding final method

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.