Skip to content
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: variables support to pass current selected time for URL drilldown #3693

Conversation

ktx-abhay
Copy link
Collaborator

@ktx-abhay ktx-abhay commented Jun 7, 2024

  • User Guide
    image

  • Example:
    image

Summary by CodeRabbit

  • New Features

    • Enhanced drilldown functionality by adding logic to handle selected start and end times.
    • Updated user guide with detailed instructions on using selected time period variables in queries.
  • Bug Fixes

    • Improved handling of invalid date inputs to prevent errors during time selection.

Copy link

coderabbitai bot commented Jun 7, 2024

Walkthrough

Recent updates to the project enhance the functionality of the dashboard components by improving the handling of time selections and user documentation. The PanelSchemaRenderer.vue component now accurately processes selected start and end times for drilldown variables, ensuring valid timestamps are used. Additionally, the DrilldownUserGuide.vue has been refined with clearer instructions on utilizing selected time periods and variables, significantly improving user comprehension and interaction with the dashboard features.

Changes

Files Change Summary
web/src/components/dashboards/PanelSchemaRenderer.vue
web/src/components/dashboards/addPanel/DrilldownUserGuide.vue
Enhanced handling of selected time objects with validity checks and timestamp conversion; updated user guide with clearer instructions on using ${start_time} and ${end_time} in queries.

Possibly related PRs

Tip

OpenAI O1 model for chat
  • We have deployed OpenAI's latest O1 model for chat.
  • OpenAI claims that this model has superior reasoning capabilities than their GPT-4o model.
  • Please share any feedback with us in the discussions post.

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e9676f3 and 5b03ce2.

