Skip to content

Commit

Permalink
Remove show
Browse files Browse the repository at this point in the history
  • Loading branch information
begelundmuller committed Jan 10, 2025
1 parent 1da78fd commit 313b94e
Show file tree
Hide file tree
Showing 8 changed files with 258 additions and 304 deletions.
526 changes: 258 additions & 268 deletions proto/gen/rill/runtime/v1/resources.pb.go

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions proto/gen/rill/runtime/v1/resources.pb.validate.go

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

3 changes: 0 additions & 3 deletions proto/gen/rill/runtime/v1/runtime.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3896,9 +3896,6 @@ definitions:
$ref: '#/definitions/v1ComponentVariable'
output:
$ref: '#/definitions/v1ComponentVariable'
show:
type: string
description: Templated string that should evaluate to a boolean.
definedInCanvas:
type: boolean
v1ComponentState:
Expand Down
1 change: 0 additions & 1 deletion proto/rill/runtime/v1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,6 @@ message ComponentSpec {
google.protobuf.Struct renderer_properties = 5;
repeated ComponentVariable input = 8;
ComponentVariable output = 9;
string show = 10; // Templated string that should evaluate to a boolean.
bool defined_in_canvas = 6;
}

Expand Down
2 changes: 0 additions & 2 deletions runtime/compilers/rillv1/parse_component.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ type ComponentYAML struct {
Subtitle string `yaml:"subtitle"` // Deprecated: use description
Input []*ComponentVariableYAML `yaml:"input"`
Output *ComponentVariableYAML `yaml:"output"`
Show string `yaml:"show"`
Other map[string]map[string]any `yaml:",inline" mapstructure:",remain"` // Generic renderer: can only have one key
}

Expand Down Expand Up @@ -159,7 +158,6 @@ func (p *Parser) parseComponentYAML(tmp *ComponentYAML) (*runtimev1.ComponentSpe
RendererProperties: rendererProps,
Input: input,
Output: output,
Show: tmp.Show,
}

return spec, refs, nil
Expand Down
18 changes: 0 additions & 18 deletions runtime/server/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package server
import (
"context"
"errors"
"strconv"

runtimev1 "github.com/rilldata/rill/proto/gen/rill/runtime/v1"
"github.com/rilldata/rill/runtime"
Expand Down Expand Up @@ -66,23 +65,6 @@ func (s *Server) ResolveComponent(ctx context.Context, req *runtimev1.ResolveCom
},
}

// Resolve templating in the show property
if spec.Show != "" {
v, err := rillv1.ResolveTemplate(spec.Show, td)
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, "failed to resolve templating in property \"show\": %s", err.Error())
}

show, err := strconv.ParseBool(v)
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, "failed to parse value %q as a bool for property \"show\": %s", v, err.Error())
}

if !show {
return &runtimev1.ResolveComponentResponse{Show: false}, nil
}
}

// Resolve templating in the renderer properties
var rendererProps *structpb.Struct
if spec.RendererProperties != nil {
Expand Down
8 changes: 0 additions & 8 deletions web-common/src/proto/gen/rill/runtime/v1/resources_pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4303,13 +4303,6 @@ export class ComponentSpec extends Message<ComponentSpec> {
*/
output?: ComponentVariable;

/**
* Templated string that should evaluate to a boolean.
*
* @generated from field: string show = 10;
*/
show = "";

/**
* @generated from field: bool defined_in_canvas = 6;
*/
Expand All @@ -4329,7 +4322,6 @@ export class ComponentSpec extends Message<ComponentSpec> {
{ no: 5, name: "renderer_properties", kind: "message", T: Struct },
{ no: 8, name: "input", kind: "message", T: ComponentVariable, repeated: true },
{ no: 9, name: "output", kind: "message", T: ComponentVariable },
{ no: 10, name: "show", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 6, name: "defined_in_canvas", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
]);

Expand Down
2 changes: 0 additions & 2 deletions web-common/src/runtime-client/gen/index.schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2088,8 +2088,6 @@ export interface V1ComponentSpec {
rendererProperties?: V1ComponentSpecRendererProperties;
input?: V1ComponentVariable[];
output?: V1ComponentVariable;
/** Templated string that should evaluate to a boolean. */
show?: string;
definedInCanvas?: boolean;
}

Expand Down

0 comments on commit 313b94e

Please sign in to comment.