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

Add search index to generated configmap #205

Merged
merged 6 commits into from
Oct 25, 2024
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ artifacts/
# IDE extras
.vscode/
build/.build_venv

kuttl-report.json
21 changes: 11 additions & 10 deletions api/v1alpha1/frontend_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,19 @@ type SearchEntry struct {
Href string `json:"href" yaml:"href"`
Title string `json:"title" yaml:"title"`
Description string `json:"description" yaml:"description"`
AltTitle []string `json:"alt_title" yaml:"alt_title"`
IsExternal bool `json:"isExternal" yaml:"isExternal"`
AltTitle []string `json:"alt_title,omitempty" yaml:"alt_title,omitempty"`
IsExternal bool `json:"isExternal,omitempty" yaml:"isExternal,omitempty"`
}

type ServiceTile struct {
Section string `json:"section" yaml:"section"`
Group string `json:"group" yaml:"group"`
ID string `json:"id" yaml:"id"`
Href string `json:"href" yaml:"href"`
Title string `json:"title" yaml:"title"`
Icon string `json:"icon" yaml:"icon"`
IsExternal bool `json:"isExternal,omitempty" yaml:"isExternal,omitempty"`
Section string `json:"section" yaml:"section"`
Group string `json:"group" yaml:"group"`
ID string `json:"id" yaml:"id"`
Href string `json:"href" yaml:"href"`
Title string `json:"title" yaml:"title"`
Description string `json:"description" yaml:"description"`
Icon string `json:"icon" yaml:"icon"`
IsExternal bool `json:"isExternal,omitempty" yaml:"isExternal,omitempty"`
}

type WidgetHeaderLink struct {
Expand Down Expand Up @@ -97,7 +98,7 @@ type FrontendSpec struct {
EnvName string `json:"envName" yaml:"envName"`
Title string `json:"title" yaml:"title"`
DeploymentRepo string `json:"deploymentRepo" yaml:"deploymentRepo"`
API APIInfo `json:"API" yaml:"API"`
API *APIInfo `json:"API,omitempty" yaml:"API,omitempty"`
Frontend FrontendInfo `json:"frontend" yaml:"frontend"`
Image string `json:"image,omitempty" yaml:"image,omitempty"`
Service string `json:"service,omitempty" yaml:"service,omitempty"`
Expand Down
29 changes: 29 additions & 0 deletions api/v1alpha1/frontendenvironment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,33 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
)

type FrontendServiceCategoryGroup struct {
ID string `json:"id" yaml:"id"`
Title string `json:"title" yaml:"title"`
}

// FrontendServiceCategory defines the category to which service can inject ServiceTiles
// Chroming UI will use this to render the service dropdown component
type FrontendServiceCategory struct {
ID string `json:"id" yaml:"id"`
Title string `json:"title" yaml:"title"`
// +kubebuilder:validation:items:MinItems:=1
Groups []FrontendServiceCategoryGroup `json:"groups" yaml:"groups"`
}

type FrontendServiceCategoryGroupGenerated struct {
ID string `json:"id" yaml:"id"`
Title string `json:"title" yaml:"title"`
Tiles *[]ServiceTile `json:"tiles" yaml:"tiles"`
}

// The categories but with the groups filled with service tiles
type FrontendServiceCategoryGenerated struct {
ID string `json:"id" yaml:"id"`
Title string `json:"title" yaml:"title"`
Groups []FrontendServiceCategoryGroupGenerated `json:"groups" yaml:"groups"`
}

// FrontendEnvironmentSpec defines the desired state of FrontendEnvironment
type FrontendEnvironmentSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
Expand Down Expand Up @@ -65,6 +92,8 @@ type FrontendEnvironmentSpec struct {
// List of namespaces that should receive a copy of the frontend configuration as a config map
// By configurations we mean the fed-modules.json, navigation files, etc.
TargetNamespaces []string `json:"targetNamespaces,omitempty" yaml:"targetNamespaces,omitempty"`
// For the ChromeUI to render additional global components
ServiceCategories *[]FrontendServiceCategory `json:"serviceCategories,omitempty" yaml:"serviceCategories,omitempty"`
}

type MonitoringConfig struct {
Expand Down
98 changes: 97 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

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

29 changes: 29 additions & 0 deletions config/crd/bases/cloud.redhat.com_frontendenvironments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,35 @@ spec:
- disabled
- mode
type: object
serviceCategories:
description: For the ChromeUI to render additional global components
items:
description: |-
FrontendServiceCategory defines the category to which service can inject ServiceTiles
Chroming UI will use this to render the service dropdown component
properties:
groups:
items:
properties:
id:
type: string
title:
type: string
required:
- id
- title
type: object
type: array
id:
type: string
title:
type: string
required:
- groups
- id
- title
type: object
type: array
ssl:
description: |-
SSL mode requests SSL from the services in openshift and k8s and then applies them to the
Expand Down
6 changes: 3 additions & 3 deletions config/crd/bases/cloud.redhat.com_frontends.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,9 @@ spec:
title:
type: string
required:
- alt_title
- description
- href
- id
- isExternal
- title
type: object
type: array
Expand All @@ -345,6 +343,8 @@ spec:
description: Data for the all services dropdown
items:
properties:
description:
type: string
group:
type: string
href:
Expand All @@ -360,6 +360,7 @@ spec:
title:
type: string
required:
- description
- group
- href
- icon
Expand Down Expand Up @@ -493,7 +494,6 @@ spec:
type: object
type: array
required:
- API
- deploymentRepo
- envName
- frontend
Expand Down
Loading
Loading