Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions api/internal/db/applications.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ func (a *ApplicationDB) GetApplication(ctx context.Context, appID string) (*mode
COALESCE(ct.name, '') as template_name, COALESCE(ct.display_name, ia.display_name) as template_display_name,
COALESCE(ct.description, '') as description, COALESCE(ct.category, '') as category,
COALESCE(ct.app_type, '') as app_type, COALESCE(ct.icon_url, '') as icon_url,
COALESCE(ct.manifest, '') as manifest
COALESCE(ct.manifest, '') as manifest,
COALESCE(ia.install_status, '') as install_status,
COALESCE(ia.install_message, '') as install_message
FROM installed_applications ia
LEFT JOIN catalog_templates ct ON ia.catalog_template_id = ct.id
WHERE ia.id = $1
Expand All @@ -178,6 +180,7 @@ func (a *ApplicationDB) GetApplication(ctx context.Context, appID string) (*mode
&app.Enabled, &configJSON, &app.CreatedBy, &app.CreatedAt, &app.UpdatedAt,
&app.TemplateName, &app.TemplateDisplayName, &app.Description,
&app.Category, &app.AppType, &app.IconURL, &app.Manifest,
&app.InstallStatus, &app.InstallMessage,
)
if err != nil {
if err == sql.ErrNoRows {
Expand Down Expand Up @@ -207,7 +210,9 @@ func (a *ApplicationDB) ListApplications(ctx context.Context, enabledOnly bool)
ia.enabled, ia.configuration, ia.created_by, ia.created_at, ia.updated_at,
COALESCE(ct.name, '') as template_name, COALESCE(ct.display_name, ia.display_name) as template_display_name,
COALESCE(ct.description, '') as description, COALESCE(ct.category, '') as category,
COALESCE(ct.app_type, '') as app_type, COALESCE(ct.icon_url, '') as icon_url
COALESCE(ct.app_type, '') as app_type, COALESCE(ct.icon_url, '') as icon_url,
COALESCE(ia.install_status, '') as install_status,
COALESCE(ia.install_message, '') as install_message
FROM installed_applications ia
LEFT JOIN catalog_templates ct ON ia.catalog_template_id = ct.id
WHERE 1=1
Expand Down Expand Up @@ -242,6 +247,7 @@ func (a *ApplicationDB) ListApplications(ctx context.Context, enabledOnly bool)
&app.Enabled, &configJSON, &app.CreatedBy, &app.CreatedAt, &app.UpdatedAt,
&app.TemplateName, &app.TemplateDisplayName, &app.Description,
&app.Category, &app.AppType, &app.IconURL,
&app.InstallStatus, &app.InstallMessage,
)
if err != nil {
fmt.Printf("Error scanning application row: %v\n", err)
Expand Down Expand Up @@ -458,7 +464,9 @@ func (a *ApplicationDB) GetUserAccessibleApplications(ctx context.Context, userI
ia.enabled, ia.configuration, ia.created_by, ia.created_at, ia.updated_at,
COALESCE(ct.name, '') as template_name, COALESCE(ct.display_name, ia.display_name) as template_display_name,
COALESCE(ct.description, '') as description, COALESCE(ct.category, '') as category,
COALESCE(ct.app_type, '') as app_type, COALESCE(ct.icon_url, '') as icon_url
COALESCE(ct.app_type, '') as app_type, COALESCE(ct.icon_url, '') as icon_url,
COALESCE(ia.install_status, '') as install_status,
COALESCE(ia.install_message, '') as install_message
FROM installed_applications ia
LEFT JOIN catalog_templates ct ON ia.catalog_template_id = ct.id
WHERE ia.enabled = true
Expand Down Expand Up @@ -494,6 +502,7 @@ func (a *ApplicationDB) GetUserAccessibleApplications(ctx context.Context, userI
&app.Enabled, &configJSON, &app.CreatedBy, &app.CreatedAt, &app.UpdatedAt,
&app.TemplateName, &app.TemplateDisplayName, &app.Description,
&app.Category, &app.AppType, &app.IconURL,
&app.InstallStatus, &app.InstallMessage,
)
if err != nil {
fmt.Printf("Error scanning application row: %v\n", err)
Expand Down
6 changes: 6 additions & 0 deletions api/internal/models/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ type InstalledApplication struct {
IconURL string `json:"icon,omitempty"`
Manifest string `json:"manifest,omitempty"`

// InstallStatus tracks the installation state (pending, creating, installed, failed)
InstallStatus string `json:"installStatus,omitempty" db:"install_status"`

// InstallMessage provides additional context about the installation status
InstallMessage string `json:"installMessage,omitempty" db:"install_message"`

// Groups with access to this application (populated separately)
Groups []*ApplicationGroupAccess `json:"groups,omitempty"`
}
Expand Down
Loading