-
-
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
feat: Add Cloud Config change history to roll back to previous values #2554
Conversation
Thanks for opening this pull request!
|
I will reformat the title to use the proper commit message syntax. |
Uffizzi Ephemeral Environment
|
My latest PR fixes the various UI/logic issues that you outlined, so I feel we don't need timestamps to prevent the dialog from breaking. I can still add if deemed necessary after a re-review
Not sure so I used an opinionated value of 10 history entries per parameter to be very light on the user's storage. I don't think we need that much data considering this feature is mostly about tracking the most recent changes 🤔 |
Uffizzi Ephemeral Environment
|
A scrollable list of buttons is an unconventional UI choice. Drop-down lists are traditionally used for this. We have the timestamp information, which is generally the primary information in a "rollback" feature, so we should display it. In a complex environment, param changes influence metrics over time, so time correlation between events is key. I understand that showing previous values in button labels can make it easier to quickly choose a value to roll back to, but that works only for short values (limited button label text length), and it is a duplicate functionality, because the full value is displayed before saving anyway. I would still suggest to change this to a drop-down list with timestamps. In future improvements we can think about convenience features such as quick value preview, version comparison (diff highlighting, etc) and how an intuitive UI should look like. Just an idea off the top of my head: if you would like to implement a quick value preview with this PR, why not add an "i" (info) icon on the side of the timestamp and show the value in a tool-tip when hovering with the mouse over it. This allows to display more of the previous value than the limited button label text length, so it would provide an even better value preview functionality than the list of buttons. Another option could be a button to fold-open the value beneath the timestamp, but that sounds more complicated to implement, maybe better to avoid for now.
I'm not sure whether Parse Server enforces any specific limit. All config params are stored in a single document. The max document size is 16MB. 16MB x 10 = 160MB max storage needs. Not sure what limits there are on the browser side. We can leave it as for now it and react to any feedback later on. |
Probably some style adjustments |
The icons are in a collective SVG I believe. Just look at any existing dialog that has an icon, it should point you to where that comes from. Could you please:
|
Uffizzi Ephemeral Environment
|
Uffizzi Ephemeral Environment
|
I tried implementing this, but this feature which connects a tooltip to its parent is only available in chrome 125 which itself seems to be in beta, even the anchor examples in that page don't run XD . Any sort of tooltip seems to be problematic to implement in one way or the other so I have removed the preview. |
Why removed, do we need one? |
I set it here, eventually I removed it because you suggested along the thread that parse-server has no limit |
These are 2 different questions:
Unless we look at storage size, it will be difficult to manage, because for a small config, many value versions will require little storage, while for a large config few versions require large storage. But looking at storage gives an arbitrary number of versions, which is difficult to manage for the user. Maybe the best is to implement a default of 100 versions, but make it configurable, so developers can adapt it to their use case. If you don't want to implement the configurable option now (it's quite easy), let's just leave it at 100. If we don't implement any limits, then we may create a problem for users, because if the storage size becomes too large, the user would have to clear the browser cache for the website, loosing all other cached options as well. |
The only limit is the one I had set before, no other. I had just limited it to 10 items earlier, 100 looks better. 10 was strictly an opinionated value from me because I thought some sort of limit is needed.
where in the dashboard should it be configured from? |
You could just add an option Btw, does the history work with multiple apps? For example app A has Cloud Config param |
I hadn't thought of that, probably not. Let me check. |
That is an example of how the history limit is configured in dashboard config currently, lmk if that's right. I have implemented unique history for every app by adding the application Id to the localstorage key of the app, if IDs are unique then the fix should hold. One last review, hopefully :) |
Yep that sounds perfect, great job, let's merge! |
Added README docs for new config option |
# [6.0.0-alpha.7](6.0.0-alpha.6...6.0.0-alpha.7) (2024-05-19) ### Features * Add Cloud Config change history to roll back to previous values ([#2554](#2554)) ([a784129](a784129))
🎉 This change has been released in version 6.0.0-alpha.7 |
# [6.0.0-beta.2](6.0.0-beta.1...6.0.0-beta.2) (2024-10-07) ### Bug Fixes * Crash after setting filter using context menu and opening filters panel ([#2579](#2579)) ([5a690eb](5a690eb)) * Dashboard not building for Docker platform arm64/v8 ([#2534](#2534)) ([8c4a862](8c4a862)) * Descriptive statistics for number cells in data browser not showing ([#2581](#2581)) ([e146b6f](e146b6f)) * Filter string is erased when changing filter condition ([#2586](#2586)) ([6fa2c8c](6fa2c8c)) * Internal classes `_User`, `_Role`, `_Installation` referenced with pointer don't appear in data browser filter dialog ([#2599](#2599)) ([8239cc8](8239cc8)) ### Features * Add Cloud Config change history to roll back to previous values ([#2554](#2554)) ([a784129](a784129)) * Add data panel to display object related data fetched via Cloud Function ([#2584](#2584)) ([914cc71](914cc71)) * Add optional restriction of script execution to certain object fields and values ([#2488](#2488)) ([8feac9b](8feac9b)) * Add relational filter conditions in data browser ([#2576](#2576)) ([aa5c68d](aa5c68d)) * Add support for Node 22 ([#2603](#2603)) ([3689106](3689106))
🎉 This change has been released in version 6.0.0-beta.2 |
# [6.0.0](5.4.0...6.0.0) (2024-10-07) ### Bug Fixes * App metrics for user and installation counts show dash ([#2528](#2528)) ([850d7b3](850d7b3)) * Class Level Permissions dialog throws error `TypeError: ce.current is null` for newly created class ([#2549](#2549)) ([27ed692](27ed692)) * Config page fails to load ([#2531](#2531)) ([d721b7c](d721b7c)) * Crash after setting filter using context menu and opening filters panel ([#2579](#2579)) ([5a690eb](5a690eb)) * Dashboard crashes if Parse Server Cloud Function script returns object ([#2516](#2516)) ([5de08f8](5de08f8)) * Dashboard not building for Docker platform arm64/v8 ([#2534](#2534)) ([8c4a862](8c4a862)) * Dashboard scrolls when selecting row in data browser ([#2559](#2559)) ([2aa54a5](2aa54a5)) * Data browser redirects to wrong class when changing app ([#2526](#2526)) ([7713f54](7713f54)) * Deleting all code in the JS Console editor fills in the default code ([#2558](#2558)) ([4b830ba](4b830ba)) * Descriptive statistics for number cells in data browser not showing ([#2581](#2581)) ([e146b6f](e146b6f)) * Filter string is erased when changing filter condition ([#2586](#2586)) ([6fa2c8c](6fa2c8c)) * Internal classes `_User`, `_Role`, `_Installation` referenced with pointer don't appear in data browser filter dialog ([#2599](#2599)) ([8239cc8](8239cc8)) * Open pointer in new tab in data browser not working when mount path is not root ([#2527](#2527)) ([2f4081f](2f4081f)) ### Features * Add Cloud Config change history to roll back to previous values ([#2554](#2554)) ([a784129](a784129)) * Add data panel to display object related data fetched via Cloud Function ([#2584](#2584)) ([914cc71](914cc71)) * Add descriptive statistics for number cells in data browser ([#2529](#2529)) ([ead9ec4](ead9ec4)) * Add filter `starts with` in data browser for fields of type Pointer ([#2553](#2553)) ([0b94ab6](0b94ab6)) * Add Node 20 support; remove Node 14, 16 support ([#2532](#2532)) ([578a339](578a339)) * Add Node 20 support; remove Node 14, 16 support ([#2535](#2535)) ([5c90f2d](5c90f2d)) * Add optional restriction of script execution to certain object fields and values ([#2488](#2488)) ([8feac9b](8feac9b)) * Add relational filter conditions in data browser ([#2576](#2576)) ([aa5c68d](aa5c68d)) * Add support for Node 22 ([#2603](#2603)) ([3689106](3689106)) * Execute script for selected rows ([#2508](#2508)) ([5d9901e](5d9901e)) * Select rows in data browser by clicking and dragging mouse cursor over checkboxes ([#2548](#2548)) ([792ba9e](792ba9e)) ### BREAKING CHANGES * Removes support for Node 14 and 16 ([5c90f2d](5c90f2d))
🎉 This change has been released in version 6.0.0 |
# [6.0.0-beta.2](parse-community/parse-dashboard@6.0.0-beta.1...6.0.0-beta.2) (2024-10-07) ### Bug Fixes * Crash after setting filter using context menu and opening filters panel ([parse-community#2579](parse-community#2579)) ([5a690eb](parse-community@5a690eb)) * Dashboard not building for Docker platform arm64/v8 ([parse-community#2534](parse-community#2534)) ([8c4a862](parse-community@8c4a862)) * Descriptive statistics for number cells in data browser not showing ([parse-community#2581](parse-community#2581)) ([e146b6f](parse-community@e146b6f)) * Filter string is erased when changing filter condition ([parse-community#2586](parse-community#2586)) ([6fa2c8c](parse-community@6fa2c8c)) * Internal classes `_User`, `_Role`, `_Installation` referenced with pointer don't appear in data browser filter dialog ([parse-community#2599](parse-community#2599)) ([8239cc8](parse-community@8239cc8)) ### Features * Add Cloud Config change history to roll back to previous values ([parse-community#2554](parse-community#2554)) ([a784129](parse-community@a784129)) * Add data panel to display object related data fetched via Cloud Function ([parse-community#2584](parse-community#2584)) ([914cc71](parse-community@914cc71)) * Add optional restriction of script execution to certain object fields and values ([parse-community#2488](parse-community#2488)) ([8feac9b](parse-community@8feac9b)) * Add relational filter conditions in data browser ([parse-community#2576](parse-community#2576)) ([aa5c68d](parse-community@aa5c68d)) * Add support for Node 22 ([parse-community#2603](parse-community#2603)) ([3689106](parse-community@3689106))
New Pull Request Checklist
Issue Description
Adds recent config history using localstorage for better undo functionality
Closes: #2339
Approach
Every time the user updates a value in the config, it is saved to localstorage under the key
configHistory
.For each parameter in the config, an array of values is stored in descending order to show the latest value first.
TODOs before merging