Add: job to export in multiple formats#236
Open
Achiket123 wants to merge 6 commits intotheopenlane:mainfrom
Open
Add: job to export in multiple formats#236Achiket123 wants to merge 6 commits intotheopenlane:mainfrom
Achiket123 wants to merge 6 commits intotheopenlane:mainfrom
Conversation
Member
golanglemonade
left a comment
There was a problem hiding this comment.
@Achiket123 can you update the core/common tag here so we can see if ci passes?
Comment on lines
-218
to
+286
| _, err = w.olClient.UpdateExport(ctx, job.Args.ExportID, updateInput, []*graphql.Upload{upload}, goclient.WithImpersonationInterceptor(job.Args.UserID, job.Args.OrganizationID)) | ||
| _, err = w.olClient.UpdateExport(ctx, job.Args.ExportID, updateInput, []*graphql.Upload{upload}) |
Signed-off-by: Achiket Kumar <126181868+Achiket123@users.noreply.github.com>
Signed-off-by: Achiket Kumar <126181868+Achiket123@users.noreply.github.com>
|
Comment on lines
+683
to
+686
| // Add common headers if they exist | ||
| if id, ok := flat["id"]; ok && id != nil { | ||
| buf.WriteString(fmt.Sprintf("<p><strong>ID:</strong> %v</p>\n", id)) | ||
| } |
Member
There was a problem hiding this comment.
I would leave off id
Suggested change
| // Add common headers if they exist | |
| if id, ok := flat["id"]; ok && id != nil { | |
| buf.WriteString(fmt.Sprintf("<p><strong>ID:</strong> %v</p>\n", id)) | |
| } | |
| // Add common headers if they exist |
Comment on lines
+687
to
+695
| if createdAt, ok := flat["created_at"]; ok && createdAt != nil { | ||
| buf.WriteString(fmt.Sprintf("<p><strong>Created At:</strong> %v</p>\n", createdAt)) | ||
| } | ||
| if name, ok := flat["name"]; ok && name != nil { | ||
| buf.WriteString(fmt.Sprintf("<p><strong>Name:</strong> %v</p>\n", name)) | ||
| } | ||
| if status, ok := flat["status"]; ok && status != nil { | ||
| buf.WriteString(fmt.Sprintf("<p><strong>Status:</strong> %v</p>\n", status)) | ||
| } |
Member
There was a problem hiding this comment.
Can we use these:
Suggested change
| if createdAt, ok := flat["created_at"]; ok && createdAt != nil { | |
| buf.WriteString(fmt.Sprintf("<p><strong>Created At:</strong> %v</p>\n", createdAt)) | |
| } | |
| if name, ok := flat["name"]; ok && name != nil { | |
| buf.WriteString(fmt.Sprintf("<p><strong>Name:</strong> %v</p>\n", name)) | |
| } | |
| if status, ok := flat["status"]; ok && status != nil { | |
| buf.WriteString(fmt.Sprintf("<p><strong>Status:</strong> %v</p>\n", status)) | |
| } | |
| if name, ok := flat["name"]; ok && name != nil { | |
| buf.WriteString(fmt.Sprintf("<p><strong>Name:</strong> %v</p>\n", name)) | |
| } | |
| if status, ok := flat["status"]; ok && status != nil { | |
| buf.WriteString(fmt.Sprintf("<p><strong>Status:</strong> %v</p>\n", status)) | |
| } | |
| if updatedAt, ok := flat["updated_at"]; ok && updatedAt != nil { | |
| buf.WriteString(fmt.Sprintf("<p><strong>Last Updated At:</strong> %v</p>\n", createdAt)) | |
| } | |
| if updatedBy, ok := flat["updated_by"]; ok && updatedBy != nil { | |
| buf.WriteString(fmt.Sprintf("<p><strong>LastUpdatedBy By:</strong> %v</p>\n", createdAt)) | |
| } | |
| if revision, ok := flat["revision"]; ok && revision != nil { | |
| buf.WriteString(fmt.Sprintf("<p><strong>Version:</strong> %v</p>\n", createdAt)) | |
| } |
| if !strings.Contains(str, "<p>") && !strings.Contains(str, "<div>") && !strings.Contains(str, "<br") { | ||
| str = strings.ReplaceAll(str, "\n", "<br/>\n") | ||
| } | ||
| buf.WriteString(fmt.Sprintf("<div><strong>Summary:</strong><br/>\n%s</div>\n", str)) |
Member
There was a problem hiding this comment.
No need for a header here
Suggested change
| buf.WriteString(fmt.Sprintf("<div><strong>Summary:</strong><br/>\n%s</div>\n", str)) | |
| buf.WriteString(fmt.Sprintf("<div>%s</div>\n", str)) |
Comment on lines
+707
to
+728
| } else { | ||
| // Fallback: extract string representation for any val | ||
| buf.WriteString("<div><strong>Summary:</strong><br/>\n") | ||
| for k, v := range flat { | ||
| // skip the headers we already added | ||
| if k == "id" || k == "created_at" || k == "name" || k == "status" { | ||
| continue | ||
| } | ||
| if v != nil { | ||
| str := fmt.Sprint(v) | ||
| if strings.TrimSpace(str) != "" { | ||
| buf.WriteString(fmt.Sprintf("<strong>%s:</strong> %s<br/>\n", k, str)) | ||
| } | ||
| } | ||
| } | ||
| buf.WriteString("</div>\n") | ||
| } | ||
|
|
||
| if buf.Len() > 0 { | ||
| results = append(results, buf.String()) | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
I don't think we need an else. if details is empty, there is not content we want to be adding.
Suggested change
| } else { | |
| // Fallback: extract string representation for any val | |
| buf.WriteString("<div><strong>Summary:</strong><br/>\n") | |
| for k, v := range flat { | |
| // skip the headers we already added | |
| if k == "id" || k == "created_at" || k == "name" || k == "status" { | |
| continue | |
| } | |
| if v != nil { | |
| str := fmt.Sprint(v) | |
| if strings.TrimSpace(str) != "" { | |
| buf.WriteString(fmt.Sprintf("<strong>%s:</strong> %s<br/>\n", k, str)) | |
| } | |
| } | |
| } | |
| buf.WriteString("</div>\n") | |
| } | |
| if buf.Len() > 0 { | |
| results = append(results, buf.String()) | |
| } | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Hey @golanglemonade , Please review this, i had tested it with slate.js and it is working with that also.