Add light and dark logo files for frameworks

Signed-off-by: Émile Ré <nemile.re@gmail.com>
This commit is contained in:
Émile Ré
2025-12-16 19:02:57 +01:00
parent 597c00a08a
commit 427565c521
13 changed files with 630 additions and 25 deletions

View File

@@ -1100,6 +1100,24 @@ func (r *frameworkResolver) Controls(ctx context.Context, obj *types.Framework,
return types.NewControlConnection(page, r, obj.ID, controlFilter), nil
}
// LightLogoURL is the resolver for the lightLogoURL field.
func (r *frameworkResolver) LightLogoURL(ctx context.Context, obj *types.Framework) (*string, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionGetLogoUrl)
prb := r.ProboService(ctx, obj.ID.TenantID())
return prb.Frameworks.GenerateLightLogoURL(ctx, obj.ID, 1*time.Hour)
}
// DarkLogoURL is the resolver for the darkLogoURL field.
func (r *frameworkResolver) DarkLogoURL(ctx context.Context, obj *types.Framework) (*string, error) {
r.MustBeAuthorized(ctx, obj.ID, authz.ActionGetLogoUrl)
prb := r.ProboService(ctx, obj.ID.TenantID())
return prb.Frameworks.GenerateDarkLogoURL(ctx, obj.ID, 1*time.Hour)
}
// TotalCount is the resolver for the totalCount field.
func (r *frameworkConnectionResolver) TotalCount(ctx context.Context, obj *types.FrameworkConnection) (int, error) {
r.MustBeAuthorized(ctx, obj.ParentID, authz.ActionTotalCount)