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

Dark mode configurations for header logo, welcome logo and loading logo #797

Conversation

abbyhu2000
Copy link
Member

@abbyhu2000 abbyhu2000 commented Sep 14, 2021

Description

This PR added dark mode configurations in the yml file to allow user to configure a dark mode version of the logos when user toggles dark mode settings under the Advanced Setting.

Added configurations:

  • branding.logo.darkModeUrl
  • branding.mark.darkModeUrl
  • branding.loadingLogo.darkModeUrl

Screen Shot 2021-09-14 at 1 17 43 PM

Screen Shot 2021-09-15 at 4 39 56 PM

Screen Shot 2021-09-14 at 1 16 29 PM

Priority order:

  • For header logo on the nav bar:
    -- Default mode: logo.defaultUrl > mark.defaultUrl > opensearchHeaderLogo
    -- Dark mode: logo.darkModeUrl > logo.defaultUrl > mark.darkModeUrl > mark.defaultUrl > opensearchHeaderLogo
  • For loading logo:
    -- Default mode: loadingLogo.defaultUrl > mark.defaultUrl+loading bar > opensearchLogoSpinner
    -- Dark mode: loadingLogo.darkModeUrl > loadingLogo.defaultUrl > mark.darkModeUrl + loading bar> mark.defaultUrl + loading bar > opensearchLogoSpinner
  • For welcome logo:
    -- Default mode: mark.defaultUrl > opensearchLogo
    -- Dark mode: mark.darkModeUrl > mark.defaultUrl > opensearchLogo

Details

  • Default mode will only consider and use default URLs; dark mode will consider and use both dark mode URLs and default URLs
  • Dark mode URL is an add-on option based on a valid default URL; if user provides a valid dark mode URL but fail to provide a valid default URL, log will show an error and the dark mode URL is invalid to use

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

@opensearch-ci-bot
Copy link
Collaborator

✅   DCO Check Passed 2ca8e44

@abbyhu2000 abbyhu2000 closed this Sep 14, 2021
@abbyhu2000 abbyhu2000 deleted the branding_dev_p0_darkmode_configuration branch September 14, 2021 20:05
@abbyhu2000 abbyhu2000 restored the branding_dev_p0_darkmode_configuration branch September 14, 2021 20:06
@abbyhu2000 abbyhu2000 reopened this Sep 14, 2021
@opensearch-ci-bot
Copy link
Collaborator

✅   DCO Check Passed 2ca8e44

@abbyhu2000
Copy link
Member Author

Screen Shot 2021-09-15 at 12 50 20 AM

@abbyhu2000 abbyhu2000 force-pushed the branding_dev_p0_darkmode_configuration branch from 2ca8e44 to e6c16ef Compare September 15, 2021 09:23
@opensearch-ci-bot
Copy link
Collaborator

✅   DCO Check Passed e6c16ef

@ananzh ananzh self-requested a review September 15, 2021 17:25
@abbyhu2000 abbyhu2000 force-pushed the branding_dev_p0_darkmode_configuration branch from e6c16ef to 6fe776e Compare September 15, 2021 22:50
@abbyhu2000 abbyhu2000 marked this pull request as ready for review September 15, 2021 22:51
@opensearch-ci-bot
Copy link
Collaborator

✅   DCO Check Passed 6fe776e

