Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete add new option 'create' -> does not work for me #98

Closed
markus-fischbacher opened this issue Feb 6, 2019 · 16 comments
Closed

Comments

@markus-fischbacher
Copy link

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.

image

image

"alterphp/easyadmin-extension-bundle": "^2.1",
"easycorp/easyadmin-bundle": "^2.0",

Any help is appreciated.

Regards
Markus

@alterphp
Copy link
Owner

alterphp commented Feb 7, 2019

Hi @markus-fischbacher !

Can you post your full easy_admin config ?

@markus-fischbacher
Copy link
Author

Hi @alterphp !

Sure! Please find the info below.

routes\easy_admin.yaml

easy_admin_bundle:
    resource: '@EasyAdminExtensionBundle/Controller/EasyAdminController.php'
    prefix: /
    type: annotation

packages\easy_admin.yaml

imports:
  - { resource: easy_admin/ }
  - { resource: easy_admin/entities/ }
packages\easy_admin\basic.yaml

easy_admin:
  site_name: 'Portal'
packages\easy_admin\design.yaml

easy_admin:
  design:
    menu:
      - { label: 'Dashboard', icon: 'tachometer', route: 'dashboard', default: true }
      - label: 'User'
        icon: 'user-o'
        children:
          - { label: 'User', entity: 'User' }
          - { label: 'User Profile', entity: 'UserProfile' }
      - label: 'Address'
        icon: 'address-card-o'
        children:
          - { label: 'City', entity: 'City' }
          - { label: 'Country', entity: 'Country' }
      - label: 'Medical'
        icon: 'user-md'
        children:
          - { label: 'Department', entity: 'Department' }
          - { label: 'Personal Position', entity: 'PersonalPosition' }
          - { label: 'Medical Degree', entity: 'MedicalDegree' }
          - { label: 'Medical Speciality', entity: 'MedicalSpeciality' }
          - { label: 'Medical Subspeciality', entity: 'MedicalSubspeciality' }
      - label: 'Application'
        icon: 'calendar-check-o'
        children:
          - { label: 'Application', entity: 'Application' }
          - { label: 'Application Status', entity: 'ApplicationStatus' }
      - label: 'Program'
        icon: 'wpforms'
        children:
          - { label: 'Program', entity: 'Program' }
          - { label: 'Seminar', entity: 'Seminar' }
          - { label: 'Observership', entity: 'Observership' }
      - label: 'Documents'
        icon: 'file-text-o'
        children:
          - { label: 'Document', entity: 'Document' }
packages\easy_admin\entities.yaml

easy_admin:
  entities:
    Application:
      class: App\Entity\Application
    ApplicationStatus:
      class: App\Entity\ApplicationStatus
    City:
      class: App\Entity\City
    Country:
      class: App\Entity\Country
    Department:
      class: App\Entity\Department
    Document:
      class: App\Entity\Document
    MedicalDegree:
      class: App\Entity\MedicalDegree
    MedicalSpeciality:
      class: App\Entity\MedicalSpeciality
    MedicalSubspeciality:
      class: App\Entity\MedicalSubspeciality
    Observership:
      class: App\Entity\Observership
    PersonalPosition:
      class: App\Entity\PersonalPosition
    Program:
      class: App\Entity\Program
    Seminar:
      class: App\Entity\Seminar

packages\easy_admin\formats.yaml

easy_admin:
  formats:
    date: 'd.m.Y'
    datetime: 'd.m.Y h:i'
packages\easy_admin\entities\user.yaml

easy_admin:
  entities:
    User:
      class: App\Entity\User
      form:
        fields:
          - email
          - { property: 'roles', type: 'App\Form\RoleType', type_options: { expanded: true, multiple: true } }
          - { property: 'userProfile', type: 'easyadmin_autocomplete', type_options: { attr: { create: true } } }

packages\easy_admin\entities\user_profile.yaml

easy_admin:
  entities:
    UserProfile:
      class: App\Entity\UserProfile
      form:
        fields:
          - user
          - firstName
          - lastName
          - { property: sex, type: 'App\Form\GenderType', type_options: { expanded: false, multiple: false } }
          - { property: birthDate, type: 'App\Form\BirthdayType' }
          - homePhone
          - homeStreet
          - homeZipCode
          - homeCity
          - homeCountry
          - passportNumber
          - personalPosition
          - academicPosition
          - medicalSpeciality
          - medicalSubspeciality
          - institution
          - department
          - otherSpeciality
          - otherSubspeciality
          - otherDepartment
          - workStreet
          - workZipCode
          - workCity
          - workCountry
          - profilePhoto
          - medicalLicenseNumber
          - medicalLicenseIssueDate
          - numberPublications
          - numberEnglishPublications
          - applications

@alterphp
Copy link
Owner

alterphp commented Feb 8, 2019

Nothing looking bad to me... Maybe @gonzakpo will be more helpful ?

@gonzaloalonsod
Copy link
Contributor

testing

@gonzaloalonsod
Copy link
Contributor

the method createAutoCompleteCreateFields() is not running correctly in public/js/autocomplete-create.js

@markus-fischbacher
Copy link
Author

Would be cool to get that fixed :)

@gonzaloalonsod
Copy link
Contributor

In Chrome it works sometimes.
In Firefox it works always.
Any ideas?

@markus-fischbacher
Copy link
Author

markus-fischbacher commented Feb 11, 2019

Chrome and Firefox are not working for me. Tried it with EDGE and Internet Explorer. There I'm facing JavaScript failures regarding missing jQuery and $

image

Maybe something Chrome/Firefox is handling a different way or not that strict.
Maybe fixing that will get it working for all browsers?

This was referenced Feb 12, 2019
@gonzaloalonsod
Copy link
Contributor

It works in chrome. Edge not

@gonzaloalonsod gonzaloalonsod mentioned this issue Feb 14, 2019
@gonzaloalonsod
Copy link
Contributor

Is it possible to accept the improvements?

@markus-fischbacher
Copy link
Author

Because of browser incompatibility, I changed to another approach.
But for Chrome and Firefox it is working as expected.

@gonzaloalonsod
Copy link
Contributor

gonzaloalonsod commented Mar 12, 2019

Because of browser incompatibility, I changed to another approach.
But for Chrome and Firefox it is working as expected.

What approach? Maybe it could help solve the problem.

@markus-fischbacher
Copy link
Author

I switched to a "manual" implementation of CRUD.
Not using a bundle like EasyAdmin nor SonataAdmin.
For my project it is very important to run on as much browsers as possible.
Unfortunately old Internet Explorer versions are necessary als well :(

@ceininger
Copy link

Hello @alterphp, do you know when a new release will be available with these fixes ? I'm facing the same issue.

@alterphp
Copy link
Owner

It's released ! https://github.com/alterphp/EasyAdminExtensionBundle/releases/tag/v2.1.2

@ceininger
Copy link

Thanks a lot :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants