-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat: LEAP-1454: Custom action buttons in LSF #6411
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Simple declarative store to describe custom buttons. Plus universal handler to handle any button depending on its type.
Main stores are covered with some popular props and methods: AppStore, AnnotationStore, Annotation
They will fully substitute all other buttons for now. Later we'll add some other buttons specified in custom buttons config.
✅ Deploy Preview for heartex-docs canceled.
|
✅ Deploy Preview for label-studio-docs-new-theme canceled.
|
This allows to mix custom buttons with internal ones.
- look for Submit is primary as a fallback value, because it has no secondary - Button now have a `mod` property from Block, should be infered, but that's for later - Dropdown pointing to a correct component with additional property - the rest are just added types or direct type casts
hlomzik
changed the title
feat: LEAP-1454: Flexible reject buttons
feat: LEAP-1454: Custom action buttons in LSF
Sep 20, 2024
hlomzik
commented
Sep 20, 2024
Gondragos
reviewed
Sep 20, 2024
Gondragos
reviewed
Sep 20, 2024
`buttons.tsx` to store most of the buttons, so logic will be more readable in `Controls.tsx`. Buttons which can require a comment use handler wrapper. `disabled` is added to custom buttons as well to block them during action handling as all other buttons.
Gondragos
approved these changes
Sep 24, 2024
/git merge
|
bmartel
approved these changes
Sep 24, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introducing custom action buttons for LSF to allow additional actions, controlled from outside of editor. Provided buttons will completely replace the internal ones, but there is a way to reuse buttons you need, just add the button with internal name and no extra params.
TODO: Add example
Custom buttons need to behave similarly to internal ones, so we are using flags and additional checks. They will call the same event
handleCustomButton(button_name)
so external app will handlecustomButton
event withstore, button_name, options
params.Also new types for global MST stores are introduced in a draft state with intention to expand them with more props and methods so they can be used in other TypeScript code, which currently uses
any
for any MST stuff.PR fulfills these requirements
Change has impacts in these area(s)
Describe the reason for change
We need to introduce new buttons in LSE and instead of creating another "hidden" buttons in LSF we create a way to use any button you need.
What alternative approaches were there?
Hardcode new buttons in LSF and display them by one more interface.
What feature flags were used to cover this change?
None. That's addition and will be used only if specific props are passed in.
Does this PR introduce a breaking change?
What level of testing was included in the change?