Allow customization of documentation icon and text#8507
Allow customization of documentation icon and text#8507etr2460 merged 3 commits intoapache:masterfrom
Conversation
| {% set bug_report_url = appbuilder.app.config.get('BUG_REPORT_URL') %} | ||
| {% set documentation_url = appbuilder.app.config.get('DOCUMENTATION_URL') %} | ||
| {% set documentation_icon = appbuilder.app.config.get('DOCUMENTATION_ICON') %} | ||
| {% set documentation_text = appbuilder.app.config.get('DOCUMENTATION_TEXT', 'Documentation') %} |
There was a problem hiding this comment.
instead of this, let's default the config var value in config.py and keep the [] syntax for getting params from this dict. Same goes for all the other config vars here.
There was a problem hiding this comment.
Done. One issue with this is that if DOCUMENTATION_TEXT isn't defined in the an existing deployment's config.py then the default text will now be None. Any concerns with that?
There was a problem hiding this comment.
I think it's fine. The issue would really be if DOCUMENTATION_TEXT was explicitly defined as None, because otherwise it's now defined in the default config
| > | ||
| {% if documentation_icon %} | ||
| <img | ||
| width="{{ documentation_icon_width }}" |
There was a problem hiding this comment.
seems like this wouldn't be necessary. Maybe we could set width to 100% or something? Or just enforce that the icon people use must be a certain size (64px or 128px or something like that)
Codecov Report
@@ Coverage Diff @@
## master #8507 +/- ##
==========================================
+ Coverage 66.46% 71.71% +5.25%
==========================================
Files 449 117 -332
Lines 22684 12424 -10260
Branches 2366 0 -2366
==========================================
- Hits 15076 8910 -6166
+ Misses 7470 3514 -3956
+ Partials 138 0 -138Continue to review full report at Codecov.
|
* Allow customization of documentation icon and text * Set icon width to 100% * Use double quotes for strings
CATEGORY
Choose one
SUMMARY
This change allows customisation of the documentation link's icon and text.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Example with a custom icon

TEST PLAN
Validated that the default icon is used when no icon is specified
ADDITIONAL INFORMATION
REVIEWERS