-
Notifications
You must be signed in to change notification settings - Fork 4
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
Flexlayout fixes and new features #511
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. I really like the improvements in the layout manager example. Thanks 👍
@@ -13,6 +13,7 @@ | |||
"@fortawesome/fontawesome-svg-core": "^1.2.35", | |||
"@fortawesome/free-solid-svg-icons": "^5.13.0", | |||
"@fortawesome/react-fontawesome": "^0.1.9", | |||
"@fortawesome/fontawesome-free": "^6.4.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
} | ||
widgetConfiguration.pos = widgetConfiguration.pos ?? tabset.getChildren().length |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
} | ||
|
||
// This is a hack to unlock transitory state in the model before any other action is dispatched. See https://metacell.atlassian.net/browse/GEP-126 | ||
this.model.doAction(Actions.UPDATE_MODEL_ATTRIBUTES, {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙈
} | ||
|
||
}; | ||
|
||
restoreWeight(node: FlexLayout.Node) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -105,6 +109,39 @@ export const widgets = (state: WidgetMap = {}, action) => { | |||
delete newWidgets[action.data.id]; | |||
return newWidgets; | |||
} | |||
case layoutActions.UPDATE_LAYOUT: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Actions fixes
Closes #111 https://metacell.atlassian.net/browse/GEP-23 Repetition of same action sequence changes tab position in layout
Closes #109 https://metacell.atlassian.net/browse/GEP-21 Maximize redux action doesn't maximize widget in layout
The above fixes are related to the way that redux actions are detected in the layout middleware and dispatched to the flexlayout
previously: minimize and maximize were not catched
now: minimize and maximize are catched and handled
How to test: run the react-sample-up and play with minimize, maximize, etc
Layout icons
Closes #114 https://metacell.atlassian.net/browse/GEP-25 FlexLayout icons are not displayed in example app
This fix adds and imports the fontawesome icons in the redux-react-app
How to test: the minimize icon is now visible
Layout initialization intermediate state
https://metacell.atlassian.net/browse/GEP-126 Layout: First widget added with addWidget is not added
When
enableDeleteWhenEmpty=true
the first widget wasn't added because the layout was in a "dirty" state and thewidget was added to a tabset destinated to deletion.
Fixed with a dirty workaround by ensuring that addWidget wasn't the first action.
Selected tab changing position
Closes https://metacell.atlassian.net/browse/GEP-112 Fix Tabs changing position at Flexlayout Tabset on selection for Redux state apps
This was caused by the position of widgets being set to -1 when no explicit position was set.
Now the position is set to the length of the current tabset, so we ensure it goes last
How to test: can play with the tabs in the layout-manager-playground or redux-react-app
Restore layout feature
Closes https://metacell.atlassian.net/browse/GEP-125
The implemented solution is to set the weight to 0 for tabs that are empty, even with
enableDeleteWhenEmpty=false
.With this, the tabsets "disappear" because they have weight 0 until a widget is added.
The moment that the widget is added, its wait is restored from the default layout.
How to test: can play with it in the layout-manager-playground
Issues when dragging tab related to inconsistent state
Closes https://metacell.atlassian.net/browse/GEP-127
Closes #108 https://metacell.atlassian.net/browse/GEP-20
Widgets were not being updated upon actions in the layout, so updates on the widgets were restoring a wrong state so reverting some user actions
How to test: play with the layout-manager-playground and drag tabs around