@@ -131,28 +122,21 @@ export class RenderingService {
uiSettings: settings,
},
branding: {
darkMode,
Copy link
Member

Choose a reason for hiding this comment

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

for consistency should this be
darkMode: darkMode

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea, I originally did darkMode: darkMode, but yarn lint:es will complain about "expected property shorthand", and --fix flag will fix that into just "darkMode".

Copy link
Member

@kavilla kavilla left a comment

Choose a reason for hiding this comment

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

some comments mostly on commenting.

@abbyhu2000 abbyhu2000 force-pushed the branding_dev_p0_darkmode_configuration branch from 6fe776e to 80d7d17 Compare September 17, 2021 16:31
@opensearch-ci-bot
Copy link
Collaborator

✅   DCO Check Passed 80d7d17

Add dark mode configs in the yml file that allows user to configure a
dark mode version of the logo. When user toggles dark mode under the
Advanced Setting, the logo will be rendered accordingly.

Signed-off-by: Abby Hu <[email protected]>
@abbyhu2000 abbyhu2000 force-pushed the branding_dev_p0_darkmode_configuration branch from 80d7d17 to 0c919d1 Compare September 17, 2021 17:57
@opensearch-ci-bot
Copy link
Collaborator

✅   DCO Check Passed 0c919d1

@kavilla kavilla merged commit 7904df4 into opensearch-project:feature/branding/p0 Sep 17, 2021
kavilla pushed a commit that referenced this pull request Sep 27, 2021
#797)

Add dark mode configs in the yml file that allows user to configure a
dark mode version of the logo. When user toggles dark mode under the
Advanced Setting, the logo will be rendered accordingly.

Signed-off-by: Abby Hu <[email protected]>
kavilla pushed a commit to kavilla/OpenSearch-Dashboards-1 that referenced this pull request Oct 15, 2021
opensearch-project#797)

Add dark mode configs in the yml file that allows user to configure a
dark mode version of the logo. When user toggles dark mode under the
Advanced Setting, the logo will be rendered accordingly.

Signed-off-by: Abby Hu <[email protected]>
kavilla pushed a commit that referenced this pull request Oct 15, 2021
#797)

Add dark mode configs in the yml file that allows user to configure a
dark mode version of the logo. When user toggles dark mode under the
Advanced Setting, the logo will be rendered accordingly.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>
kavilla pushed a commit that referenced this pull request Oct 30, 2021
#797)

Add dark mode configs in the yml file that allows user to configure a
dark mode version of the logo. When user toggles dark mode under the
Advanced Setting, the logo will be rendered accordingly.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>
kavilla added a commit that referenced this pull request Nov 1, 2021
* Make top left logo on the main screen configurable

Add a new config opensearchDashboards.branding.logoUrl in yaml file
for making top left corner logo on the main screen configurable. If
URL is invalid, the default OpenSearch logo will be shown.

Signed-off-by: Abby Hu <[email protected]>

* Welcome page title and logo configurable (#738)

Add two new configs branding.smallLogoUrl and branding.title
in the yaml file for making the welcome page logo and title
 configurable. If URL is invalid, the default branding will be shown.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Make loading page logo and title configurable (#746)

Add one new config branding.loadingLogoUrl for making loading page logo
configurable. URL can be in svg and gif format. If no loading logo is found,
the static logo with a horizontal bar loading bar will be shown. If logo is also
not found, the default OpenSearch loading logo and spinner will be shown.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Branding configs rename and improvement (#771)

Change config smallLogoUrl to logoUrl, config logoUrl to fullLogoUrl to emphasize that thumbnail version
of the logo will be used mostly in the application. Full version of the logo will only be used on the main
page nav bar. If full logo is not provided, thumbnail logo will be used on the nav bar. Some config improvement
includes fixing the validation error when inputting empty string, and add title validation function.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Branding config structure change and renaming (#793)

Change the branding related config to a map structure in the yml file.
Also rename the configs according to the official branding guidelines.
The full logo on the main page header will be called logo; the small
logo icon will be called mark.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Darkmode configurations for header logo, welcome logo and loading logo (#797)

Add dark mode configs in the yml file that allows user to configure a
dark mode version of the logo. When user toggles dark mode under the
Advanced Setting, the logo will be rendered accordingly.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Add favicon configuration (#801)

Added a configuration on favicon inside opensearchDashboards.branding
in the yml file. If user inputs a valid URL, we gurantee basic browser
favicon customization, while remaining places show the default browser/device
favicon icon. If user does not provide a valid URL for favicon, the
opensearch favicon icon will be used.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Make home page primary dashboard card logo and title configurable (#809)

Home page dashboard card logo and title can be customized by config
mark.defaultUrl and mark.darkModeUrl. Unit test and functional test
are also written.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Side menu logo configuration

Make logo for opensearch dashboard side menu be configurable.
Use config mark.defaultUrl and mark.darkModeUrl.

Signed-off-by: Abby Hu <[email protected]>

* Overview Header Logo Configuration

Make logo for opensearch dashboard overview header logo be configurable.
Use config mark.defaultUrl and mark.darkModeUrl.

Signed-off-by: Abby Hu <[email protected]>

* Redirect URL not allowed

Add an addtional parameter to the checkUrlValid function
so that max redirect count is 0. We do not allow URLs that
can be redirected because of potential security issues.

Signed-off-by: Abby Hu <[email protected]>

* Store default opensearch branding asset folder

Store the original opensearch branding logos in an asset folder,
instead of making API calls.

Signed-off-by: Abby Hu <[email protected]>

* [Branding] handle comments from PR

Handling the helper function rename and grammar issues.

To avoid risk, we will not remove the duplicate code for 1.2 and
everything related to those comments (ie function renames).

That will be handled in 1.3. Here is the issue tracking it:

#895

Signed-off-by: Kawika Avilla <[email protected]>

Co-authored-by: Kawika Avilla <[email protected]>
kavilla pushed a commit to kavilla/OpenSearch-Dashboards-1 that referenced this pull request Nov 1, 2021
* Make top left logo on the main screen configurable

Add a new config opensearchDashboards.branding.logoUrl in yaml file
for making top left corner logo on the main screen configurable. If
URL is invalid, the default OpenSearch logo will be shown.

Signed-off-by: Abby Hu <[email protected]>

* Welcome page title and logo configurable (opensearch-project#738)

Add two new configs branding.smallLogoUrl and branding.title
in the yaml file for making the welcome page logo and title
 configurable. If URL is invalid, the default branding will be shown.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Make loading page logo and title configurable (opensearch-project#746)

Add one new config branding.loadingLogoUrl for making loading page logo
configurable. URL can be in svg and gif format. If no loading logo is found,
the static logo with a horizontal bar loading bar will be shown. If logo is also
not found, the default OpenSearch loading logo and spinner will be shown.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Branding configs rename and improvement (opensearch-project#771)

Change config smallLogoUrl to logoUrl, config logoUrl to fullLogoUrl to emphasize that thumbnail version
of the logo will be used mostly in the application. Full version of the logo will only be used on the main
page nav bar. If full logo is not provided, thumbnail logo will be used on the nav bar. Some config improvement
includes fixing the validation error when inputting empty string, and add title validation function.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Branding config structure change and renaming (opensearch-project#793)

Change the branding related config to a map structure in the yml file.
Also rename the configs according to the official branding guidelines.
The full logo on the main page header will be called logo; the small
logo icon will be called mark.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Darkmode configurations for header logo, welcome logo and loading logo (opensearch-project#797)

Add dark mode configs in the yml file that allows user to configure a
dark mode version of the logo. When user toggles dark mode under the
Advanced Setting, the logo will be rendered accordingly.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Add favicon configuration (opensearch-project#801)

Added a configuration on favicon inside opensearchDashboards.branding
in the yml file. If user inputs a valid URL, we gurantee basic browser
favicon customization, while remaining places show the default browser/device
favicon icon. If user does not provide a valid URL for favicon, the
opensearch favicon icon will be used.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Make home page primary dashboard card logo and title configurable (opensearch-project#809)

Home page dashboard card logo and title can be customized by config
mark.defaultUrl and mark.darkModeUrl. Unit test and functional test
are also written.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Side menu logo configuration

Make logo for opensearch dashboard side menu be configurable.
Use config mark.defaultUrl and mark.darkModeUrl.

Signed-off-by: Abby Hu <[email protected]>

* Overview Header Logo Configuration

Make logo for opensearch dashboard overview header logo be configurable.
Use config mark.defaultUrl and mark.darkModeUrl.

Signed-off-by: Abby Hu <[email protected]>

* Redirect URL not allowed

Add an addtional parameter to the checkUrlValid function
so that max redirect count is 0. We do not allow URLs that
can be redirected because of potential security issues.

Signed-off-by: Abby Hu <[email protected]>

* Store default opensearch branding asset folder

Store the original opensearch branding logos in an asset folder,
instead of making API calls.

Signed-off-by: Abby Hu <[email protected]>

* [Branding] handle comments from PR

Handling the helper function rename and grammar issues.

To avoid risk, we will not remove the duplicate code for 1.2 and
everything related to those comments (ie function renames).

That will be handled in 1.3. Here is the issue tracking it:

opensearch-project#895

Signed-off-by: Kawika Avilla <[email protected]>

Co-authored-by: Kawika Avilla <[email protected]>

Backport PR:
opensearch-project#897
kavilla added a commit that referenced this pull request Nov 1, 2021
* Make top left logo on the main screen configurable

Add a new config opensearchDashboards.branding.logoUrl in yaml file
for making top left corner logo on the main screen configurable. If
URL is invalid, the default OpenSearch logo will be shown.

Signed-off-by: Abby Hu <[email protected]>

* Welcome page title and logo configurable (#738)

Add two new configs branding.smallLogoUrl and branding.title
in the yaml file for making the welcome page logo and title
 configurable. If URL is invalid, the default branding will be shown.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Make loading page logo and title configurable (#746)

Add one new config branding.loadingLogoUrl for making loading page logo
configurable. URL can be in svg and gif format. If no loading logo is found,
the static logo with a horizontal bar loading bar will be shown. If logo is also
not found, the default OpenSearch loading logo and spinner will be shown.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Branding configs rename and improvement (#771)

Change config smallLogoUrl to logoUrl, config logoUrl to fullLogoUrl to emphasize that thumbnail version
of the logo will be used mostly in the application. Full version of the logo will only be used on the main
page nav bar. If full logo is not provided, thumbnail logo will be used on the nav bar. Some config improvement
includes fixing the validation error when inputting empty string, and add title validation function.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Branding config structure change and renaming (#793)

Change the branding related config to a map structure in the yml file.
Also rename the configs according to the official branding guidelines.
The full logo on the main page header will be called logo; the small
logo icon will be called mark.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Darkmode configurations for header logo, welcome logo and loading logo (#797)

Add dark mode configs in the yml file that allows user to configure a
dark mode version of the logo. When user toggles dark mode under the
Advanced Setting, the logo will be rendered accordingly.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Add favicon configuration (#801)

Added a configuration on favicon inside opensearchDashboards.branding
in the yml file. If user inputs a valid URL, we gurantee basic browser
favicon customization, while remaining places show the default browser/device
favicon icon. If user does not provide a valid URL for favicon, the
opensearch favicon icon will be used.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Make home page primary dashboard card logo and title configurable (#809)

Home page dashboard card logo and title can be customized by config
mark.defaultUrl and mark.darkModeUrl. Unit test and functional test
are also written.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Side menu logo configuration

Make logo for opensearch dashboard side menu be configurable.
Use config mark.defaultUrl and mark.darkModeUrl.

Signed-off-by: Abby Hu <[email protected]>

* Overview Header Logo Configuration

Make logo for opensearch dashboard overview header logo be configurable.
Use config mark.defaultUrl and mark.darkModeUrl.

Signed-off-by: Abby Hu <[email protected]>

* Redirect URL not allowed

Add an addtional parameter to the checkUrlValid function
so that max redirect count is 0. We do not allow URLs that
can be redirected because of potential security issues.

Signed-off-by: Abby Hu <[email protected]>

* Store default opensearch branding asset folder

Store the original opensearch branding logos in an asset folder,
instead of making API calls.

Signed-off-by: Abby Hu <[email protected]>

* [Branding] handle comments from PR

Handling the helper function rename and grammar issues.

To avoid risk, we will not remove the duplicate code for 1.2 and
everything related to those comments (ie function renames).

That will be handled in 1.3. Here is the issue tracking it:

#895

Signed-off-by: Kawika Avilla <[email protected]>

Co-authored-by: Kawika Avilla <[email protected]>

Backport PR:
#897

Co-authored-by: Qingyang(Abby) Hu <[email protected]>
seanneumann pushed a commit that referenced this pull request Nov 2, 2021
* Make top left logo on the main screen configurable

Add a new config opensearchDashboards.branding.logoUrl in yaml file
for making top left corner logo on the main screen configurable. If
URL is invalid, the default OpenSearch logo will be shown.

Signed-off-by: Abby Hu <[email protected]>

* Welcome page title and logo configurable (#738)

Add two new configs branding.smallLogoUrl and branding.title
in the yaml file for making the welcome page logo and title
 configurable. If URL is invalid, the default branding will be shown.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Make loading page logo and title configurable (#746)

Add one new config branding.loadingLogoUrl for making loading page logo
configurable. URL can be in svg and gif format. If no loading logo is found,
the static logo with a horizontal bar loading bar will be shown. If logo is also
not found, the default OpenSearch loading logo and spinner will be shown.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Branding configs rename and improvement (#771)

Change config smallLogoUrl to logoUrl, config logoUrl to fullLogoUrl to emphasize that thumbnail version
of the logo will be used mostly in the application. Full version of the logo will only be used on the main
page nav bar. If full logo is not provided, thumbnail logo will be used on the nav bar. Some config improvement
includes fixing the validation error when inputting empty string, and add title validation function.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Branding config structure change and renaming (#793)

Change the branding related config to a map structure in the yml file.
Also rename the configs according to the official branding guidelines.
The full logo on the main page header will be called logo; the small
logo icon will be called mark.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Darkmode configurations for header logo, welcome logo and loading logo (#797)

Add dark mode configs in the yml file that allows user to configure a
dark mode version of the logo. When user toggles dark mode under the
Advanced Setting, the logo will be rendered accordingly.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Add favicon configuration (#801)

Added a configuration on favicon inside opensearchDashboards.branding
in the yml file. If user inputs a valid URL, we gurantee basic browser
favicon customization, while remaining places show the default browser/device
favicon icon. If user does not provide a valid URL for favicon, the
opensearch favicon icon will be used.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Make home page primary dashboard card logo and title configurable (#809)

Home page dashboard card logo and title can be customized by config
mark.defaultUrl and mark.darkModeUrl. Unit test and functional test
are also written.

Signed-off-by: Qingyang(Abby) Hu <[email protected]>

* Side menu logo configuration

Make logo for opensearch dashboard side menu be configurable.
Use config mark.defaultUrl and mark.darkModeUrl.

Signed-off-by: Abby Hu <[email protected]>

* Overview Header Logo Configuration

Make logo for opensearch dashboard overview header logo be configurable.
Use config mark.defaultUrl and mark.darkModeUrl.

Signed-off-by: Abby Hu <[email protected]>

* Redirect URL not allowed

Add an addtional parameter to the checkUrlValid function
so that max redirect count is 0. We do not allow URLs that
can be redirected because of potential security issues.

Signed-off-by: Abby Hu <[email protected]>

* Store default opensearch branding asset folder

Store the original opensearch branding logos in an asset folder,
instead of making API calls.

Signed-off-by: Abby Hu <[email protected]>

* [Branding] handle comments from PR

Handling the helper function rename and grammar issues.

To avoid risk, we will not remove the duplicate code for 1.2 and
everything related to those comments (ie function renames).

That will be handled in 1.3. Here is the issue tracking it:

#895

Signed-off-by: Kawika Avilla <[email protected]>

Co-authored-by: Kawika Avilla <[email protected]>

Backport PR:
#897

Co-authored-by: Qingyang(Abby) Hu <[email protected]>
@abbyhu2000 abbyhu2000 deleted the branding_dev_p0_darkmode_configuration branch August 3, 2022 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants