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

Add flags to turn off some features #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

languy
Copy link

@languy languy commented Nov 11, 2022

We like this editor implementation and look and feel, but in order to integrate into our apps, we need to adjust some of its functionality.
This PR adds the following props to the Editor component:

  • hideInsertObjectButton: if true, hides the top clickable banner that adds a new object.
  • isReadOnly: if true, hides the buttons that appear on mouse over to add/edit/delete a field, disable onclick and leaves cursor as default.
  • expandToGeneration: if specified, only expand the objects and its nested fields to the specified "generation" (by "expand" we mean "show the children nodes"). For example, 0 shows the objects fields, but not their fields content (if they are arrays or objects). 1 would show the objects fields content. 2 would show the objects fields content fields content, and so on and so forth.

If these flags are not specified, the current behavior of this component remains unchanged so that we don't affect current users of the component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant