Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion operator/v1/types_console.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package v1

import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/openshift/api/config/v1"
)

// +genclient
// +genclient:nonNamespaced
Expand Down Expand Up @@ -39,6 +43,21 @@ type ConsoleCustomization struct {
// documentation URL.
// Invalid value will prevent a console rollout.
DocumentationBaseURL string `json:"documentationBaseURL,omitempty"`
// customProductName is the name that will be displayed in page titles, logo alt text, and the about dialog
// instead of the normal OpenShift product name.
// +optional
CustomProductName string `json:"customProductName,omitempty"`
// customLogoFile replaces the default OpenShift logo in the masthead and about dialog. It is a reference to a
// ConfigMap in the openshift-config namespace. This can be created with a command like
// 'oc create configmap custom-logo --from-file=/path/to/file -n openshift-config'.
// Image size must be less than 1 MB due to constraints on the ConfigMap size.
// The ConfigMap key should include a file extension so that the console serves the file
// with the correct MIME type.
// Recommended logo specifications:
// Dimensions: Max height of 68px and max width of 200px
// SVG format preferred
// +optional
Copy link
Member

@spadgett spadgett May 20, 2019

Choose a reason for hiding this comment

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

Maybe

// customLogoFile replaces the default OpenShift logo in the masthead and about dialog. It is a reference to a
// ConfigMap in the openshift-config namespace. This can be created with a command like
// 'oc create configmap custom-logo --from-file=/path/to/logo.svg -n openshift-config'.
// Image size must be less than 1 MB due to constraints on the ConfigMap size.
// The ConfigMap key should include a file extension so that the console serves the file
// with the correct MIME type.
// +optional

Copy link
Member

Choose a reason for hiding this comment

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

We might want to give guidance on recommended dimensions (although I don't know what those are offhand).

Copy link
Member Author

Choose a reason for hiding this comment

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

It looks like we set the viewbox to 100x100 on the SVGs. Should I add that?

Copy link
Member Author

Choose a reason for hiding this comment

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

@spadgett
// Recommended logo is of type svg or logo size of 100px x 100px

Copy link
Member

Choose a reason for hiding this comment

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

100x100 can't be right since the logo is not square.

Maybe we simply say "An SVG logo is recommended, but other image types are supported." and leave it at that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like we should indicate a recommended size, along with svg so its scalable. Our own logos:

https://github.com/openshift/console/blob/master/frontend/public/imgs/openshift-dedicated-logo.svg
https://github.com/openshift/console/blob/master/frontend/public/imgs/openshift-online-logo.svg

Are 40px high, but width is variable, roughly 260px in browser.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

@zherman0 the PatternFly variable --pf-c-page__header-brand-link--c-brand--MaxHeight sets a max-height: 3.75rem which is approximately 68px. So if the image is larger than 68px it will scale down proportionally.

I would say

// Recommended logo specifications: 
// Dimensions: Max height of 68px and max width of 200px
// SVG format preferred

CustomLogoFile v1.ConfigMapFileReference `json:"customLogoFile,omitempty"`
}

// Brand is a specific supported brand within the console
Expand Down
1 change: 1 addition & 0 deletions operator/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions operator/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.