-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Set up dashboard version history api #4372
Conversation
I am still new to Python and Django, so please feel free to critique away! It will help me learn faster 😀 |
Wouldn't it be a lot simpler to add a 'parent' primary key to DashboardItems, so we can create a chain of version history you can go backwards/forwards in? |
That does sound simpler, but just some clarifying questions then: When we update a dashboard item, are you saying that we should create two dashboard items out of it and set the original as the parent of the updated? And then if we're looking up the entire history of a dashboard item, wouldn't we be continuously looking up the parent of each dashboard item? (this one I'm a little confused about) Also, the version history mocks include commenting, I don't know if we'd want to tack that onto dashboard item too? However, I understand that storing a whole state in a key is not ideal, perhaps that Let me know if I'm understanding things correctly or not 🙂 |
I'm not wedded to my approach but it seems easier than copying the state in another object, and we're already creating new DashboardItems any time a user changes something (minus the parent part)
Something like this
You'd be able to get the entire history by looking up all DashboardItems that have parent=1
I think this could be a InsightComment model that links to the parent dashboarditem. |
This makes sense! Thanks |
Closing to implement changes on #4395 instead |
Changes
Set up versions API for #3551
The dashboard insight page is dependent on some of the filter work going on right now, so I'm skipping to the version history in the meanwhile. This is just a basic setup so that I can also start putting it together on the frontend
A version is created whenever:
Previous state is set so the user can "roll back" to a previous version of the updated dashboard item. Otherwise it's empty (there's no previous state to a newly created object)
Checklist