fix(toolbox): fix the bug of overriding title when click the stack button #13372
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.
Brief Information
This pull request is in the type of:
What does this PR do?
fix bug of overriding the button title of the tool box
currently, if we change the title of the magic-type button in the toolbox, it works as expected
however, if we click the button for stack view, all magic type buttons' titles revert to the default
Fixed issues
Details
Before: What was the problem?
to check this one, we need to do sth like this
as stack and tiled are sth like a pair, we need to set the title for the tiled
but it only works if we never click the stack button,
once we click the button for stack, all titles revert to the the default chinese ones
After: How is it fixed in this PR?
the old code use title from ecModel as the base to override the new title
however, this disable the ability to override the title by users
In this PR, I change the logic to flip the title of stack and tiled when we click, and use model.option to get the title dynamically
and now it works as expected(tested on my local machine)
Usage
Are there any API changes?
Related test cases or examples to use the new APIs
NA.
Others
Merging options
Other information
as I didn't find an existing test file for this, and I'm not familiar with the test structure of new echarts,I didn't submit a independent test file for this,but I do think the changes in this PR won't bother the main logic and will not decrease code coverage.thx to @pissang & @Ovilia
just pushed the visual test action file in the latest commit