-
Notifications
You must be signed in to change notification settings - Fork 23
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 assistant capabilities to control rendering components #267
Add assistant capabilities to control rendering components #267
Conversation
…tant feature UI Signed-off-by: Songkan Tang <[email protected]>
Signed-off-by: Songkan Tang <[email protected]>
Signed-off-by: Songkan Tang <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #267 +/- ##
==========================================
- Coverage 90.34% 89.44% -0.91%
==========================================
Files 59 60 +1
Lines 1575 1668 +93
Branches 377 407 +30
==========================================
+ Hits 1423 1492 +69
- Misses 150 174 +24
Partials 2 2 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Songkan Tang <[email protected]>
Signed-off-by: Songkan Tang <[email protected]>
Signed-off-by: Songkan Tang <[email protected]>
common/types/config.ts
Outdated
@@ -6,8 +6,7 @@ | |||
import { schema, TypeOf } from '@osd/config-schema'; | |||
|
|||
export const configSchema = schema.object({ | |||
// TODO: add here to prevent this plugin from being loaded | |||
// enabled: schema.boolean({ defaultValue: true }), | |||
enabled: schema.boolean({ defaultValue: true }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enable this will allow whole dashboard assistant been disabled, is this expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think it's upon agreement. Is it true? @ruanyl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, this flag allows us to turnoff the entire plugin
public/plugin.tsx
Outdated
} else { | ||
return () => {}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to render some tips or instructions to direct user to active the subscription?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a default "Application Not Activated" danger tips now
…ot activated Signed-off-by: Songkan Tang <[email protected]>
Signed-off-by: Songkan Tang <[email protected]>
Signed-off-by: Songkan Tang <[email protected]>
Signed-off-by: Songkan Tang <[email protected]>
Signed-off-by: Songkan Tang <[email protected]>
Signed-off-by: Songkan Tang <[email protected]>
server/plugin.ts
Outdated
} | ||
|
||
core.capabilities.registerProvider(capabilitiesProvider); | ||
core.capabilities.registerSwitcher(capabilitiesSwitcher); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this switcher in dashboards-assistant? The default value is true
already, maybe just let whoever need to update the value to register the switcher?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that also makes sense. Developers can register their own switch per requirement. Removed the switcher registration now.
…ir requirement Signed-off-by: Songkan Tang <[email protected]>
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/dashboards-assistant/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/dashboards-assistant/backport-2.x
# Create a new branch
git switch --create backport/backport-267-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 4ec4f92b1ca2218fd5eb5498b73c1508f35262d0
# Push it to GitHub
git push --set-upstream origin backport/backport-267-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/dashboards-assistant/backport-2.x Then, create a pull request where the |
@songkant-aws backport to 2.x failed. |
Ok, will fix it. The PR is merged after this one [#266 ]. Since some conflicts are resolved based on #266, I will wait for its backport. Let me ping the owner to backport #266. |
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/dashboards-assistant/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/dashboards-assistant/backport-2.x
# Create a new branch
git switch --create backport/backport-267-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 4ec4f92b1ca2218fd5eb5498b73c1508f35262d0
# Push it to GitHub
git push --set-upstream origin backport/backport-267-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/dashboards-assistant/backport-2.x Then, create a pull request where the |
* Add capabilities to check subscription active status to control assistant feature UI Signed-off-by: Songkan Tang <[email protected]> * Fix text2viz feature flag check in server/plugin.ts Signed-off-by: Songkan Tang <[email protected]> * Use assistant isSubscriptionActive capabilities to control text2viz UI Signed-off-by: Songkan Tang <[email protected]> * Add changelog Signed-off-by: Songkan Tang <[email protected]> * Add default app not activation page for text2viz if subscription is not activated Signed-off-by: Songkan Tang <[email protected]> * Rename assistant feature UI capabilities to a more general name Signed-off-by: Songkan Tang <[email protected]> * Rename changelog Signed-off-by: Songkan Tang <[email protected]> * Rephrase app not found page Signed-off-by: Songkan Tang <[email protected]> * Remove switcher registration in favor of developers adding it per their requirement Signed-off-by: Songkan Tang <[email protected]> --------- Signed-off-by: Songkan Tang <[email protected]> (cherry picked from commit 4ec4f92) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
* Add capabilities to check subscription active status to control assistant feature UI Signed-off-by: Songkan Tang <[email protected]> * Fix text2viz feature flag check in server/plugin.ts Signed-off-by: Songkan Tang <[email protected]> * Use assistant isSubscriptionActive capabilities to control text2viz UI Signed-off-by: Songkan Tang <[email protected]> * Add changelog Signed-off-by: Songkan Tang <[email protected]> * Add default app not activation page for text2viz if subscription is not activated Signed-off-by: Songkan Tang <[email protected]> * Rename assistant feature UI capabilities to a more general name Signed-off-by: Songkan Tang <[email protected]> * Rename changelog Signed-off-by: Songkan Tang <[email protected]> * Rephrase app not found page Signed-off-by: Songkan Tang <[email protected]> * Remove switcher registration in favor of developers adding it per their requirement Signed-off-by: Songkan Tang <[email protected]> --------- Signed-off-by: Songkan Tang <[email protected]> (cherry picked from commit 4ec4f92) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Add assistant feature capabilities to allow users to override capability switcher function to control whether to show assistant feature UI components.
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.