Skip to content

Comments

Add flags to turn off some features#23

Open
languy wants to merge 2 commits intoputma-jun:masterfrom
languy:master
Open

Add flags to turn off some features#23
languy wants to merge 2 commits intoputma-jun:masterfrom
languy:master

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