parse-community / parse-dashboard

A dashboard for managing Parse Server
https://parseplatform.org
Other
3.74k stars 1.39k forks source link

feat: Add Cloud Config change history to roll back to previous values #2554

Closed iMac7 closed 4 months ago

iMac7 commented 4 months ago

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

iMac7 commented 4 months ago

Btw, does the history work with multiple apps? For example app A has Cloud Config param x, and app B has the same. These history for both apps must be managed separately and not influence each other.

I hadn't thought of that, probably not. Let me check. How do I make another parse app locally? Between appid and server url, which is unique?

iMac7 commented 4 months ago
{
  "apps": [
    {
      "serverURL": "http://localhost:1337/parse",
      "appId": "APPLICATION_ID",
      "masterKey": "MASTER_KEY",
      "appName": "",
      "iconName": "",
      "primaryBackgroundColor": "",
      "secondaryBackgroundColor": "",
      "cloudConfigHistoryLimit": 100
    }
  ],
  "iconsFolder": "icons"
}

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 :)

mtrezza commented 4 months ago

Yep that sounds perfect, great job, let's merge!

mtrezza commented 4 months ago

Added README docs for new config option apps.cloudConfigHistoryLimit.

parseplatformorg commented 4 months ago

🎉 This change has been released in version 6.0.0-alpha.7