Files selected for processing (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue (1 hunks)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (3 hunks)
Additional comments not posted (5)
web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (4)

52-53: LGTM!

The line break is a valid formatting change to improve the vertical spacing and readability of the user guide.


54-71: Great addition to the user guide!

The new section on referencing the currently selected time period using ${start_time} and ${end_time} variables is a valuable addition to the user guide. It provides clear instructions, a practical example, and a helpful note to guide users in utilizing these variables effectively in their drilldown URLs.

The changes enhance the user guide's comprehensiveness and usability, making it easier for users to understand and leverage the selected time period in their drilldowns.


82-83: LGTM!

The line break is a valid formatting change to improve the vertical spacing and readability of the user guide.


101-102: LGTM!

The line break is a valid formatting change to improve the vertical spacing and readability of the user guide.

web/src/components/dashboards/PanelSchemaRenderer.vue (1)

655-672: LGTM!

The code segment correctly handles the selected start and end times for drilldown variables by checking their validity and converting them to timestamps. No issues found.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ab891e1 and 5edb676.

Files selected for processing (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue (1 hunks)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (3 hunks)
Additional comments not posted (3)
web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (2)

54-71: Ensure the new instructions are clear and accurate.

The added instructions for using the current selected time period variables (${start_time} and ${end_time}) are clear and well-documented. This should help users effectively utilize these variables in their drilldown configurations.


Line range hint 72-102: Review the added instructions for series name, value, and table chart drilldown variables.

The instructions for using series name and value variables, as well as table chart drilldown variables, are comprehensive and well-explained. This addition will enhance user understanding of how to apply these variables in different contexts.

web/src/components/dashboards/PanelSchemaRenderer.vue (1)

560-567: Validate the conversion of selected time to milliseconds.

The conversion of selectedTimeObj to milliseconds for start_time and end_time is implemented correctly. This ensures that the time values are accurately passed to the drilldown URLs, which is crucial for maintaining the integrity of time-based data in drilldown scenarios.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5edb676 and 83ad470.

Files selected for processing (1)
  • web/src/components/dashboards/PanelSchemaRenderer.vue (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • web/src/components/dashboards/PanelSchemaRenderer.vue

@ktx-abhay ktx-abhay force-pushed the feat/variables-support-to-pass-current-selected-time-for-drilldown branch from 83ad470 to e4221bf Compare June 7, 2024 16:17
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 83ad470 and e4221bf.

Files selected for processing (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue (1 hunks)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue

@ktx-abhay ktx-abhay force-pushed the feat/variables-support-to-pass-current-selected-time-for-drilldown branch from e4221bf to 222b366 Compare June 10, 2024 04:07
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e4221bf and 222b366.

Files selected for processing (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue (1 hunks)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue

@ktx-abhay ktx-abhay force-pushed the feat/variables-support-to-pass-current-selected-time-for-drilldown branch from 222b366 to b77fde6 Compare June 11, 2024 03:57
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 222b366 and b77fde6.

Files selected for processing (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue (1 hunks)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue

@ktx-abhay ktx-abhay force-pushed the feat/variables-support-to-pass-current-selected-time-for-drilldown branch from b77fde6 to 1a4d4a4 Compare June 12, 2024 05:41
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b77fde6 and 1a4d4a4.

Files selected for processing (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue (1 hunks)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue

@ktx-abhay ktx-abhay force-pushed the feat/variables-support-to-pass-current-selected-time-for-drilldown branch from 1a4d4a4 to 3528314 Compare June 13, 2024 03:50
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1a4d4a4 and 3528314.

Files selected for processing (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue (1 hunks)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue

@ktx-abhay ktx-abhay force-pushed the feat/variables-support-to-pass-current-selected-time-for-drilldown branch from 3528314 to 9430dae Compare June 14, 2024 00:20
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3528314 and 9430dae.

Files selected for processing (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue (1 hunks)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue

@ktx-vaidehi ktx-vaidehi force-pushed the feat/variables-support-to-pass-current-selected-time-for-drilldown branch from 9430dae to ae2b171 Compare June 14, 2024 04:56
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9430dae and ae2b171.

Files selected for processing (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue (1 hunks)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue

@ktx-abhay ktx-abhay force-pushed the feat/variables-support-to-pass-current-selected-time-for-drilldown branch from ae2b171 to f165fe6 Compare June 17, 2024 12:12
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ae2b171 and f165fe6.

Files selected for processing (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue (1 hunks)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue

@ktx-abhay ktx-abhay force-pushed the feat/variables-support-to-pass-current-selected-time-for-drilldown branch from f165fe6 to 69d70b5 Compare June 22, 2024 13:26
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f165fe6 and 69d70b5.

Files selected for processing (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue (1 hunks)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (3 hunks)
Files skipped from review as they are similar to previous changes (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue

@ktx-abhay ktx-abhay force-pushed the feat/variables-support-to-pass-current-selected-time-for-drilldown branch from 69d70b5 to 61a89c0 Compare July 4, 2024 07:10
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 69d70b5 and 61a89c0.

Files selected for processing (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue (1 hunks)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (3 hunks)
Files skipped from review due to trivial changes (1)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue
Additional comments not posted (2)
web/src/components/dashboards/PanelSchemaRenderer.vue (2)

563-571: Ensure proper date validation and conversion for start time.

The logic correctly checks if selectedTimeObj?.value?.start_time is a valid date and converts it to a Unix timestamp. This ensures that only valid dates are processed.


573-580: Ensure proper date validation and conversion for end time.

The logic correctly checks if selectedTimeObj?.value?.end_time is a valid date and converts it to a Unix timestamp. This ensures that only valid dates are processed.

@ktx-abhay ktx-abhay force-pushed the feat/variables-support-to-pass-current-selected-time-for-drilldown branch from 61a89c0 to b86a18a Compare July 15, 2024 05:37
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 61a89c0 and b86a18a.

Files selected for processing (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue (1 hunks)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (3 hunks)
Files skipped from review due to trivial changes (1)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue

@ktx-abhay ktx-abhay force-pushed the feat/variables-support-to-pass-current-selected-time-for-drilldown branch from b86a18a to 265acfb Compare July 17, 2024 11:51
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b86a18a and 265acfb.

Files selected for processing (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue (1 hunks)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • web/src/components/dashboards/PanelSchemaRenderer.vue
Additional comments not posted (4)
web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (4)

54-71: Clear and informative section on using the current selected time period.

The addition of this section enhances the user guide by explaining how to use dynamic variables for time periods in URL drilldowns. The examples provided are clear and should help users understand how to implement this feature.


Line range hint 72-82: Well-structured section on using series name and value.

This section effectively communicates how to use series name and value variables in drilldowns. The format is consistent with other parts of the guide, and the examples are practical and easy to understand.


Line range hint 83-102: Detailed section for table chart drilldown.

The explanations and examples in this section are thorough and provide clear guidance on how to use row field and index for table chart drilldowns. This should be very helpful for users working with table charts.


Line range hint 102-120: Comprehensive guide for Sankey chart drilldown.

This section is well-structured and offers detailed instructions on how to utilize edge and node variables in Sankey chart drilldowns. The format and examples align well with the rest of the guide, ensuring a seamless user experience.

@ktx-abhay ktx-abhay force-pushed the feat/variables-support-to-pass-current-selected-time-for-drilldown branch from 265acfb to 549aa9d Compare July 24, 2024 16:22
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 265acfb and 549aa9d.

Files selected for processing (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue (1 hunks)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (3 hunks)
Additional comments not posted (3)
web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (3)

52-70: LGTM! Documentation on using current selected time period is clear and informative.

The added documentation effectively explains how to reference the current selected time period using ${start_time} and ${end_time}.


Line range hint 72-83:
LGTM! Documentation on using series name and value is clear and informative.

The added documentation effectively explains how to reference the series name and value using ${series.__name} and ${series.__value}.


101-102: LGTM! Documentation on using row field and index for table chart drilldown is clear and informative.

The added documentation effectively explains how to reference the row field and index using ${row.field["field_label"]}, ${row.field.field_label}, and ${row.index}.

@ktx-abhay ktx-abhay force-pushed the feat/variables-support-to-pass-current-selected-time-for-drilldown branch from 549aa9d to ad0f8e7 Compare August 2, 2024 04:28
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 549aa9d and ad0f8e7.

Files selected for processing (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue (1 hunks)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (3 hunks)
Additional comments not posted (1)
web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (1)

52-70: LGTM! The added section is clear and informative.

The instructions, examples, and notes are well-integrated and enhance the usability of the guide.

Comment on lines +588 to +672
// selected start time and end time
if (
selectedTimeObj?.value?.start_time &&
selectedTimeObj?.value?.start_time != "Invalid Date"
) {
drilldownVariables.start_time = new Date(
selectedTimeObj?.value?.start_time?.toISOString()
).getTime();
}

if (
selectedTimeObj?.value?.end_time &&
selectedTimeObj?.value?.end_time != "Invalid Date"
) {
drilldownVariables.end_time = new Date(
selectedTimeObj?.value?.end_time?.toISOString()
).getTime();
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optimize the conditions for setting start and end times.

The conditions for checking and converting start and end times can be combined to reduce redundancy.

-        if (
-          selectedTimeObj?.value?.start_time &&
-          selectedTimeObj?.value?.start_time != "Invalid Date"
-        ) {
-          drilldownVariables.start_time = new Date(
-            selectedTimeObj?.value?.start_time?.toISOString()
-          ).getTime();
-        }
-
-        if (
-          selectedTimeObj?.value?.end_time &&
-          selectedTimeObj?.value?.end_time != "Invalid Date"
-        ) {
-          drilldownVariables.end_time = new Date(
-            selectedTimeObj?.value?.end_time?.toISOString()
-          ).getTime();
-        }
+        const { start_time, end_time } = selectedTimeObj?.value ?? {};
+        if (start_time && start_time != "Invalid Date") {
+          drilldownVariables.start_time = new Date(start_time.toISOString()).getTime();
+        }
+        if (end_time && end_time != "Invalid Date") {
+          drilldownVariables.end_time = new Date(end_time.toISOString()).getTime();
+        }
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// selected start time and end time
if (
selectedTimeObj?.value?.start_time &&
selectedTimeObj?.value?.start_time != "Invalid Date"
) {
drilldownVariables.start_time = new Date(
selectedTimeObj?.value?.start_time?.toISOString()
).getTime();
}
if (
selectedTimeObj?.value?.end_time &&
selectedTimeObj?.value?.end_time != "Invalid Date"
) {
drilldownVariables.end_time = new Date(
selectedTimeObj?.value?.end_time?.toISOString()
).getTime();
}
// selected start time and end time
const { start_time, end_time } = selectedTimeObj?.value ?? {};
if (start_time && start_time != "Invalid Date") {
drilldownVariables.start_time = new Date(start_time.toISOString()).getTime();
}
if (end_time && end_time != "Invalid Date") {
drilldownVariables.end_time = new Date(end_time.toISOString()).getTime();
}

@ktx-abhay ktx-abhay force-pushed the feat/variables-support-to-pass-current-selected-time-for-drilldown branch from ad0f8e7 to 13526ae Compare August 9, 2024 07:11
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ad0f8e7 and 13526ae.

Files selected for processing (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue (1 hunks)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (3 hunks)
Additional comments not posted (2)
web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (1)

54-70: Documentation improvements look great!

The added sections clearly explain how to use the ${start_time} and ${end_time} variables. The examples and notes improve user understanding.

web/src/components/dashboards/PanelSchemaRenderer.vue (1)

588-605: Optimize the conditions for setting start and end times.

The conditions for checking and converting start and end times can be combined to reduce redundancy.

@ktx-abhay ktx-abhay force-pushed the feat/variables-support-to-pass-current-selected-time-for-drilldown branch from 13526ae to e9676f3 Compare August 20, 2024 09:46
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 13526ae and e9676f3.

Files selected for processing (2)
  • web/src/components/dashboards/PanelSchemaRenderer.vue (1 hunks)
  • web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (3 hunks)
Additional comments not posted (5)
web/src/components/dashboards/addPanel/DrilldownUserGuide.vue (4)

54-70: Documentation update is clear and helpful.

The explanation of ${start_time} and ${end_time} variables is well-written and provides a clear example for users. The formatting enhances readability.


Line range hint 72-80: Series name and value documentation is clear.

The instructions for using ${series.__name} and ${series.__value} are well-explained and consistent with the rest of the guide.


Line range hint 82-100: Table chart drilldown instructions are well-explained.

The examples for using ${row.field["field_label"]} and ${row.index} are clear and provide effective guidance for users.


Line range hint 102-119: Sankey chart drilldown documentation is comprehensive.

The instructions for using ${edge.__source}, ${edge.__target}, ${node.__name}, etc., are detailed and consistent with the document's style.

web/src/components/dashboards/PanelSchemaRenderer.vue (1)

588-605: Optimize the conditions for setting start and end times.

The existing logic is correct, but as previously suggested, the conditions can be combined to reduce redundancy. Consider implementing the suggested optimization.

@ktx-abhay ktx-abhay force-pushed the feat/variables-support-to-pass-current-selected-time-for-drilldown branch from e9676f3 to 5b03ce2 Compare September 13, 2024 05:17
@ktx-abhay ktx-abhay merged commit b5ebf90 into main Sep 13, 2024
26 of 28 checks passed
@ktx-abhay ktx-abhay deleted the feat/variables-support-to-pass-current-selected-time-for-drilldown branch September 13, 2024 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants