etn-ccis / blui-doc-it

Source code for Brightlayer UI documentation website
https://brightlayer-ui.github.io
2 stars 12 forks source link

Dev-Only Announcement Banners do not work on deployed site #588

Open joebochill opened 2 years ago

joebochill commented 2 years ago

Describe the bug

Announcements that are specified as devOnly do not appear on the deployed version of the dev site.

What is the expected behavior?

These banners should be visible

What are the steps to reproduce?

  1. Configure an announcement banner in the blui-database repository that is devOnly
  2. Open the dev version of the doc site on github pages
  3. Observe that the banner is not visible on the homepage

Screenshots / Screen recording

image

Code snippet / Link to minimum reproduction example

https://brightlayer-ui-dev.github.io/

image

environment === 'production' will always return true.

Your environment information

Suggested fix

This issue for this is because we are using the process.env.NODE_ENV to determine whether we are dev or master, which is incorrect. When the site is deployed to github pages, it's a production build (regardless of whether we deploy to master or dev). This needs to be updated to use a proper environment variable in CircleCI to determine the branch we are on.

Anything else to add?

There is also a gap that appears on the MASTER version of the deployed site when there is a devOnly version

huayunh commented 2 years ago

Whoever is fixing this bug, make sure that you will also fix this dirty hack here: https://github.com/brightlayer-ui/doc-it/blob/dev/src/__configuration__/resources/ComponentCatalogLinks.ts#L17

daileytj commented 1 year ago

Whoever is fixing this bug, make sure that you will also fix this dirty hack here: https://github.com/brightlayer-ui/doc-it/blob/dev/src/__configuration__/resources/ComponentCatalogLinks.ts#L17

You can use dotenv package to manage this