diff --git a/cmd/server/pactasrv/analysis.go b/cmd/server/pactasrv/analysis.go index b0b16c0..d8b8ef1 100644 --- a/cmd/server/pactasrv/analysis.go +++ b/cmd/server/pactasrv/analysis.go @@ -25,6 +25,16 @@ func (s *Server) ListAnalyses(ctx context.Context, request api.ListAnalysesReque if err != nil { return nil, oapierr.Internal("failed to query analyses", zap.Error(err)) } + if err := s.populateArtifactsInAnalyses(ctx, as...); err != nil { + return nil, err + } + artifacts := []*pacta.AnalysisArtifact{} + for _, a := range as { + artifacts = append(artifacts, a.Artifacts...) + } + if err := s.populateBlobsInAnalysisArtifacts(ctx, artifacts...); err != nil { + return nil, err + } items, err := dereference(conv.AnalysesToOAPI(as)) if err != nil { return nil, err diff --git a/cmd/server/pactasrv/conv/pacta_to_oapi.go b/cmd/server/pactasrv/conv/pacta_to_oapi.go index d6511cf..62588d1 100644 --- a/cmd/server/pactasrv/conv/pacta_to_oapi.go +++ b/cmd/server/pactasrv/conv/pacta_to_oapi.go @@ -314,8 +314,18 @@ func FileTypeToOAPI(ft pacta.FileType) (api.FileType, error) { return api.FileTypeJSON, nil case pacta.FileType_HTML: return api.FileTypeHTML, nil - } - return "", fmt.Errorf("unknown file type: %q", ft) + case pacta.FileType_TEXT: + return api.FileTypeTEXT, nil + case pacta.FileType_CSS: + return api.FileTypeCSS, nil + case pacta.FileType_JS: + return api.FileTypeJS, nil + case pacta.FileType_TTF: + return api.FileTypeTTF, nil + case pacta.FileType_UNKNOWN: + return api.FileTypeUNKNOWN, nil + } + return api.FileTypeUNKNOWN, nil } func BlobToOAPI(b *pacta.Blob) (*api.Blob, error) { diff --git a/db/sqldb/blob.go b/db/sqldb/blob.go index 2593ed2..e65659f 100644 --- a/db/sqldb/blob.go +++ b/db/sqldb/blob.go @@ -32,6 +32,9 @@ func (d *DB) Blob(tx db.Tx, id pacta.BlobID) (*pacta.Blob, error) { } func (d *DB) Blobs(tx db.Tx, ids []pacta.BlobID) (map[pacta.BlobID]*pacta.Blob, error) { + if len(ids) == 0 { + return map[pacta.BlobID]*pacta.Blob{}, nil + } ids = dedupeIDs(ids) rows, err := d.query(tx, ` SELECT `+blobSelectColumns+` diff --git a/frontend/components/analysis/Editor.vue b/frontend/components/analysis/Editor.vue new file mode 100644 index 0000000..af2b878 --- /dev/null +++ b/frontend/components/analysis/Editor.vue @@ -0,0 +1,44 @@ + + + diff --git a/frontend/components/analysis/ListView.vue b/frontend/components/analysis/ListView.vue new file mode 100644 index 0000000..c4d67d2 --- /dev/null +++ b/frontend/components/analysis/ListView.vue @@ -0,0 +1,194 @@ + + + diff --git a/frontend/components/portfolio/ListView.vue b/frontend/components/portfolio/ListView.vue index 0fb6821..03c12d5 100644 --- a/frontend/components/portfolio/ListView.vue +++ b/frontend/components/portfolio/ListView.vue @@ -1,6 +1,6 @@