(annotations map[string]string)
| 927 | } |
| 928 | |
| 929 | func 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 | |
| 956 | func virtualFilePathForManagedReport(name string) string { |
| 957 | return path.Join("reports", name+".yaml") |
no outgoing calls
no test coverage detected