Research how to enforce a specific views settings in grid #252
Labels
No labels
_CRITICAL_
API
app
backEnd
Blocked, waiting for further changes
bug
cleanup
close
design
duplicate
enhancement
feature request
frontEnd
help wanted
invalid
low priority
needs input
needs review
project documentation
question
research
reviewed
script
security
SQL
style
testing
topLevel
wontfix
No milestone
No project
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Andras/BoundlessFlowCampus2K#252
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Certain views will need to have min/max values for height and width. We need some sort of "config" file for each view that contain these values.
Related Issues: #215
Parent Issues: #190
We need to limit this also so that it is limited per device. A smaller device may have different limits than a larger device.
What about screen rotation are these settings distinct for vertical / horizontal?
To limit sizes depending on devices, one usually uses "lg,md,sm,xs,xxs". Here is a simple codesnippet that can help decide sizes. Width is a variable already initiated in the code. When rotating for example a phone, the width will become the height which can make it more difficult. To solve this, there exists a resize event that listens for rotations or other resizing.
Going from there, right now cards' positions are determined by the key. One solution could be to create a new dictionary
containing the different card names and their min/max and then combining them to the already set sizes of cards. This can be done by doing "...temperaturView[width]" in the layout field; i.e.: const layout=[{i: "2", x: 1, y: 2, w: 1, h: 2, ...temperaturView[width]}].
In short: one can set max/min height/width through the layout already, when adding a new card one can check its type and add corresponding value from a dictionary.
The idea makes sense and is aligned with how responsive grids are designed. With breakpoints such as lg/md/sm to decide the different min/max sizes per view is a solid approach also the dictionary-based configuration per view is also a good idea.
That being said I have some questions.
You say "one can set max/min height/width through the layout already, when adding a new card one can check its type and add corresponding value from a dictionary" does that mean that the developers are "responsible" for manually selecting the correct breakpoint rules and applying them every time a layout item is created? or will we have a "centralized" config that should handle this automatically.
Basically I am trying to understand how the responsibility lives here, because if done manually then that could lead to issues over time by missing or implementing inconsistently when creating new or modifying existing views. On the other hand having a centralized config to handle it would make the system more robust since rules would always be applied consistently with no regard with who created or updated a layout.
Otherwise this research is well done.
Since views can have different sizes, my suggestion is that we create a default config that will apply to all views, unless the developers set their own. If they set their own, it should follow a set of rules that make it reusable by other developers. This means that other developers can then deem if they want the default or follow another config. The rules should be able to help with consistency
Thanks for the clarification.
The approach seems reasonable and it should help avoid inconsistencies atleast when compared to a fully manual configuration.
It might be a good idea to include this in a wiki page to have an easy access to the defined rules and conventions, so all the developers have access to a single wiki page to refer to.
This could also be a good place to go a little more into detail about how the custom configs should be structured what is valid or invalid and how the constraints are expected to behave. With a clear wiki page to turn to it would also be easier to maintain the consistency over the system as it evolves.