fnproject / ui

User interface for fn project.
Apache License 2.0
89 stars 21 forks source link

Fix bug when editing config keys (#66) #67

Closed vzDevelopment closed 5 years ago

vzDevelopment commented 5 years ago

There is a bug which means that when a config key is edited a new config is added but the old config isn't deleted (see #66).

I have implement the first (and easiest) option from https://github.com/fnproject/ui/issues/66#issuecomment-487006837 which makes the config keys readonly so that it forces the user to delete the old config line and add a new one rather than editing an existing config line which will cause issues.

To Test

Repeat the process described in the issue:

Create an app using the UI e.g.:

vzarola-Mac:testing vzarola$ fn inspect app ui-app
{
    "config": {
        "config_key_1": "value"
    },
    "created_at": "2019-04-26T12:06:29.825Z",
    "id": "01D9CRMC61NG8G00GZJ000000Z",
    "name": "ui-app",
    "updated_at": "2019-04-26T12:06:44.430Z"
}

Then click the edit app button and try to edit the config's key. The interface won't let you:

Screen Shot 2019-04-26 at 13 08 02

However, you can still delete that config and add a new config.

I've also tested:

Repeat the above this for function configs.

carimura commented 5 years ago

works as intended. awesome!

carimura commented 5 years ago

i'll leave it up to you to merge since you had an open note there.

vzDevelopment commented 5 years ago

Unfortunately I'm finding it hard to find time for the fnproject at the moment so haven't been able to get back to doing the refactoring I wanted. I think we should go ahead and merge - the code is following the current status quo and fixes a bug so think it's fine to do.