Skip to content
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

Remove property from existing entry in collection #377

Closed
pocmo opened this issue Jan 31, 2017 · 3 comments
Closed

Remove property from existing entry in collection #377

pocmo opened this issue Jan 31, 2017 · 3 comments
Labels

Comments

@pocmo
Copy link

pocmo commented Jan 31, 2017

For our A/B experiments we have a collection of entries that look like this (simplified):

{
    "name":"offline-cache",
    "last_modified":1482264657139,
    "id":"5e4277e0-1029-ea14-1b74-5d25d301c5dc",
    "match": {
        "appId":"^org.mozilla.fennec.*$"
    }
}

Some experiments we limit to specific app versions using for example the "appId" property in the example above. If we decide to later remove this restriction then we can't do this with the web admin. We could clear it but then we still have this empty property in the JSON and we need to special case this situation in our app. Instead it would be super helpful to be able to remove a property (instead of just clearing it).

Workaround in Fennec:
https://bugzilla.mozilla.org/show_bug.cgi?id=1335355

@n1k0
Copy link
Contributor

n1k0 commented Jan 31, 2017

This would be nicely solved by upgrading react-jsonschema-form to v0.42.0, which now clears a text field when the input is updated to just contain a blank string, removing the parent property entirely.

Meanwhile, you can also edit the raw JSON contents for a record, where you can manually drop the property value.

@n1k0
Copy link
Contributor

n1k0 commented Jan 31, 2017

I've just tested upgrading rjsf to v0.42, there's still an issue with us PATCHing records instead of PUTting them, so there's no way to actually drop a property. This is a bug, I've filed #378 about it.

@pocmo
Copy link
Author

pocmo commented Jan 31, 2017

Thanks for mentioning that I can edit the raw JSON. I totally missed that and it's super helpful now. :)

@n1k0 n1k0 closed this as completed in 1e18b07 Feb 2, 2017
n1k0 added a commit that referenced this issue Feb 16, 2017
New features

* Fix #377, #378: Allow dropping edited resource properties. (#379)
* Fix #365: Render a JSON diff for history entries. (#380)
* Fix #376: Denote readonly buckets & collections in the sidebar. (#382)
* Fix #384: Live-searchable/filterable sidebar entries. (#385)
* Hide auth method selector when a single one is configured.

Bugfixes

* Do not store passwords. Fixes #364 (#386)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants