Skip to content

Commit

Permalink
Add required features support in layout (#383)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha authored Nov 7, 2023
1 parent f83b3e9 commit dd2e529
Show file tree
Hide file tree
Showing 8 changed files with 174 additions and 8 deletions.
44 changes: 44 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.

4 changes: 4 additions & 0 deletions apis/meta/v1alpha1/resourcelayout_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,12 @@ type PageBlockLayout struct {
Actions *ResourceActions `json:"actions,omitempty"`

View *PageBlockTableDefinition `json:"view,omitempty"`

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

type FeatureList []string

type PageBlockTableDefinition struct {
Columns []ResourceColumnDefinition `json:"columns,omitempty"`
}
Expand Down
1 change: 1 addition & 0 deletions apis/meta/v1alpha1/resourceoutline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ type PageBlockOutline struct {
DisplayMode ResourceDisplayMode `json:"displayMode,omitempty"`
Actions *ResourceActions `json:"actions,omitempty"`
View *ResourceTableDefinitionRef `json:"view,omitempty"`
RequiredFeatureSets map[string]FeatureList `json:"requiredFeatureSets,omitempty"`
}

type ResourceTableDefinitionRef struct {
Expand Down
50 changes: 50 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.

6 changes: 6 additions & 0 deletions crds/meta.k8s.appscode.com_resourceblockdefinitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ spec:
- group
- kind
type: object
requiredFeatureSets:
additionalProperties:
items:
type: string
type: array
type: object
view:
properties:
columns:
Expand Down
30 changes: 30 additions & 0 deletions crds/meta.k8s.appscode.com_resourcelayouts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ spec:
- group
- kind
type: object
requiredFeatureSets:
additionalProperties:
items:
type: string
type: array
type: object
view:
properties:
columns:
Expand Down Expand Up @@ -373,6 +379,12 @@ spec:
- group
- kind
type: object
requiredFeatureSets:
additionalProperties:
items:
type: string
type: array
type: object
view:
properties:
columns:
Expand Down Expand Up @@ -637,6 +649,12 @@ spec:
- group
- kind
type: object
requiredFeatureSets:
additionalProperties:
items:
type: string
type: array
type: object
view:
properties:
columns:
Expand Down Expand Up @@ -874,6 +892,12 @@ spec:
- group
- kind
type: object
requiredFeatureSets:
additionalProperties:
items:
type: string
type: array
type: object
view:
properties:
columns:
Expand Down Expand Up @@ -1140,6 +1164,12 @@ spec:
- group
- kind
type: object
requiredFeatureSets:
additionalProperties:
items:
type: string
type: array
type: object
view:
properties:
columns:
Expand Down
30 changes: 30 additions & 0 deletions crds/meta.k8s.appscode.com_resourceoutlines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ spec:
- group
- kind
type: object
requiredFeatureSets:
additionalProperties:
items:
type: string
type: array
type: object
view:
properties:
columns:
Expand Down Expand Up @@ -462,6 +468,12 @@ spec:
- group
- kind
type: object
requiredFeatureSets:
additionalProperties:
items:
type: string
type: array
type: object
view:
properties:
columns:
Expand Down Expand Up @@ -728,6 +740,12 @@ spec:
- group
- kind
type: object
requiredFeatureSets:
additionalProperties:
items:
type: string
type: array
type: object
view:
properties:
columns:
Expand Down Expand Up @@ -967,6 +985,12 @@ spec:
- group
- kind
type: object
requiredFeatureSets:
additionalProperties:
items:
type: string
type: array
type: object
view:
properties:
columns:
Expand Down Expand Up @@ -1235,6 +1259,12 @@ spec:
- group
- kind
type: object
requiredFeatureSets:
additionalProperties:
items:
type: string
type: array
type: object
view:
properties:
columns:
Expand Down
17 changes: 9 additions & 8 deletions pkg/layouts/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,15 @@ func Convert_PageBlockOutline_To_PageBlockLayout(
}

result := v1alpha1.PageBlockLayout{
Kind: in.Kind,
Name: in.Name,
Width: in.Width,
Icons: in.Icons,
FieldPath: in.FieldPath,
ResourceLocator: in.ResourceLocator,
DisplayMode: in.DisplayMode,
Actions: in.Actions,
Kind: in.Kind,
Name: in.Name,
Width: in.Width,
Icons: in.Icons,
FieldPath: in.FieldPath,
ResourceLocator: in.ResourceLocator,
DisplayMode: in.DisplayMode,
Actions: in.Actions,
RequiredFeatureSets: in.RequiredFeatureSets,
}
if len(columns) > 0 {
result.View = &v1alpha1.PageBlockTableDefinition{
Expand Down

0 comments on commit dd2e529

Please sign in to comment.