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

Custom Branding #826

Merged
merged 13 commits into from
Nov 1, 2021
Merged

Custom Branding #826

merged 13 commits into from
Nov 1, 2021

Conversation

abbyhu2000
Copy link
Member

Description

This PR is proposing a way for users to customize OpenSearch Dashboard using opensearch_dashboards.yml file and starting with predefined list of titles and logos. Our initial target users will be the cluster administrator who has access to the opensearch_dashboards.yml file and who is able to configure the application before it is hosted. This is a starting point and foundation for a bigger effort of branding and theming configurations in the future.

Added Configurations in opensearch_dashboards.yml file

Screen Shot 2021-09-28 at 11 07 12 AM

Targeted Logo and Title(7 logos and 4 titles)

Screen Shot 2021-09-28 at 11 09 50 AM

Config Details

  1. mark.defaultUrl (L1 - L6): simple one step branding configurations; if no other config are provided, a valid URL for mark.defaultUrl config will be rendered all 6 logo occurrences; if not provided, original opensearch logos will be rendered
  2. logo.defaultUrl (L5): added option for user to display a fuller logo on the navigation bar; if not provided, fall back to mark.defaultUrl
  3. loadingLogo.defaultUrl (L2): added option for user to display a custom loading logo on the loading page; if provided, render the custom loading logo; if not, fall back to mark.defaultUrl and render the static mark with a loading bar
  4. mark.darkModeUrl, logo.darkModeUrl, loadingLogo.darkModeUrl: added option for user to configure logo in both default settings and dark mode settings; if darkModeUrl not provided, fall back to defaultUrl
  5. faviconUrl (L7): basic browser favicon configuration(Chrome, Firefox, Edge and Safari); advanced favicon configurations(Windows Title, Android Device icon) are not supported
  6. applicationTitle (T1 - T4): replace "OpenSearch Dashboards" with a custom title

URL requirements

  1. For image URLs, only svg, png, and gif file types are allowed; any image size is permitted, but will be formatted to certain size for best appearance
  2. If user inputs invalid URL, log will display a info message
  3. If user inputs dark mode URLs without providing a valid default mode URLs, log will display a error message; dark mode URLs can only be considered after having valid default mode URLs
  4. For config applicationTitle, length of the input string needs to be between 1 and 36 letters.

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

Issues Resolved

#725

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 4becb18

@abbyhu2000
Copy link
Member Author

Screen Shot 2021-09-28 at 3 58 51 PM

@opensearch-ci-bot
Copy link
Collaborator

✅   DCO Check Passed b2e6656

@opensearch-ci-bot
Copy link
Collaborator

✅   DCO Check Passed d282803

@kavilla kavilla force-pushed the feature/branding/p0 branch from d282803 to 11f90a9 Compare October 15, 2021 01:29
@opensearch-ci-bot
Copy link
Collaborator

✅   DCO Check Passed 11f90a9

kavilla
kavilla previously approved these changes Oct 15, 2021
ananzh
ananzh previously approved these changes Oct 15, 2021
Copy link
Member

@ananzh ananzh left a comment

Choose a reason for hiding this comment

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

nice job Abby

@ananzh ananzh added the v1.2.0 label Oct 15, 2021
@abbyhu2000
Copy link
Member Author

This feature has been tested with version upgrade from opendistro version 1.13.2, as part of the backward compatibility test.

boktorbb
boktorbb previously approved these changes Oct 21, 2021
Copy link
Contributor

@boktorbb boktorbb left a comment

Choose a reason for hiding this comment

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

Very nice work!

kgcreative
kgcreative previously approved these changes Oct 22, 2021
Copy link
Member

@kgcreative kgcreative left a comment

Choose a reason for hiding this comment

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

Great work!

Copy link
Contributor

@tmarkley tmarkley left a comment

Choose a reason for hiding this comment

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

Great work! I think we can reduce some duplication here and clean up the comments/documentation.

* Use branding configurations to render the header logo on the nab bar.
*
* @param {ChromeBranding} - branding object consist of logo, mark and title
* @returns A image component which is going to be rendered on the main page header bar.
Copy link
Contributor

Choose a reason for hiding this comment

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

Grammar: An image. This doesn't always return an image component (e.g. when there is a custom logo) so I think we need to adjust this wording.

Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: My initial thought is that the component should be called CustomBrandingLogo but I don't have a strong preference. I think it adds some specificity and ties it to the set of Custom Branding features.

Additionally, this component could be used elsewhere and not just in the main page header bar, so we can probably remove which is going to be rendered on the main page header bar.


/**
* Use branding configurations to check which URL to use for rendering
* header logo in nav bar in default mode
Copy link
Contributor

Choose a reason for hiding this comment

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

We can remove the reference of nav bar in this component because it could be used elsewhere. The component's responsibility does not include understanding where it's utilized across the application.

Comment on lines 81 to 84
if (darkMode) {
return customHeaderLogoDarkMode();
}
return customHeaderLogoDefaultMode();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: use a ternary with a single return instead?

*
* @returns a valid custom URL or undefined if no valid URL is provided
*/
const customHeaderLogoDefaultMode = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think we can remove Header from the names of these functions.

src/core/server/rendering/rendering_service.tsx Outdated Show resolved Hide resolved
src/core/server/rendering/rendering_service.tsx Outdated Show resolved Hide resolved
Comment on lines 106 to 137
/**
* Use branding configurations to check which URL to use for rendering
* loading logo in default mode. In default mode, loading logo will
* proritize default loading logo URL, and then default mark URL.
* If both are invalid, default opensearch logo and spinner will be rendered.
*
* @returns a valid custom URL or undefined if no valid URL is provided
*/
const customLoadingLogoDefaultMode = () => {
return loadingLogoDefault ?? markDefault ?? undefined;
};

/**
* Use branding configurations to check which URL to use for rendering
* loading logo in default mode. In dark mode, loading logo will proritize
* loading logo URLs, then mark logo URLs.
* Within each type, the dark mode URL will be proritized if provided.
*
* @returns a valid custom URL or undefined if no valid URL is provided
*/
const customLoadingLogoDarkMode = () => {
return loadingLogoDarkMode ?? loadingLogoDefault ?? markDarkMode ?? markDefault ?? undefined;
};

/**
* Render custom loading logo for both default mode and dark mode
*
* @returns a valid custom loading logo URL, or undefined
*/
const customLoadingLogo = () => {
if (darkMode) {
return customLoadingLogoDarkMode();
}
return customLoadingLogoDefaultMode();
};
Copy link
Contributor

Choose a reason for hiding this comment

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

This is also duplicate code.

Comment on lines 60 to 95
/**
* Use branding configurations to check which URL to use for rendering
* home card logo in default mode. In default mode, home card logo will
* proritize default mode mark URL. If it is invalid, default opensearch logo
* will be rendered.
*
* @param {HomePluginBranding} - pass in custom branding configurations
* @returns a valid custom URL or undefined if no valid URL is provided
*/
const customHomeLogoDefaultMode = (branding: HomePluginBranding) => {
return branding.mark?.defaultUrl ?? undefined;
};

/**
* Use branding configurations to check which URL to use for rendering
* home logo in dark mode. In dark mode, home logo will render
* dark mode mark URL if valid. Otherwise, it will render the default
* mode mark URL if valid. If both dark mode mark URL and default mode mark
* URL are invalid, the default opensearch logo will be rendered.
*
* @param {HomePluginBranding} - pass in custom branding configurations
* @returns {string|undefined} a valid custom URL or undefined if no valid URL is provided
*/
const customHomeLogoDarkMode = (branding: HomePluginBranding) => {
return branding.mark?.darkModeUrl ?? branding.mark?.defaultUrl ?? undefined;
};

/**
* Render custom home logo for both default mode and dark mode
*
* @param {HomePluginBranding} - pass in custom branding configurations
* @returns {string|undefined} a valid custom loading logo URL, or undefined
*/
const customHomeLogo = (branding: HomePluginBranding) => {
if (branding.darkMode) {
return customHomeLogoDarkMode(branding);
}
return customHomeLogoDefaultMode(branding);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

This should also take advantage of a generic CustomBrandingLogo component

Comment on lines 87 to 119
/**
* Use branding configurations to check which URL to use for rendering
* overview logo in default mode. In default mode, overview logo will
* proritize default mode mark URL. If it is invalid, default opensearch logo
* will be rendered.
*
* @returns a valid custom URL or undefined if no valid URL is provided
*/
const customOverviewLogoDefaultMode = () => {
return markDefault ?? DEFAULT_OPENSEARCH_MARK;
};

/**
* Use branding configurations to check which URL to use for rendering
* overview logo in dark mode. In dark mode, overview logo will render
* dark mode mark URL if valid. Otherwise, it will render the default
* mode mark URL if valid. If both dark mode mark URL and default mode mark
* URL are invalid, the default opensearch logo will be rendered.
*
* @returns a valid custom URL or undefined if no valid URL is provided
*/
const customOverviewLogoDarkMode = () => {
return markDarkMode ?? markDefault ?? DARKMODE_OPENSEARCH_MARK;
};

/**
* Render custom overview logo for both default mode and dark mode
*
* @returns a valid custom loading logo URL, or undefined
*/
const customOverviewLogo = () => {
if (darkMode) {
return customOverviewLogoDarkMode();
}
return customOverviewLogoDefaultMode();
};
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

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]>
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]>
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]>
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]>
abbyhu2000 and others added 9 commits October 30, 2021 02:32
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]>
#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]>
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]>
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]>
Make logo for opensearch dashboard side menu be configurable.
Use config mark.defaultUrl and mark.darkModeUrl.

Signed-off-by: Abby Hu <[email protected]>
Make logo for opensearch dashboard overview header logo be configurable.
Use config mark.defaultUrl and mark.darkModeUrl.

Signed-off-by: Abby Hu <[email protected]>
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 the original opensearch branding logos in an asset folder,
instead of making API calls.

Signed-off-by: Abby Hu <[email protected]>
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]>
@kavilla kavilla force-pushed the feature/branding/p0 branch from e1deafd to 5edf030 Compare October 30, 2021 02:33
@kavilla kavilla requested a review from tmarkley October 30, 2021 02:33
@kavilla kavilla dismissed tmarkley’s stale review October 30, 2021 02:52

Updates made.


/**
* Use branding configurations to check which URL to use for rendering
* side menu opensearch logo in default mode
Copy link
Contributor

Choose a reason for hiding this comment

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

Note for follow-up changes: use correct cases for OpenSearch

Copy link
Contributor

@tmarkley tmarkley left a comment

Choose a reason for hiding this comment

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

@abbyhu2000 great work, and @kavilla thanks for these updates!

@kavilla kavilla merged commit 9037b61 into main Nov 1, 2021
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]>
@kavilla kavilla deleted the feature/branding/p0 branch January 13, 2022 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Proposal] Initial Custom Branding (local config settings)
7 participants