Skip to content

Comments

Allow customization of documentation icon and text#8507

Merged
etr2460 merged 3 commits intoapache:masterfrom
paulvic:paul/doclink_customize
Nov 12, 2019
Merged

Allow customization of documentation icon and text#8507
etr2460 merged 3 commits intoapache:masterfrom
paulvic:paul/doclink_customize

Conversation

@paulvic
Copy link
Contributor

@paulvic paulvic commented Nov 5, 2019

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

This change allows customisation of the documentation link's icon and text.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Example with a custom icon
image

TEST PLAN

Validated that the default icon is used when no icon is specified

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

REVIEWERS

@paulvic paulvic changed the title Allow customization of documentation icon and text [WIP] Allow customization of documentation icon and text Nov 5, 2019
@paulvic paulvic changed the title [WIP] Allow customization of documentation icon and text Allow customization of documentation icon and text Nov 5, 2019
Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

a couple comments

{% 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') %}
Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Member

Choose a reason for hiding this comment

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

+1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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?

Copy link
Member

Choose a reason for hiding this comment

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

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 }}"
Copy link
Member

Choose a reason for hiding this comment

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

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Set to 100% 👍

@codecov-io
Copy link

codecov-io commented Nov 7, 2019

Codecov Report

Merging #8507 into master will increase coverage by 5.25%.
The diff coverage is 100%.

Impacted file tree graph

@@            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     -138
Impacted Files Coverage Δ
superset/config.py 90% <100%> (+0.09%) ⬆️
superset/views/utils.py 90.09% <0%> (-0.66%) ⬇️
...sets/src/explore/components/ExploreChartHeader.jsx
superset/assets/src/components/Checkbox.jsx
...perset/assets/src/dashboard/util/getEmptyLayout.js
...ts/src/dashboard/util/getComponentWidthFromDrop.js
.../assets/src/dashboard/reducers/dashboardFilters.js
...rc/explore/components/controls/AnnotationLayer.jsx
superset/assets/src/welcome/DashboardTable.jsx
...erset/assets/src/dashboard/util/injectCustomCss.js
... and 330 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 926dca3...edf7a72. Read the comment docs.

Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

lgtm, looks great!

@etr2460 etr2460 merged commit 62476c5 into apache:master Nov 12, 2019
graceguo-supercat pushed a commit that referenced this pull request Nov 13, 2019
* Allow customization of documentation icon and text

* Set icon width to 100%

* Use double quotes for strings
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.36.0 First shipped in 0.36.0 labels Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/S 🚢 0.36.0 First shipped in 0.36.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants