Card layout config #217

Closed
opened 2026-04-10 07:24:57 +00:00 by a24vinla · 5 comments
Collaborator

To facilitate each user haveing their own unique and saveable layout/grid/window we need to be able to save the current layout and which cards contain which views. Some views (like the text/note card) will have additional data that needs to be saved. This config should then be saveable in a DB, but that is another issue.

To clarify, we need a JSON file that contain all cards, positions, card and grid settings.

Please refer to these issues when solving this: #173 #200
Related Issues: #218

To facilitate each user haveing their own unique and saveable layout/grid/window we need to be able to save the current layout and which cards contain which views. Some views (like the text/note card) will have additional data that needs to be saved. This config should then be saveable in a DB, but that is another issue. To clarify, we need a JSON file that contain all cards, positions, card and grid settings. Please refer to these issues when solving this: #173 #200 Related Issues: #218
Collaborator

I split up this issue into two parts:

  1. Saving grid system to local storage so that when one reloads the page the data gets saved.
  2. "Saving to a json": created a function that creates a json file with the data, but it is tough to test through browser. Browsers are not allowed to write files immediately into filesystem, and would therefore need to be downloaded. That could be a work around to test it, problem is that it would be kind of difficult to test if the config works since they are not allowed to read either. It would have to be uploaded at the same time as the whole project instead. From research, to test through browser, it would be better to go through api and then immediately to DB and skip the json file.

Edit to 2: one can still download and input files, but extra user actions will be needed.

I split up this issue into two parts: 1. Saving grid system to local storage so that when one reloads the page the data gets saved. 2. "Saving to a json": created a function that creates a json file with the data, but it is tough to test through browser. Browsers are not allowed to write files immediately into filesystem, and would therefore need to be downloaded. That could be a work around to test it, problem is that it would be kind of difficult to test if the config works since they are not allowed to read either. It would have to be uploaded at the same time as the whole project instead. From research, to test through browser, it would be better to go through api and then immediately to DB and skip the json file. Edit to 2: one can still download and input files, but extra user actions will be needed.
Author
Collaborator

Very valid to split the issue.

Saving on refresh is necessary and would be very nice to implement early.

Clarification regarding second issue: since we currently don't have a DB to save the layout to, a separate file would be enough. We need to design and build the DB partly based on the structure of the data of the layout. Using JSON is not necessary, but the data will have to be somewhat parsed/grouped between the DB and react-grid-layout. You have full freedom in deciding the best way to do this.

Very valid to split the issue. Saving on refresh is necessary and would be very nice to implement early. Clarification regarding second issue: since we currently don't have a DB to save the layout to, a separate file would be enough. We need to design and build the DB partly based on the structure of the data of the layout. Using JSON is not necessary, but the data will have to be somewhat parsed/grouped between the DB and react-grid-layout. You have full freedom in deciding the best way to do this.
Author
Collaborator

Skipping the "JSON-step" could definitely be a solution once the database is in place.

Let me know if anything is unclear still.

Skipping the "JSON-step" could definitely be a solution once the database is in place. Let me know if anything is unclear still.
Collaborator

The important part seems to be to create a format on how the data will look and create a way to easily work with it rather than exporting it. I have made two functions, one that stores and one that retrieves data in json format.

The important part seems to be to create a format on how the data will look and create a way to easily work with it rather than exporting it. I have made two functions, one that stores and one that retrieves data in json format.
Collaborator

This issue is merged. I close this issue.

This issue is merged. I close this issue.
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#218 Load grid layout through config
Andras/BoundlessFlowCampus2K
Reference
Andras/BoundlessFlowCampus2K#217
No description provided.