MCPcopy Create free account
hub / github.com/rilldata/rill / parseReportAnnotations

Function parseReportAnnotations

admin/server/reports.go:929–954  ·  view source on GitHub ↗
(annotations map[string]string)

Source from the content-addressed store, hash-verified

927}
928
929func parseReportAnnotations(annotations map[string]string) reportAnnotations {
930 if annotations == nil {
931 return reportAnnotations{}
932 }
933
934 res := reportAnnotations{}
935 res.AdminOwnerUserID = annotations["admin_owner_user_id"]
936 res.AdminManaged, _ = strconv.ParseBool(annotations["admin_managed"])
937 res.AdminNonce = annotations["admin_nonce"]
938 res.WebOpenPath = annotations["web_open_path"]
939 res.WebOpenState = annotations["web_open_state"]
940 res.Explore = annotations["explore"]
941 res.Canvas = annotations["canvas"]
942 switch annotations["web_open_mode"] {
943 case "recipient":
944 res.WebOpenMode = WebOpenModeRecipient
945 case "creator":
946 res.WebOpenMode = WebOpenModeCreator
947 case "none":
948 res.WebOpenMode = WebOpenModeNone
949 case "": // backwards compatibility
950 res.WebOpenMode = WebOpenModeRecipient
951 }
952
953 return res
954}
955
956func virtualFilePathForManagedReport(name string) string {
957 return path.Join("reports", name+".yaml")

Callers 4

EditReportMethod · 0.85
UnsubscribeReportMethod · 0.85
DeleteReportMethod · 0.85
TriggerReportMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected