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

Intercept KeyError on navigation straight to the metadata tab without adding a config. #95

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

samcunliffe
Copy link
Member

@samcunliffe samcunliffe commented Jun 12, 2023

Solves the first part of

If no config is found, then show a message explaining that there's no config loaded and return. Also, the function didn't explicitly return if metadata_output_children so I also fix that.

The eagle-eyed amongst you might notice that this is testless 🤢 #WhatAboutAllOfYouTDDEvangelismSam?. But this will be covered by a tweak to one of the files introduced in #82 (which should probably go in first but not mandatory).

Edit: Now ready for review (sorry for the noise). Tested and looking good. I also fixed an error on the ROI page (which now also loads without error if no config).

The dashboard is still an XFAIL and is a bit more complicated so should go in a separate PR.

Solves the first part (but not all of) of #83. If no config found, then
just show a message explaining that there's no config loaded and return.
Also the function didn't explicitly return if
``metadata_output_children`` so also fix that.
@samcunliffe samcunliffe requested a review from sfmig June 12, 2023 08:09
@@ -373,6 +391,7 @@ def create_metadata_table_and_buttons(
generate_yaml_tooltip,
]
)
return None
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if we ever get into this situation? Should I throw an error? Or return an empty Div?

@codecov-commenter
Copy link

codecov-commenter commented Jun 12, 2023

Codecov Report

Merging #95 (cdc6aea) into main (89f0e28) will increase coverage by 9.36%.
The diff coverage is 39.47%.

@@            Coverage Diff             @@
##             main      #95      +/-   ##
==========================================
+ Coverage   29.81%   39.17%   +9.36%     
==========================================
  Files          12       13       +1     
  Lines         691      702      +11     
==========================================
+ Hits          206      275      +69     
+ Misses        485      427      -58     
Impacted Files Coverage Δ
wazp/app.py 90.90% <ø> (ø)
wazp/callbacks/dashboard.py 30.12% <0.00%> (+3.61%) ⬆️
wazp/callbacks/home.py 43.33% <0.00%> (ø)
wazp/pages/04_dashboard.py 100.00% <ø> (ø)
wazp/pages/home.py 100.00% <ø> (ø)
wazp/utils.py 24.68% <0.00%> (+1.89%) ⬆️
wazp/callbacks/roi.py 40.25% <45.45%> (+23.66%) ⬆️
wazp/callbacks/metadata.py 22.22% <54.54%> (+3.30%) ⬆️
wazp/callbacks/_common.py 100.00% <100.00%> (ø)
wazp/pages/02_ROI.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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.

3 participants