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

fix: keep the tab order #30888

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

US579
Copy link
Contributor

@US579 US579 commented Nov 10, 2024

SUMMARY

When export all tabs to a PDF in report & alert, user noticed that the all tabs export doesn't seem to export the tabs in any specific order (our report with 3 tabs exported with tab 2, then 3, then 1 in the PDF)

reference: #30694 (comment)

Context

The exported tabs are now ordered based on the sequence of anchors under the all_tabs field from the tabs endpoint response. This enhancement aligns the export order with the order displayed on the dashboard.

BEFORE PDF

before.pdf

AFTER PDF

after.pdf

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@github-actions github-actions bot added the api Related to the REST API label Nov 10, 2024
@dosubot dosubot bot added alert-reports Namespace | Anything related to the Alert & Reports feature dashboard:tab Related to the usage of tabs in the Dashboard labels Nov 10, 2024
@US579
Copy link
Contributor Author

US579 commented Nov 10, 2024

FYI @yousoph

Copy link

codecov bot commented Nov 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.77%. Comparing base (d5a4815) to head (5f1fb73).

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #30888       +/-   ##
===========================================
+ Coverage        0   83.77%   +83.77%     
===========================================
  Files           0      538      +538     
  Lines           0    39152    +39152     
===========================================
+ Hits            0    32799    +32799     
- Misses          0     6353     +6353     
Flag Coverage Δ
hive 48.75% <12.50%> (?)
mysql 76.51% <100.00%> (?)
postgres 76.56% <100.00%> (?)
presto 53.26% <12.50%> (?)
python 83.77% <100.00%> (?)
sqlite 76.03% <100.00%> (?)
unit 60.89% <12.50%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rusackas
Copy link
Member

LGTM, but @eschutho might be better poised to actually test this before approving/merging.

@rusackas rusackas requested a review from eschutho November 11, 2024 16:57
response_data = json.dumps({"result": result})
return Response(
response_data, status=HTTPStatus.OK, mimetype="application/json"
)
Copy link
Member

Choose a reason for hiding this comment

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

@US579 was the self.response not including the correct mimetype? I would think that all the responses should be json, but maybe @dpgaspar has more info on this.

Copy link
Contributor Author

@US579 US579 Jan 8, 2025

Choose a reason for hiding this comment

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

yep it does has mimetype, but jsonify func will reorder the dict, and it is part of the func in self.response

This is a test example

Screenshot 2025-01-08 at 9 49 44 pm Screenshot 2025-01-08 at 9 48 59 pm

with response

Screenshot 2025-01-09 at 9 35 42 am Screenshot 2025-01-09 at 9 35 32 am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alert-reports Namespace | Anything related to the Alert & Reports feature api Related to the REST API dashboard:tab Related to the usage of tabs in the Dashboard size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants