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

Fix #563 - rewrote runAll() of FieldLogicDisplayManager class #564

Open
wants to merge 1 commit into
base: hotfix
Choose a base branch
from

Conversation

xkrdudrlf
Copy link

Description

This PR will close #563

  • use ['params']['targetDisplayType'] of display logic for setting targetDisplay
  • handle the case where there are multiple display logics in terms of deciding targetDisplay value for field.display eventually.

Motivation and Context

Currently, "field.display" value is always set to 'none' if any of display mode logic holds(or 'active') no matter what is set in 'targetDisplayType' for the display mode logic.
Also, it does not handle a scenario where there are multiple display mode logics for a field.

How To Test This

  1. Try setting multiple displayLogics for any field as follows:
$dictionary['Lead']['fields']['status']['displayLogic'] = [
    'readonly_when_converted' => [
        'key' => 'displayType',
        'modes' => ['edit'],
        'params' => [
            'fieldDependencies' => [
                'title'
            ],
            'targetDisplayType' => 'show',
            'activeOnFields' =>  [
                'title' => [ 'Converted' ]
            ]
        ]
    ],
    'readonly_when_dead' => [
        'key' => 'displayType',
        'modes' => ['edit'],
        'params' => [
            'fieldDependencies' => [
                'title'
            ],
            'targetDisplayType' => 'none',
            'activeOnFields' =>  [
                'title' => [ 'Dead' ]
            ]
        ] 
    ]
];
  1. Test whether a field is shown correctly in the page according to the display type set in displayLogics
    For example, in the above case, 'status' field should be shown when 'title' field value is 'Converted' and should be hidden when 'title' field value is 'Dead'

Types of changes

  • [ x ] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • [ x ] My code follows the code style of this project found here.
  • My change requires a change to the documentation.
  • [ x ] I have read the How to Contribute guidelines.

… class

 - use ['params']['targetDisplayType'] of display logic for setting targetDisplay
 - handle the case where there are multiple display logics in terms of deciding targetDisplay value for field.display eventually.
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

Successfully merging this pull request may close these issues.

Multiple display logics of a field not working
1 participant