Giter Site home page Giter Site logo

b2bcodext / cms-form-builder Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 4.0 320 KB

CMS Form Builder is a flexible OroCommerce extension that allows you to easily create forms via UI

License: Other

PHP 78.25% HTML 0.11% JavaScript 8.77% Twig 12.17% SCSS 0.71%

cms-form-builder's People

Contributors

alexandrzhulev avatar dnahrebecki avatar jankulma-turbine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cms-form-builder's Issues

Missing entities translations

When main application has CI with test for missing translations, main app build fails:

Found 11 missing translations:
b2bcode.cmsform.entity_grid_all_view_label [Entity: B2bCode\Bundle\CmsFormBundle\Entity\CmsForm]
b2bcode.cmsform.fields.label [Entity: B2bCode\Bundle\CmsFormBundle\Entity\CmsForm; Field: fields]
b2bcode.cmsform.cmsformfield.entity_grid_all_view_label [Entity: B2bCode\Bundle\CmsFormBundle\Entity\CmsFormField]
b2bcode.cmsform.cmsformfield.options.label [Entity: B2bCode\Bundle\CmsFormBundle\Entity\CmsFormField; Field: options]
b2bcode.cmsform.cmsfieldresponse.entity_grid_all_view_label [Entity: B2bCode\Bundle\CmsFormBundle\Entity\CmsFieldResponse]
b2bcode.cmsform.cmsformnotification.entity_grid_all_view_label [Entity: B2bCode\Bundle\CmsFormBundle\Entity\CmsFormNotification]
b2bcode.cmsform.cmsformnotification.id.label [Entity: B2bCode\Bundle\CmsFormBundle\Entity\CmsFormNotification; Field: id]
b2bcode.cmsform.cmsformnotification.email.label [Entity: B2bCode\Bundle\CmsFormBundle\Entity\CmsFormNotification; Field: email]
b2bcode.cmsform.cmsformnotification.form.label [Entity: B2bCode\Bundle\CmsFormBundle\Entity\CmsFormNotification; Field: form]
b2bcode.cmsform.cmsformnotification.template.label [Entity: B2bCode\Bundle\CmsFormBundle\Entity\CmsFormNotification; Field: template]
b2bcode.cmsform.cmsformresponse.entity_grid_all_view_label [Entity: B2bCode\Bundle\CmsFormBundle\Entity\CmsFormResponse]

Suggested translations:

b2bcode:
    cmsform:
        entity_grid_all_view_label: 'All forms'
        fields:
            label: 'Fields'
        cmsformfield:
            entity_grid_all_view_label: 'All fields'
            options:
                label: 'Options'
        cmsfieldresponse:
            entity_grid_all_view_label: 'All responses'
        cmsformnotification:
            entity_grid_all_view_label: 'All notifications'
            id:
                label: 'Id'
            email:
                label: 'Email'
            form:
                label: 'Form'
            template:
                label: 'Template'
        cmsformresponse:
            entity_grid_all_view_label: 'All responses'

[DEPRECATION NOTICE] Redirect to login page after submitting a form

I received many reports recently that after creating a new form and adding it to a landing page, when anonymous users try to submit the form - they are redirected to login page. This is because of the lack of the proper permissions for not logged in users. To fix it, go to Customer User Roles and update Anonymous User Role making sure that "Respond to CMS forms" is checked.

However, because of the confusion, I'll be removing this check in the main controller in the further releases: https://github.com/b2bcodext/cms-form-builder/blob/release/2.2/src/B2bCode/Bundle/CmsFormBundle/Controller/Frontend/AjaxFormController.php#L30

Field constrains are not applied when the field is made required

Hello,

We added new field type:

class CmsFormFileType extends AbstractType
{

    public function getParent()
    {
        return SymfonyFileType::class;
    }

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefault(self::ALLOWED_FILE_TYPES_OPTION, []);

        $resolver->setDefault(
            'constraints',
            function (Options $options) {
                $allowedFileTypes = $options[self::ALLOWED_FILE_TYPES_OPTION];
                if (empty($allowedFileTypes)) {
                    return null; // allow all files
                }
                return $this->convertAllowedFileTypesToConstraint($allowedFileTypes);
            }
        );
    }
    
    ...
}

And the constraints do work, but when the field is made required too, they are no longer applied.

I was debugging a lot, could not find where is the problem, but from what I've seen, when the field is required, NotBlank constraint is added to the field, overriding other constrains (not exactly overriding, but when the field is made required, only NotBlank constraint was on the form field, and when the field is not required, other constrains are on the form field - like they should be).

I "fixed" it using another way to add constrains (https://github.com/b2bcodext/cms-form-builder/blob/release/2.0/src/B2bCode/Bundle/CmsFormBundle/Resources/doc/dev_doc.md#event) and this way everything works.

JK

Validation failed message not displayed when the form field name has uppercase letters

Hi,

When you set a form field to have a name with uppercase letters, eg. "filePDF", the data-name attribute of the input field is generated like so: data-name="field__file-p-d-f".

When the form is invalid, and an error is returned, its returned using form field name ("filePDF") as index (https://github.com/b2bcodext/cms-form-builder/blob/release/2.0/src/B2bCode/Bundle/CmsFormBundle/Controller/Frontend/AjaxFormController.php#L75), but in https://github.com/b2bcodext/cms-form-builder/blob/release/2.0/src/B2bCode/Bundle/CmsFormBundle/Resources/public/js/app/components/form-component.js#L83 we are looking for the element by data-name (which is "file-p-d-f"), not name, and we end up not finding the element, therefore not showing the error message.

JK

Will fieldsets / legend be supported?

Hi,

Do you have any plans adding support for form fieldsets? The idea is to be able to organize form for better UX. If not - would you have some suggestions on how to implement it?

Thanks,
JK

Orocommerce 5, serialized_data cannot be cast automatically to type jsonb

Hello,

There is an error when trying to add this package to ORO 5 this is the error message when running platform update

ERROR: An exception occurred while executing 'ALTER TABLE b2b_code_cms_form_response ALTER serialized_data TYPE JSONB': SQLSTATE[42804]: Datatype mismatch: 7 ERROR: column "serialized_data" cannot be cast automatically to type jsonb HINT: You might need to specify "USING serialized_data::jsonb".

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.