Add tooltip and disabled to panel item#9696
Add tooltip and disabled to panel item#9696Hailong-am merged 13 commits intoopensearch-project:mainfrom
Conversation
Signed-off-by: yyfamazon <yyf@amazon.com>
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
|
@yyfamazon You also need to update the PR description and add a Changelog entry for it. |
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
Signed-off-by: yyfamazon <yyf@amazon.com>
@ruanyl done, thanks! |
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
1 similar comment
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
Signed-off-by: yyfamazon <yyf@amazon.com>
| if (typeof action?.getTooltip === 'function') { | ||
| contextItem.toolTipContent = action.getTooltip(context); | ||
| } | ||
| if (typeof action?.isDisabled === 'function') { | ||
| contextItem.disabled = action?.isDisabled(context); | ||
| } | ||
| panels[parentGroupId || 'mainMenu'].items!.push(contextItem); |
There was a problem hiding this comment.
would like have a unit test for this
|
failed test cases are not related this change, merge it |
* add action id Signed-off-by: yyfamazon <yyf@amazon.com> * add change log Signed-off-by: yyfamazon <yyf@amazon.com> * add tooltip and disable to context Signed-off-by: yyfamazon <yyf@amazon.com> * fix test Signed-off-by: yyfamazon <yyf@amazon.com> * fix test Signed-off-by: yyfamazon <yyf@amazon.com> * resolve comment Signed-off-by: yyfamazon <yyf@amazon.com> * resolve comments Signed-off-by: yyfamazon <yyf@amazon.com> * Changeset file for PR opensearch-project#9696 created/updated --------- Signed-off-by: yyfamazon <yyf@amazon.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
* add action id Signed-off-by: yyfamazon <yyf@amazon.com> * add change log Signed-off-by: yyfamazon <yyf@amazon.com> * add tooltip and disable to context Signed-off-by: yyfamazon <yyf@amazon.com> * fix test Signed-off-by: yyfamazon <yyf@amazon.com> * fix test Signed-off-by: yyfamazon <yyf@amazon.com> * resolve comment Signed-off-by: yyfamazon <yyf@amazon.com> * resolve comments Signed-off-by: yyfamazon <yyf@amazon.com> * Changeset file for PR opensearch-project#9696 created/updated --------- Signed-off-by: yyfamazon <yyf@amazon.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Description
Add tooltip and disabled to context. So the generate visualization button can be disabled when there is no results or there is error: https://github.com/opensearch-project/dashboards-assistant/pull/546/files
Issues Resolved
Screenshot
Testing the changes
Changelog
isDisabledandgetTooltipCheck List
yarn test:jestyarn test:jest_integration