Skip to content

Commit

Permalink
Add filter map in info
Browse files Browse the repository at this point in the history
Signed-off-by: Arnob kumar saha <[email protected]>
  • Loading branch information
ArnobKumarSaha committed Jan 8, 2025
1 parent 167c4b3 commit 00d0e55
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
15 changes: 15 additions & 0 deletions apis/meta/v1alpha1/openapi_generated.go

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

1 change: 1 addition & 0 deletions apis/meta/v1alpha1/resourcelayout_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ type PageBlockLayout struct {
View *PageBlockTableDefinition `json:"view,omitempty"`

RequiredFeatureSets map[string]FeatureList `json:"requiredFeatureSets,omitempty"`
Filter map[string]bool `json:"filter,omitempty"`
}

type FeatureList []string
Expand Down
7 changes: 7 additions & 0 deletions apis/meta/v1alpha1/zz_generated.deepcopy.go

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

20 changes: 20 additions & 0 deletions crds/meta.k8s.appscode.com_resourcelayouts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ spec:
type: string
fieldPath:
type: string
filter:
additionalProperties:
type: boolean
type: object
icons:
items:
description: ImageSpec contains information about an image used
Expand Down Expand Up @@ -300,6 +304,10 @@ spec:
type: string
fieldPath:
type: string
filter:
additionalProperties:
type: boolean
type: object
icons:
items:
description: ImageSpec contains information about
Expand Down Expand Up @@ -571,6 +579,10 @@ spec:
type: string
fieldPath:
type: string
filter:
additionalProperties:
type: boolean
type: object
icons:
items:
description: ImageSpec contains information about
Expand Down Expand Up @@ -815,6 +827,10 @@ spec:
type: string
fieldPath:
type: string
filter:
additionalProperties:
type: boolean
type: object
icons:
items:
description: ImageSpec contains information about
Expand Down Expand Up @@ -1096,6 +1112,10 @@ spec:
type: string
fieldPath:
type: string
filter:
additionalProperties:
type: boolean
type: object
icons:
items:
description: ImageSpec contains information about an image used
Expand Down
12 changes: 12 additions & 0 deletions pkg/layouts/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,18 @@ func GetResourceLayout(kc client.Client, outline *rsapi.ResourceOutline) (*rsapi
}
section.Info = &tables[0]
}
if page.Name == HomePage && sectionFilter.Info != nil {
if section.Info == nil {
section.Info = &rsapi.PageBlockLayout{}
}
section.Info.Filter = make(map[string]bool, len(sectionFilter.Info)-1)
for typ, show := range sectionFilter.Info {
if typ == "basic" {
continue
}
section.Info.Filter[typ] = show
}
}
if sectionOutline.Insight != nil && sectionFilter.Insight {
tables, err := FlattenPageBlockOutline(kc, src, *sectionOutline.Insight, rsapi.Field)
if err != nil {
Expand Down

0 comments on commit 00d0e55

Please sign in to comment.