alterphp / easyadminextensionbundle Goto Github PK
View Code? Open in Web Editor NEWProvides some additional features to EasyAdminBundle for Symfony
License: MIT License
Provides some additional features to EasyAdminBundle for Symfony
License: MIT License
I am on symfony 3.4 and I have EasyAdminBundle list overrided. But if I add EasyAdminExtensionBundle, the TwigPathPass is overriding this and using original list twig file.
How can I achieve this?
Thanks
Pass the handked object in the isGranted
checks to take advantage of voters if implemented.
Is it possible to define default filters?
Add an option taking listed entity properties as parameters and filtering corresponding columns.
Hi, can I add the embedded list in the show action? I managed to do that just in the edit action. Thanks a lot!
Not implementing the static getExtendedTypes() method in AlterPHP\EasyAdminExtensionBundle\Form\Type\Extension\EasyAdminAutocompleteTypeExtension when implementing the Symfony\Component\Form\FormTypeExtensionInterface is deprecated since Symfony 4.2. The method will be added to the interface in 5.0.
Would be neat if that could be implemented :)
Hi,
I'm having trouble with one embedded list filter, declared as followed :
- { property: 'jobs', label: '', type: 'embedded_list', type_options: { entity: 'Job', filters: { 'entity.company_vendor': 'form:parent.data.worker_company.id' }} }
But it will generate a request like this :
localhost/admin/?entity=Job&action=list&filters%5Bentity.author%5D=19651a30-2b6d-11e8-aa77-24adf7d02a63&filters%5Bentity.company_vendor%5D=12117956-2b70-11e8-aa77-24adf7d02a63&sortField=start_date&sortDirection=DESC
AS you can see, it will always incude 'entity.author' in the filters, even if I do not declare it.
Any idea why ?
Thanks in advance,
Julien
Deletion (when allowed) is forbidden from embedded lists as it can not share document delete modal.
Embedded lists on handle OneToMany relations (and generate an error/warning) when trying to use them with ManyToMany relations.
security.yaml
role_hierarchy:
ROLE_USER: ROLE_USER
ROLE_ADMIN: [ROLE_ADMIN, ROLE_USER]
ROLE_SUPER_ADMIN: ROLE_ADMIN
Generated Form:
its correct?
Adds followinf filters operators :
Hello. Thank you for this amazing work of yours.
Is there a way that embedded_list
can specify which columns
to display?
In v2.0 filters do not expand upon click and remain collapsed. This is caused by EasyCorp/EasyAdminBundle@ea51399#diff-8b95a20e21550730e7b5557f56908c73R6 - only modal
, tab
, tooltip
and popover
are now imported and the collapse
is missing.
No Ajax call is done...
As MenuConfigPass seems to be cached in production mode, it is generated without any user context..
So any menu item that requires a role is hidden.
We should apply filtering on display...
symfony 3.4
easyadmin 1.17
extension: 1.3.3
list:
form_filters:
- { property: published, label: 'titi' }
- { property: postType, label: 'toto' }
but on the admin i got the property as the label, not my own label
why?
Easyadmin assigns a menuIndex and a submenuIndex to each menu item. In this bundle if you have no role for viewing that entity, the menu item is not displayed. but the menuIndex is not changed.
So if you click on the next item. It puts active the next item in the menu. I think I am not explaining me as well as I want. Let me show in some pictures.
Stats -> menuIndex: 0
Client -> menuIndex: 1
User -> menuIndex: 2
Ticket -> menuIndex: 3
Client -> menuIndex: 4
This one is correct. You enter "User" and it activates "user" menu item.
Stats -> menuIndex: 0
Client -> menuIndex: 1
Ticket -> menuIndex: 3
Client -> menuIndex: 4
When you have no ROLE for "user" if you enter "Ticket" it jumps one number and highlights the following item.
Symfony 4.2.4, seems like roles for entities work but it doesn't for properties.
E.g. this works
Cat:
class: App\Entity\Cat
role: ROLE_ADMIN
but following does not apply
Post:
class: App\Entity\Post
controller: App\Controller\AdminController
list:
fields:
- { property: 'visible', role: ROLE_ADMIN }
(checked in debugger, roles for the current user are OK)
Add new entity in select, display modal.
Assigned to me
Great news ๐ โ https://github.com/EasyCorp/EasyAdminBundle/blob/master/UPGRADE-2.0.md
I would like to use EAB 2.0, but this package depends on it. And I love this package :)
Hi !
I used EasyAdminBundle (2.1) and I override the layout template thanks to my custom twig template inside template/bundles/EasyAdminBundle/default/layout.html.twig
But if I add EasyAdminExtensionBundle, the layout was not override anymore.
I try to define my custom template inside template/bundles/EasyAdminExtensionBundle/default/layout.html.twig, without any luck.
I allready look this issue : #25, but I think this was before the new EasyAdminBundle.
Thanks for your help !
Hello,
Thanks for the great bundle.
I was thinking about adding some cases to the list filterQueryBuilder or changing the generated dql string, for example if a custom event ( something like BEFORE_FILTER_FIELD
) is called with the filter field data before applying the dql part to the query builder so that I can format the value before applying it or call some sql functions in the dql string in my event listener.
Is that possible ?
At least, check if embedded list is displaid, and check list length according to fixtures
Hi,
I have a problem with one of my forms. In my form I have a field of type "easyadmin_autocomplete" as if below.
- property: 'questions' type: 'easyadmin_autocomplete' type_options: { attr: { create: true } }
The problem is that when no data is found I do not have the button to create.
Versions :
"alterphp/easyadmin-extension-bundle": "2.0.1"
"easycorp/easyadmin-bundle": "^2.0",
Having found no solution after watching the docs and forums, I post my problem here.
Hi there,
is there a way to show menu entries only if a user is not authenticated?
Using IS_AUTHENTICATED_ANONYMOUSLY is not possible, because that role every user has.
I want to show Register and Login only to not authenticated users.
Thanks!
Markus
There is no extension able to load the configuration for "easy_admin_bundle
!! " (in /NetBeansProjects/map2u_react/config/packages/easy_admin.yaml). Looke
!! d for namespace "easy_admin_bundle", found "framework", "doctrine_cache", "
!! doctrine", "doctrine_fixtures", "sensio_framework_extra", "monolog", "doctr
!! ine_migrations", "security", "swiftmailer", "twig", "white_october_pagerfan
!! ta", "debug", "web_profiler", "web_server", "easy_admin", "stof_doctrine_ex
!! tensions", "uerka_translation_form", "easy_deploy", "easy_admin_extension"
in the esay_admin.yaml file
easy_admin_bundle:
resource: '@EasyAdminExtensionBundle/Controller/AdminController.php'
prefix: /admin
type: annotation
Violation reported by SensioLabInsight. We call getId
method on unknwon object.
=> method may not exist.
Is it possible to get identifiers without parsing each of related object (from collection ?) ?
@rimi-itk any idea ?
in src/Helper/EmbeddedListHelper.php, line 134
The parameter
entity
, which is an object, should be typehinted.
// ManyToMany association
elseif (isset($assoc['joinTable'])) {
$relatedItems = PropertyAccess::createPropertyAccessor()->getValue(
$parentEntity, $parentEntityProperty
);
$itemIds = $relatedItems->map(function ($entity) {
return $entity->getId();
});
return ['entity.id' => $itemIds->toArray()];
}
Posted from SensioLabsInsight
I tried this in YAML config:
form_filters:
- property: relation
label: Relation
type: choice
type_options:
choices:
Baum: 1
Kuchen: 2
And got the error: The option "class" does not exist.
This occures because of \AlterPHP\EasyAdminExtensionBundle\Configuration\ListFormFiltersConfigPass::configureAssociationFilter
method, which always adds "class" and "multiple" options, regardless the current set type.
This condition fixed it for me:
if ($filterConfig['type'] !== ChoiceType::class) {
$defaultTypeOptions = [
'class' => $associationMapping['targetEntity'],
'multiple' => true,
];
} else {
$defaultTypeOptions = [
'multiple' => true,
];
}
$filterConfig['type_options'] = \array_merge(
$defaultTypeOptions,
$filterConfig['type_options'] ?? []
);
Please tell me, when I should provide a pull request.
Thanks!
Hi,
first thank for this very cool extension of EAB!
I'd like to use the embedded_list manually in a custom show view. What works for me is calling this in Twig template:
{{ easyadmin_render_field_for_show_view(_entity_config.name, entity, _entity_config.show.fields.myField) }}
But I have to configure the field in "show" section to get a resolved config array, which I pass with _entity_config.show.fields.myField
, which double output the embedded list, when I also want to output {{ block('show_fields') }}
of extending show template.
Is there a way to configure fields, which get merged with template stuff etc. but without using one of the actual base actions?
I hope you get my point and can help.
Thanks in advance!
Hi,
I'm using Symfony Flex with Symfony 4.1 in my project. Since I saw there's no recipe to install the bundle I tried to manually load it adding
AlterPHP\EasyAdminExtensionBundle\EasyAdminExtensionBundle::class => ['all' => true],
in bundles.php
, which gives me the next error:
(1/1) ClassNotFoundException
Attempted to load class "EasyAdminExtensionBundle" from namespace "AlterPHP\EasyAdminExtensionBundle".
Did you forget a "use" statement for another namespace?
Any hint about how to use it with Flex? Thanks.
A "sort" configuration option can be set to the "list" view of an entity to sort by one of its properties by default.
Allow a similar option for embedded lists to sort them without affecting default entities lists.
Version master:
Attempted to call an undefined method named "getType" of class "EasyCorp\Bundle\EasyAdminBundle\Form\Util\FormTypeHelper".
alterphp\easyadmin-extension-bundle\src\Configuration\ShortFormTypeConfigPass.php:89
We should not have to state the relation for an embedded list if it is the same defined in the ORM metadata. Try to explore ORM metadata to determine it.
Hello,
I try to install the Extension bundle with a fresh new project but Composer won't let me do that :
composer require alterphp/easyadmin-extension-bundle
Using version ^1.2 for alterphp/easyadmin-extension-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: don't install alterphp/easyadmin-extension-bundle v1.2.7
- Conclusion: don't install alterphp/easyadmin-extension-bundle v1.2.6
- Conclusion: don't install alterphp/easyadmin-extension-bundle v1.2.5
- Conclusion: don't install alterphp/easyadmin-extension-bundle v1.2.4
- Conclusion: don't install alterphp/easyadmin-extension-bundle v1.2.3
- Conclusion: don't install alterphp/easyadmin-extension-bundle v1.2.2
- Conclusion: don't install alterphp/easyadmin-extension-bundle v1.2.1
- Conclusion: remove pagerfanta/pagerfanta v2.0.1
- Installation request for alterphp/easyadmin-extension-bundle ^1.2 -> satisfiable by alterphp/easyadmin-extension-bundle[v1.2, v1.2.1, v1.2.2, v1.2.3, v1.2.4, v1.2.5, v1.2.6, v1.2.7].
- Conclusion: don't install pagerfanta/pagerfanta v2.0.1
- alterphp/easyadmin-extension-bundle v1.2 requires pagerfanta/pagerfanta ~1.0,>=1.0.1 -> satisfiable by pagerfanta/pagerfanta[v1.0.1, v1.0.2, v1.0.3, v1.0.4, v1.0.5, v1.1.0].
- Can only install one of: pagerfanta/pagerfanta[v1.0.1, v2.0.1].
- Can only install one of: pagerfanta/pagerfanta[v1.0.2, v2.0.1].
- Can only install one of: pagerfanta/pagerfanta[v1.0.3, v2.0.1].
- Can only install one of: pagerfanta/pagerfanta[v1.0.4, v2.0.1].
- Can only install one of: pagerfanta/pagerfanta[v1.0.5, v2.0.1].
- Can only install one of: pagerfanta/pagerfanta[v1.1.0, v2.0.1].
- Installation request for pagerfanta/pagerfanta (locked at v2.0.1) -> satisfiable by pagerfanta/pagerfanta[v2.0.1].
Installation failed, reverting ./composer.json to its original content.
This is because EasyAdminBundle use pagerfanta ~2.0 but not ExtensionBundle. I suggest to use 2.0 version. Is this doable? Should I/We use a different approach?
I'm here to help if needed.
Hi,
Is it possible to have a form filter on a datetime field ?
Thanks,
Julien
There is a conflict with pagerfanta/pagerfanta v2.0.1
Hi!
There is really no way to used it in PHP 5.6 and on Symfony 2.8? I have worked with those versions and it is not possible to update them.
Hi there, I'm facing an issue, that the create option for the autocomplete field is not shown.
Saw the issue #91 but unfortunately I'm not dealing with self written templates. I'm using the default ones. Have no idea how I get that working.
"alterphp/easyadmin-extension-bundle": "^2.1",
"easycorp/easyadmin-bundle": "^2.0",
Any help is appreciated.
Regards
Markus
When I am trying to set up a form filter like follow:
- { property: status, type_options: { choices: { New: 0, Read: 1, Archived: 2 } } }
- { name: statusType, property: status, type_options: { choices_static_callback: [getValuesList, [status, true]] } }
Error thrown:
The option "choices" does not exist.
OR
The option "choices_static_callback" does not exist. Defined options are: "action", "allow_extra_fields", "allow_file_upload", "attr", "auto_initialize", "block_name", "by_reference", "compound", "constraints", "csrf_field_name", "csrf_message", "csrf_protection", "csrf_token_id", "csrf_token_manager", "data", "data_class", "disabled", "documentation", "empty_data", "error_bubbling", "error_mapping", "extra_fields_message", "grouping", "help", "inherit_data", "invalid_message", "invalid_message_parameters", "label", "label_attr", "label_format", "mapped", "method", "post_max_size_message", "property_path", "required", "rounding_mode", "scale", "translation_domain", "trim", "upload_max_size_message", "validation_groups".
Version installed
alterphp/easyadmin-extension-bundle v2.1.0
easycorp/easyadmin-bundle v2.0.4
What am I missing here?
How can I add a dropdown beside of the search field and redirect users to this filterlink.
Is there a tutorial?
Thank for your support.
It's a custom action to a route like do to hide in the menu by role:
easy_admin:
menu:
- { label: 'App action', route: 'app_action', role: ROLE_SUPER_ADMIN }
It does not work
Defined filter type
requires FQCN at the moment => make form aliases available
Hello,
I've add 2 form_filter
but only 1 appear
the first is a select for a status field, OK (only is not a toggle but a select list)
the second is a manyToMany I've trying 3 methods
form_filters:
- status
- { property: categories, type_options: { choices: { Categorie: categorie } } }
- { property: categories, type_options: { choices: { Categorie: name} } }
- categories
I add trait (ValueListTrait) in my Entity (parent entity), but nothing work.
I use 2.0.3 /symfony 4.2.2
Thank You!
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.