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: helpers for full axis, locked dimension, dimension can be added to axis #253

Merged
merged 7 commits into from
Jan 24, 2020

Conversation

edoardo
Copy link
Member

@edoardo edoardo commented Jan 22, 2020

These are used when a dimension is added/moved/dragged in the layout.
It respects the layout rules by checking the current state of the destination axis (is full, the dimension already present is locked...) to avoid incorrectly adding a dimension.

Copy link
Contributor

@martinkrulltott martinkrulltott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I'm not sure if I agree with adding these three new methods to rulesHelper.
Internally they are sound, but should they really live here? isDimensionLocked is only an extension of isDimensionLocked, isAxisFull extends getAxisMaxNumberOfDimsByVisType and canDimensionBeAddedToAxis extends the other two. Even though these methods highly depend on the rules, what they're doing for rulesHelper though is just adding layout logic to the rules engine. Is this our preferred pattern? 🤔 @janhenrikoverland

src/modules/layoutUiRules/rulesHelper.js Outdated Show resolved Hide resolved
src/modules/layoutUiRules/rulesHelper.js Outdated Show resolved Hide resolved
src/modules/layoutUiRules/rulesHelper.js Outdated Show resolved Hide resolved
Plus one which returns if a dimension can be added to a specific axis
based on the layout rules and the current content of the axis.
Added a new one which returns a transferable dimension from a specific
axis.
@edoardo edoardo force-pushed the fix/add-dimension-helpers branch from 06efc61 to cfeecbe Compare January 23, 2020 13:09
src/modules/layoutUiRules/index.js Outdated Show resolved Hide resolved
@edoardo edoardo merged commit 2d6b68f into master Jan 24, 2020
@edoardo edoardo deleted the fix/add-dimension-helpers branch January 24, 2020 14:57
dhis2-bot added a commit that referenced this pull request Jan 24, 2020
## [2.8.5](v2.8.4...v2.8.5) (2020-01-24)

### Bug Fixes

* helpers for full axis, locked dimension, dimension can be added to axis ([#253](#253)) ([2d6b68f](2d6b68f))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 2.8.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

4 participants