-
Notifications
You must be signed in to change notification settings - Fork 890
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: [contentManagement] allow to update section input after page rendered #7651
feat: [contentManagement] allow to update section input after page rendered #7651
Conversation
This makes it possible a dashboard rendered by content management plugin to update the query, time range and filters on the fly Signed-off-by: Yulong Ruan <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7651 +/- ##
=======================================
Coverage 63.68% 63.68%
=======================================
Files 3633 3633
Lines 80101 80122 +21
Branches 12690 12697 +7
=======================================
+ Hits 51009 51026 +17
- Misses 25985 25987 +2
- Partials 3107 3109 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Yulong Ruan <[email protected]>
query: { | ||
query: '', | ||
language: 'lucene', | ||
language: 'kuery', |
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.
What's the difference between the language here? I guess it will be overwritten by ...section.input
?
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, it can be override by section.input
. Here it just changed the default language from lucene
to kuery(DQL)
.
} | ||
|
||
const updated = callback(section); | ||
if (updated) { |
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.
How would you feel about doing
if (updated.kind !== section.kind) return;
... and then a switch-case for dashboard
, card
, and custom
?
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.
Good idea! I will adopt this change in the upcoming PR
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.
…ndered (#7651) * feat: allow to update section input on the fly This makes it possible a dashboard rendered by content management plugin to update the query, time range and filters on the fly Signed-off-by: Yulong Ruan <[email protected]> * Changeset file for PR #7651 created/updated * fix(linter): add license header Signed-off-by: Yulong Ruan <[email protected]> --------- Signed-off-by: Yulong Ruan <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit b68754e) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…ndered (#7651) (#7694) * feat: allow to update section input on the fly This makes it possible a dashboard rendered by content management plugin to update the query, time range and filters on the fly * Changeset file for PR #7651 created/updated * fix(linter): add license header --------- (cherry picked from commit b68754e) Signed-off-by: Yulong Ruan <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
This PR makes it possible to update the section input after the page is rendered, for example, when rendering a dashboard on the page, we need to apply the date range, filter and query on the fly.
Description
Issues Resolved
Screenshot
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration