Documentation ¶
Index ¶
- type AvailableTemplates
- type AvailableWidgets
- type BaseDashboardTemplate
- type BaseModel
- type BaseTemplates
- type BaseWidgetDimensions
- type DashboardTemplate
- type DashboardTemplateBase
- type FavoritePage
- type GridItem
- type GridSizes
- type LastVisitedRequest
- type ModuleFederationMetadata
- type ProductOfInterest
- type SelfReport
- type TemplateConfig
- type UserIdentity
- type UserIdentityResponse
- type VisitedPage
- type WidgetConfiguration
- type WidgetHeaderLink
- type WidgetIcons
- type WidgetModuleFederationMapping
- type WidgetPermission
- type WidgetPermissionMethods
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AvailableTemplates ¶
type AvailableTemplates string
const (
LandingPage AvailableTemplates = "landingPage"
)
func (AvailableTemplates) IsValid ¶
func (at AvailableTemplates) IsValid() error
func (*AvailableTemplates) Scan ¶
func (at *AvailableTemplates) Scan(value interface{}) error
func (AvailableTemplates) String ¶
func (at AvailableTemplates) String() string
type AvailableWidgets ¶
type AvailableWidgets string
const ( FavoriteServices AvailableWidgets = "favoriteServices" NotificationsEvents AvailableWidgets = "notificationsEvents" LearningResources AvailableWidgets = "learningResources" ExploreCapabilities AvailableWidgets = "exploreCapabilities" Edge AvailableWidgets = "edge" Ansible AvailableWidgets = "ansible" Rhel AvailableWidgets = "rhel" OpenShift AvailableWidgets = "openshift" RecentlyVisited AvailableWidgets = "recentlyVisited" OpenShiftAi AvailableWidgets = "openshiftAi" Quay AvailableWidgets = "quay" Acs AvailableWidgets = "acs" Subscriptions AvailableWidgets = "subscriptions" SupportCases AvailableWidgets = "supportCases" )
func (AvailableWidgets) IsValid ¶
func (aw AvailableWidgets) IsValid() error
type BaseDashboardTemplate ¶
type BaseDashboardTemplate struct { Name string `json:"name" yaml:"name"` DisplayName string `json:"displayName" yaml:"displayName"` TemplateConfig TemplateConfig `json:"templateConfig" yaml:"templateConfig"` }
type BaseModel ¶
type BaseModel struct { ID uint `gorm:"primarykey" json:"id,omitempty"` CreatedAt time.Time `json:"createdAt,omitempty"` UpdatedAt time.Time `json:"updatedAt,omitempty"` DeletedAt gorm.DeletedAt `json:"deletedAt,omitempty"` }
Generic Struct used throughout models in this service.
type BaseTemplates ¶
type BaseTemplates map[AvailableTemplates]BaseDashboardTemplate
type BaseWidgetDimensions ¶
type BaseWidgetDimensions struct { Width int `json:"w" yaml:"w"` Height int `json:"h" yaml:"h"` MaxHeight int `json:"maxH" yaml:"maxH"` MinHeight int `json:"minH" yaml:"minH"` }
func (BaseWidgetDimensions) InitDimensions ¶
func (bwd BaseWidgetDimensions) InitDimensions(w, h, maxH, minH int) BaseWidgetDimensions
type DashboardTemplate ¶
type DashboardTemplate struct { BaseModel UserIdentityID uint `json:"userIdentityID"` Default bool `gorm:"not null;default:false" json:"default"` TemplateBase DashboardTemplateBase `gorm:"not null;default null; embedded" 'json:"templateBase"` TemplateConfig TemplateConfig `gorm:"not null;default null; embedded" json:"templateConfig"` }
func DecodeDashboardBase64 ¶
func DecodeDashboardBase64(encoded string) (DashboardTemplate, error)
func (*DashboardTemplate) EncodeBase64 ¶
func (dt *DashboardTemplate) EncodeBase64() (string, error)
func (DashboardTemplate) IsValid ¶
func (dt DashboardTemplate) IsValid() error
type DashboardTemplateBase ¶
type FavoritePage ¶
type GridItem ¶
type LastVisitedRequest ¶
type LastVisitedRequest struct {
Pages []VisitedPage `json:"pages"`
}
type ModuleFederationMetadata ¶
type ModuleFederationMetadata struct { Scope string `json:"scope"` Module string `json:"module"` ImportName string `json:"importName,omitempty"` Defaults BaseWidgetDimensions `json:"defaults"` Config WidgetConfiguration `json:"config"` }
type ProductOfInterest ¶
type SelfReport ¶
type SelfReport struct { BaseModel ProductsOfInterest pq.StringArray `gorm:"type:text[]" json:"productsOfInterest"` JobRole string `json:"jobRole"` UserIdentityID uint `json:"userIdentityID"` }
type TemplateConfig ¶
type TemplateConfig struct { Sm datatypes.JSONType[[]GridItem] `gorm:"not null;default null" json:"sm" yaml:"sm"` Md datatypes.JSONType[[]GridItem] `gorm:"not null;default null" json:"md" yaml:"md"` Lg datatypes.JSONType[[]GridItem] `gorm:"not null;default null" json:"lg" yaml:"lg"` Xl datatypes.JSONType[[]GridItem] `gorm:"not null;default null" json:"xl" yaml:"xl"` }
func (TemplateConfig) IsValid ¶
func (tc TemplateConfig) IsValid() error
func (*TemplateConfig) SetLayoutSizeItems ¶
func (tc *TemplateConfig) SetLayoutSizeItems(layoutSize string, items []GridItem) *TemplateConfig
func (*TemplateConfig) UnmarshalYAML ¶
func (tc *TemplateConfig) UnmarshalYAML(value *yaml.Node) error
type UserIdentity ¶
type UserIdentity struct { BaseModel AccountId string `json:"accountId,omitempty"` FirstLogin bool `json:"firstLogin"` DayOne bool `json:"dayOne"` LastLogin time.Time `json:"lastLogin"` LastVisitedPages datatypes.JSONType[[]VisitedPage] `json:"lastVisitedPages"` FavoritePages []FavoritePage `json:"favoritePages"` SelfReport SelfReport `json:"selfReport"` VisitedBundles datatypes.JSON `json:"visitedBundles,omitempty" gorm:"type: JSONB"` DashboardTemplates []DashboardTemplate `json:"dashboardTemplates,omitempty"` UIPreview bool `json:"uiPreview"` }
type UserIdentityResponse ¶
type UserIdentityResponse struct { BaseModel AccountId string `json:"accountId,omitempty"` FirstLogin bool `json:"firstLogin"` DayOne bool `json:"dayOne"` LastLogin time.Time `json:"lastLogin"` LastVisitedPages []VisitedPage `json:"lastVisitedPages"` FavoritePages []FavoritePage `json:"favoritePages"` SelfReport SelfReport `json:"selfReport"` VisitedBundles datatypes.JSON `json:"visitedBundles,omitempty" gorm:"type: JSONB"` UIPreview bool `json:"uiPreview"` }
type VisitedPage ¶
type WidgetConfiguration ¶
type WidgetConfiguration struct { Title string `json:"title"` Icon WidgetIcons `json:"icon,omitempty"` HeaderLink WidgetHeaderLink `json:"headerLink,omitempty"` Permissions []WidgetPermission `json:"permissions,omitempty"` }
type WidgetHeaderLink ¶
type WidgetIcons ¶
type WidgetIcons string
const ( BellIcon WidgetIcons = "BellIcon" HistoryIcon WidgetIcons = "HistoryIcon" OutlinedBookmarkIcon WidgetIcons = "OutlinedBookmarkIcon" RocketIcon WidgetIcons = "RocketIcon" StarIcon WidgetIcons = "StarIcon" CreditCardIcon WidgetIcons = "CreditCardIcon" RhelIcon WidgetIcons = "RhelIcon" OpenShiftIcon WidgetIcons = "OpenShiftIcon" EdgeIcon WidgetIcons = "EdgeIcon" AnsibleIcon WidgetIcons = "AnsibleIcon" QuayIcon WidgetIcons = "QuayIcon" ACSIcon WidgetIcons = "ACSIcon" OpenShiftAiIcon WidgetIcons = "OpenShiftAiIcon" HeadsetIcon WidgetIcons = "HeadsetIcon" )
func (WidgetIcons) IsValid ¶
func (wi WidgetIcons) IsValid() error
type WidgetModuleFederationMapping ¶
type WidgetModuleFederationMapping map[AvailableWidgets]ModuleFederationMetadata
type WidgetPermission ¶
type WidgetPermission struct { Method WidgetPermissionMethods `json:"method,omitempty"` Apps []string `json:"apps,omitempty"` Args []any `json:"args,omitempty"` }
type WidgetPermissionMethods ¶
type WidgetPermissionMethods string
const ( OrgAdmin WidgetPermissionMethods = "isOrgAdmin" FeatureFlag WidgetPermissionMethods = "featureFlag" HasPermissions WidgetPermissionMethods = "hasPermissions" )
Click to show internal directories.
Click to hide internal directories.