@@ -56,6 +56,7 @@ type FeedItem struct { |
| 56 | Repo *FeedRepo | 56 | Repo *FeedRepo |
| 57 | RepoFullName string | 57 | RepoFullName string |
| 58 | RepoURL string | 58 | RepoURL string |
| | 59 | + SourceKind string |
| 59 | SourceName string | 60 | SourceName string |
| 60 | SourceURL string | 61 | SourceURL string |
| 61 | ItemTitle string | 62 | ItemTitle string |
@@ -64,6 +65,7 @@ type FeedItem struct { |
| 64 | | 65 | |
| 65 | type DashboardRepo struct { | 66 | type DashboardRepo struct { |
| 66 | ID int64 | 67 | ID int64 |
| | 68 | + Owner string |
| 67 | Name string | 69 | Name string |
| 68 | Description string | 70 | Description string |
| 69 | Visibility string | 71 | Visibility string |
@@ -143,12 +145,12 @@ func PublicFeed(ctx context.Context, deps Deps, cursor FeedCursor, limit int32) |
| 143 | } | 145 | } |
| 144 | | 146 | |
| 145 | func DashboardRepos(ctx context.Context, deps Deps, viewerUserID int64, limit int32) ([]DashboardRepo, error) { | 147 | func DashboardRepos(ctx context.Context, deps Deps, viewerUserID int64, limit int32) ([]DashboardRepo, error) { |
| 146 | - if limit <= 0 || limit > 20 { | 148 | + if limit <= 0 || limit > 50 { |
| 147 | - limit = 8 | 149 | + limit = 20 |
| 148 | } | 150 | } |
| 149 | rows, err := socialdb.New().ListDashboardReposForUser(ctx, deps.Pool, socialdb.ListDashboardReposForUserParams{ | 151 | rows, err := socialdb.New().ListDashboardReposForUser(ctx, deps.Pool, socialdb.ListDashboardReposForUserParams{ |
| 150 | - OwnerUserID: pgtype.Int8{Int64: viewerUserID, Valid: true}, | 152 | + ViewerUserID: viewerUserID, |
| 151 | - Limit: limit, | 153 | + LimitCount: limit, |
| 152 | }) | 154 | }) |
| 153 | if err != nil { | 155 | if err != nil { |
| 154 | return nil, fmt.Errorf("dashboard repos: %w", err) | 156 | return nil, fmt.Errorf("dashboard repos: %w", err) |
@@ -156,7 +158,7 @@ func DashboardRepos(ctx context.Context, deps Deps, viewerUserID int64, limit in |
| 156 | out := make([]DashboardRepo, 0, len(rows)) | 158 | out := make([]DashboardRepo, 0, len(rows)) |
| 157 | for _, row := range rows { | 159 | for _, row := range rows { |
| 158 | out = append(out, DashboardRepo{ | 160 | out = append(out, DashboardRepo{ |
| 159 | - ID: row.RepoID, Name: row.Name, Description: row.Description, | 161 | + ID: row.RepoID, Owner: row.Owner, Name: row.Name, Description: row.Description, |
| 160 | Visibility: string(row.Visibility), PrimaryLanguage: row.PrimaryLanguage, | 162 | Visibility: string(row.Visibility), PrimaryLanguage: row.PrimaryLanguage, |
| 161 | StarCount: row.StarCount, ForkCount: row.ForkCount, | 163 | StarCount: row.StarCount, ForkCount: row.ForkCount, |
| 162 | UpdatedAt: timeFromPG(row.UpdatedAt), | 164 | UpdatedAt: timeFromPG(row.UpdatedAt), |
@@ -315,7 +317,7 @@ func feedItemFromDashboardRow(row socialdb.ListDashboardFeedEventsRow) FeedItem |
| 315 | repoID: row.RepoID, repoOwner: row.RepoOwner, repoName: row.RepoName, | 317 | repoID: row.RepoID, repoOwner: row.RepoOwner, repoName: row.RepoName, |
| 316 | repoDescription: row.RepoDescription, repoPrimaryLanguage: row.RepoPrimaryLanguage, | 318 | repoDescription: row.RepoDescription, repoPrimaryLanguage: row.RepoPrimaryLanguage, |
| 317 | repoStarCount: row.RepoStarCount, repoForkCount: row.RepoForkCount, | 319 | repoStarCount: row.RepoStarCount, repoForkCount: row.RepoForkCount, |
| 318 | - sourceName: row.SourceName, payload: row.Payload, | 320 | + sourceKind: row.SourceKind, sourceName: row.SourceName, payload: row.Payload, |
| 319 | }) | 321 | }) |
| 320 | } | 322 | } |
| 321 | | 323 | |
@@ -326,7 +328,7 @@ func feedItemFromPublicRow(row socialdb.ListPublicFeedEventsRow) FeedItem { |
| 326 | repoID: row.RepoID, repoOwner: row.RepoOwner, repoName: row.RepoName, | 328 | repoID: row.RepoID, repoOwner: row.RepoOwner, repoName: row.RepoName, |
| 327 | repoDescription: row.RepoDescription, repoPrimaryLanguage: row.RepoPrimaryLanguage, | 329 | repoDescription: row.RepoDescription, repoPrimaryLanguage: row.RepoPrimaryLanguage, |
| 328 | repoStarCount: row.RepoStarCount, repoForkCount: row.RepoForkCount, | 330 | repoStarCount: row.RepoStarCount, repoForkCount: row.RepoForkCount, |
| 329 | - sourceName: row.SourceName, payload: row.Payload, | 331 | + sourceKind: row.SourceKind, sourceName: row.SourceName, payload: row.Payload, |
| 330 | }) | 332 | }) |
| 331 | } | 333 | } |
| 332 | | 334 | |
@@ -343,6 +345,7 @@ type feedParts struct { |
| 343 | repoPrimaryLanguage string | 345 | repoPrimaryLanguage string |
| 344 | repoStarCount int64 | 346 | repoStarCount int64 |
| 345 | repoForkCount int64 | 347 | repoForkCount int64 |
| | 348 | + sourceKind string |
| 346 | sourceName string | 349 | sourceName string |
| 347 | payload []byte | 350 | payload []byte |
| 348 | } | 351 | } |
@@ -351,7 +354,7 @@ func feedItemFromParts(p feedParts) FeedItem { |
| 351 | item := FeedItem{ | 354 | item := FeedItem{ |
| 352 | ID: p.id, Kind: p.kind, Verb: feedVerb(p.kind), | 355 | ID: p.id, Kind: p.kind, Verb: feedVerb(p.kind), |
| 353 | ActorUsername: p.actorUsername, ActorDisplayName: p.actorDisplayName, | 356 | ActorUsername: p.actorUsername, ActorDisplayName: p.actorDisplayName, |
| 354 | - CreatedAt: timeFromPG(p.createdAt), SourceName: p.sourceName, | 357 | + CreatedAt: timeFromPG(p.createdAt), SourceKind: p.sourceKind, SourceName: p.sourceName, |
| 355 | } | 358 | } |
| 356 | if p.repoID.Valid && p.repoOwner != "" && p.repoName != "" { | 359 | if p.repoID.Valid && p.repoOwner != "" && p.repoName != "" { |
| 357 | item.Repo = &FeedRepo{ | 360 | item.Repo = &FeedRepo{ |