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

Use theme page and header values if settings.js values are not present #3767

Merged
merged 2 commits into from
Jul 14, 2022

Conversation

Steve-Mcl
Copy link
Contributor

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Proposed changes

  • Permit a theme plugin to specify header and page values
  • Only use theme page and header values if settings.js values are not present
  • If neither are present, then NR defaults are used (as per v2.x)
  • If settings.js values are present, use them (as per v2.x)

Tested...

settings.js theme Results in...
page.favicon = null page.favicon = null uses default NR favicon
page.favicon = null page.favicon = 'common/favicon.ico' uses theme favicon
page.favicon = 'custom-icon.ico' page.favicon = 'common/favicon.ico' uses settings.js custom favicon
. . .
page.title = null page.title = null uses default NR title
page.title = null page.title = 'theme title' uses theme title
page.title = 'settings.js title' page.title = 'theme title' uses settings.js title
. . .
header.image = null header.image = null uses default NR image
header.image = null header.image = 'common/image.ico' uses theme image
header.image = 'custom-icon.ico' header.image = 'common/image.ico' uses settings.js custom image
. . .
header.title = null header.title = null uses default NR title
header.title = null header.title = 'theme title' uses theme title
header.title = 'settings.js title' header.title = 'theme title' uses settings.js title
. . .
header.url = null header.url = null uses default NR url
header.url = null header.url = 'theme url' uses theme url
header.url = 'settings.js url' header.url = 'theme url' uses settings.js url

Checklist

  • I have read the contribution guidelines
  • For non-bugfix PRs, I have discussed this change on the forum/slack team.
  • I have run grunt to verify the unit tests pass
  • I have added suitable unit tests to cover the new/changed functionality

@Steve-Mcl Steve-Mcl requested a review from knolleary July 13, 2022 19:53
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 68.186% when pulling 8bd02d0 on Steve-Mcl:use-theme-page-and-header-values into b28595c on node-red:master.

@knolleary knolleary merged commit 637c44a into node-red:master Jul 14, 2022
@Steve-Mcl Steve-Mcl deleted the use-theme-page-and-header-values branch July 14, 2022 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants