From fbca056ad8d28c66355a9de86ac7c207da127674 Mon Sep 17 00:00:00 2001 From: Brian Gibbon Date: Mon, 5 Feb 2024 21:37:13 +0000 Subject: [PATCH] Add label to DisplayOutput --- cli/Makefile | 2 +- cli/bpmetadata/bpmetadata_ui.pb.go | 30 +++++++++++++------ cli/bpmetadata/proto/bpmetadata_ui.proto | 8 +++-- .../schema/gcp-blueprint-metadata.json | 3 ++ 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/cli/Makefile b/cli/Makefile index 4fcc39c32448..83d0b8e34e5f 100644 --- a/cli/Makefile +++ b/cli/Makefile @@ -1,7 +1,7 @@ SHELL := /bin/bash # Changing this value will trigger a new release -VERSION=v1.2.15 +VERSION=v1.2.16 BINARY=bin/cft GITHUB_REPO=github.com/GoogleCloudPlatform/cloud-foundation-toolkit PLATFORMS := linux windows darwin diff --git a/cli/bpmetadata/bpmetadata_ui.pb.go b/cli/bpmetadata/bpmetadata_ui.pb.go index c17b88cb7f2c..b69f5e15bba8 100644 --- a/cli/bpmetadata/bpmetadata_ui.pb.go +++ b/cli/bpmetadata/bpmetadata_ui.pb.go @@ -679,7 +679,7 @@ type UIActionItem struct { // Gen: manually-authored Snippet string `protobuf:"bytes,3,opt,name=snippet,proto3" json:"snippet,omitempty" yaml:"snippet,omitempty"` // @gotags: json:"snippet,omitempty" yaml:"snippet,omitempty" // If present, this expression determines whether the item is shown. - // Should be in the form of a Boolean expression e.g. outputs().hasExternalIP + // Should be in the form of a Boolean expression e.g. outputs.hasExternalIP // where `externalIP` is the output. // Gen: manually-authored ShowIf string `protobuf:"bytes,4,opt,name=show_if,json=showIf,proto3" json:"showIf,omitempty" yaml:"showIf,omitempty"` // @gotags: json:"showIf,omitempty" yaml:"showIf,omitempty" @@ -746,7 +746,7 @@ func (x *UIActionItem) GetShowIf() string { } // Additional display specific metadata pertaining to a particular -// Terraform output. +// Terraform output. Only applicable for Outputs that are URLs. type DisplayOutput struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -760,6 +760,9 @@ type DisplayOutput struct { // notification for the deployment. // Gen: manually-authored ShowInNotification bool `protobuf:"varint,2,opt,name=show_in_notification,json=showInNotification,proto3" json:"showInNotification,omitempty" yaml:"showInNotification,omitempty"` // @gotags: json:"showInNotification,omitempty" yaml:"showInNotification,omitempty" + // label to display on the Output action button + // Gen: manually-authored + Label string `protobuf:"bytes,3,opt,name=label,proto3" json:"label,omitempty" yaml:"label,omitEmpty"` // @gotags: json:"label,omitempty" yaml:"label,omitEmpty" } func (x *DisplayOutput) Reset() { @@ -808,6 +811,13 @@ func (x *DisplayOutput) GetShowInNotification() bool { return false } +func (x *DisplayOutput) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + var File_bpmetadata_ui_proto protoreflect.FileDescriptor var file_bpmetadata_ui_proto_rawDesc = []byte{ @@ -932,18 +942,20 @@ var file_bpmetadata_ui_proto_rawDesc = []byte{ 0x07, 0x73, 0x6e, 0x69, 0x70, 0x70, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x6e, 0x69, 0x70, 0x70, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x69, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x68, 0x6f, 0x77, 0x49, 0x66, - 0x22, 0x68, 0x0a, 0x0d, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4f, 0x75, 0x74, 0x70, 0x75, + 0x22, 0x7e, 0x0a, 0x0d, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x25, 0x0a, 0x0f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x69, 0x6e, 0x5f, 0x6e, 0x65, 0x77, 0x5f, 0x74, 0x61, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6f, 0x70, 0x65, 0x6e, 0x49, 0x6e, 0x4e, 0x65, 0x77, 0x54, 0x61, 0x62, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x69, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x73, 0x68, 0x6f, 0x77, 0x49, 0x6e, 0x4e, 0x6f, - 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x43, - 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x2d, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2d, 0x74, 0x6f, - 0x6f, 0x6c, 0x6b, 0x69, 0x74, 0x2f, 0x63, 0x6c, 0x69, 0x2f, 0x62, 0x70, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, + 0x72, 0x6d, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2d, 0x74, 0x6f, 0x6f, 0x6c, 0x6b, 0x69, 0x74, 0x2f, 0x63, 0x6c, 0x69, 0x2f, + 0x62, 0x70, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/cli/bpmetadata/proto/bpmetadata_ui.proto b/cli/bpmetadata/proto/bpmetadata_ui.proto index b17b41433b7c..d4d4a834388e 100644 --- a/cli/bpmetadata/proto/bpmetadata_ui.proto +++ b/cli/bpmetadata/proto/bpmetadata_ui.proto @@ -226,14 +226,14 @@ message UIActionItem { string snippet = 3; // @gotags: json:"snippet,omitempty" yaml:"snippet,omitempty" // If present, this expression determines whether the item is shown. - // Should be in the form of a Boolean expression e.g. outputs().hasExternalIP + // Should be in the form of a Boolean expression e.g. outputs.hasExternalIP // where `externalIP` is the output. // Gen: manually-authored string show_if = 4; // @gotags: json:"showIf,omitempty" yaml:"showIf,omitempty" } // Additional display specific metadata pertaining to a particular -// Terraform output. +// Terraform output. Only applicable for Outputs that are URLs. message DisplayOutput { // open_in_new_tab defines if the Output action should be opened // in a new tab. @@ -244,4 +244,8 @@ message DisplayOutput { // notification for the deployment. // Gen: manually-authored bool show_in_notification = 2; // @gotags: json:"showInNotification,omitempty" yaml:"showInNotification,omitempty" + + // label to display on the Output action button + // Gen: manually-authored + string label = 3; // @gotags: json:"label,omitempty" yaml:"label,omitEmpty" } diff --git a/cli/bpmetadata/schema/gcp-blueprint-metadata.json b/cli/bpmetadata/schema/gcp-blueprint-metadata.json index e1d86a3db9a4..2c9ea851b1e8 100644 --- a/cli/bpmetadata/schema/gcp-blueprint-metadata.json +++ b/cli/bpmetadata/schema/gcp-blueprint-metadata.json @@ -652,6 +652,9 @@ }, "showInNotification": { "type": "boolean" + }, + "label": { + "type": "string" } }, "additionalProperties": false,