Documentation ¶
Index ¶
- Variables
- func AddVisitedBundle(user models.UserIdentity, bundle string) (models.UserIdentity, error)
- func ChangeDefaultTemplate(accountId uint, dashboardId uint) (models.DashboardTemplate, error)
- func CheckIfExistsInDB(allFavoritePages []models.FavoritePage, newFavoritePage models.FavoritePage) bool
- func ConvertToJson(items []models.GridItem) datatypes.JSONType[[]models.GridItem]
- func CopyDashboardTemplate(accountId uint, dashboardTemplateId uint) (models.DashboardTemplate, error)
- func CreateIdentity(userId string, skipCache bool) (models.UserIdentity, error)
- func DecodeDashboardTemplate(encoded string) (models.DashboardTemplate, error)
- func DeleteOrUpdateFavoritePage(favoritePage models.FavoritePage) error
- func DeleteTemplate(accountId uint, dashboardTemplateId uint) error
- func EncodeDashboardTemplate(accountId uint, templateId uint) (string, error)
- func ForkBaseTemplate(userId uint, dashboard models.AvailableTemplates) (models.DashboardTemplate, error)
- func GetAllBaseTemplates() []models.BaseDashboardTemplate
- func GetAllUserDashboardTemplates(userId uint) ([]models.DashboardTemplate, error)
- func GetAllUserFavoritePages(userID uint) ([]models.FavoritePage, error)
- func GetDashboardTemplate(userId uint, dashboard models.AvailableTemplates) ([]models.DashboardTemplate, error)
- func GetDashboardTemplateBase(dashboard models.AvailableTemplates) (models.BaseDashboardTemplate, error)
- func GetSelfReport(accountID uint) (models.SelfReport, error)
- func GetUserActiveFavoritePages(userID uint) ([]models.FavoritePage, error)
- func GetUserArchivedFavoritePages(userID uint) ([]models.FavoritePage, error)
- func GetUserDashboardTemplate(userId uint, dashboard models.AvailableTemplates) ([]models.DashboardTemplate, error)
- func GetUserIdentityData(user models.UserIdentity) (models.UserIdentity, error)
- func GetVisitedBundles(user models.UserIdentity) (map[string]bool, error)
- func HandleNewSelfReport(accountID uint, newSelfReport *models.SelfReport) error
- func HandlePostLastVisitedPages(recentPages []models.VisitedPage, user *models.UserIdentity) error
- func LoadBaseLayout()
- func ResetDashboardTemplate(accountId uint, dashboardId uint) (models.DashboardTemplate, error)
- func SaveUserFavoritePage(userID uint, accountId string, newFavoritePage models.FavoritePage) error
- func UpdateDashboardTemplate(templateId uint, userId uint, dashboardTemplate models.DashboardTemplate) (models.DashboardTemplate, error)
- func UpdateUserPreview(identity *models.UserIdentity, preview bool) error
- type IntercomApp
- type IntercomPayload
Constants ¶
This section is empty.
Variables ¶
View Source
var ( BaseTemplates models.BaseTemplates = models.BaseTemplates{} WidgetMapping models.WidgetModuleFederationMapping = models.WidgetModuleFederationMapping{ models.ExploreCapabilities: models.ModuleFederationMetadata{ Scope: "landing", Module: "./ExploreCapabilities", Defaults: models.BaseWidgetDimensions.InitDimensions(models.BaseWidgetDimensions{}, 3, 5, 10, 1), Config: models.WidgetConfiguration{ Icon: models.RocketIcon, Title: "Explore capabilities", }, }, models.Edge: models.ModuleFederationMetadata{ Scope: "landing", Module: "./EdgeWidget", Defaults: models.BaseWidgetDimensions.InitDimensions(models.BaseWidgetDimensions{}, 1, 4, 10, 1), Config: models.WidgetConfiguration{ Icon: models.EdgeIcon, Title: "Edge Management", }, }, models.Ansible: models.ModuleFederationMetadata{ Scope: "landing", Module: "./AnsibleWidget", Defaults: models.BaseWidgetDimensions.InitDimensions(models.BaseWidgetDimensions{}, 1, 4, 10, 1), Config: models.WidgetConfiguration{ Icon: models.AnsibleIcon, Title: "Ansible Automation Platform", }, }, models.Rhel: models.ModuleFederationMetadata{ Scope: "landing", Module: "./RhelWidget", Defaults: models.BaseWidgetDimensions.InitDimensions(models.BaseWidgetDimensions{}, 1, 4, 10, 1), Config: models.WidgetConfiguration{ Icon: models.RhelIcon, Title: "Red Hat Enterprise Linux", }, }, models.OpenShift: models.ModuleFederationMetadata{ Scope: "landing", Module: "./OpenShiftWidget", Defaults: models.BaseWidgetDimensions.InitDimensions(models.BaseWidgetDimensions{}, 1, 4, 10, 1), Config: models.WidgetConfiguration{ Icon: models.OpenShiftIcon, Title: "Red Hat OpenShift", }, }, models.Quay: models.ModuleFederationMetadata{ Scope: "landing", Module: "./QuayWidget", Defaults: models.BaseWidgetDimensions.InitDimensions(models.BaseWidgetDimensions{}, 1, 4, 10, 1), Config: models.WidgetConfiguration{ Icon: models.QuayIcon, Title: "Quay.io", }, }, models.Acs: models.ModuleFederationMetadata{ Scope: "landing", Module: "./AcsWidget", Defaults: models.BaseWidgetDimensions.InitDimensions(models.BaseWidgetDimensions{}, 1, 4, 10, 1), Config: models.WidgetConfiguration{ Icon: models.ACSIcon, Title: "Advanced Cluster Security", }, }, models.OpenShiftAi: models.ModuleFederationMetadata{ Scope: "landing", Module: "./OpenShiftAiWidget", Defaults: models.BaseWidgetDimensions.InitDimensions(models.BaseWidgetDimensions{}, 1, 4, 10, 1), Config: models.WidgetConfiguration{ Icon: models.OpenShiftAiIcon, Title: "Red Hat OpenShift AI", }, }, models.RecentlyVisited: models.ModuleFederationMetadata{ Scope: "landing", Module: "./RecentlyVisited", Defaults: models.BaseWidgetDimensions.InitDimensions(models.BaseWidgetDimensions{}, 1, 7, 10, 1), Config: models.WidgetConfiguration{ Icon: models.HistoryIcon, Title: "Recently visited", }, }, models.FavoriteServices: models.ModuleFederationMetadata{ Scope: "chrome", Module: "./DashboardFavorites", Defaults: models.BaseWidgetDimensions.InitDimensions(models.BaseWidgetDimensions{}, 1, 6, 10, 1), Config: models.WidgetConfiguration{ HeaderLink: models.WidgetHeaderLink{ Title: "View all services", Href: "/allservices", }, Icon: models.StarIcon, Title: "My favorite services", }, }, models.NotificationsEvents: models.ModuleFederationMetadata{ Scope: "notifications", Module: "./DashboardWidget", Defaults: models.BaseWidgetDimensions.InitDimensions(models.BaseWidgetDimensions{}, 1, 3, 10, 1), Config: models.WidgetConfiguration{ HeaderLink: models.WidgetHeaderLink{ Title: "View event log", Href: "/settings/notifications/eventlog", }, Icon: models.BellIcon, Title: "Events", Permissions: []models.WidgetPermission{ models.WidgetPermission{ Method: models.OrgAdmin, }, }, }, }, models.LearningResources: models.ModuleFederationMetadata{ Scope: "learningResources", Module: "./BookmarkedLearningResourcesWidget", Defaults: models.BaseWidgetDimensions.InitDimensions(models.BaseWidgetDimensions{}, 2, 4, 10, 1), Config: models.WidgetConfiguration{ Icon: models.OutlinedBookmarkIcon, Title: "Bookmarked learning resources", }, }, models.SupportCases: models.ModuleFederationMetadata{ Scope: "landing", Module: "./SupportCaseWidget", Defaults: models.BaseWidgetDimensions.InitDimensions(models.BaseWidgetDimensions{}, 2, 4, 10, 1), Config: models.WidgetConfiguration{ HeaderLink: models.WidgetHeaderLink{ Title: "Open a support case", Href: "https://access.redhat.com/support/cases/#/case/new/get-support?caseCreate=true", }, Icon: models.HeadsetIcon, Title: "My support cases", }, }, models.Subscriptions: models.ModuleFederationMetadata{ Scope: "subscriptionInventory", Module: "./SubscriptionsWidget", Defaults: models.BaseWidgetDimensions.InitDimensions(models.BaseWidgetDimensions{}, 4, 3, 5, 1), Config: models.WidgetConfiguration{ HeaderLink: models.WidgetHeaderLink{ Title: "Manage subscriptions", Href: "/subscriptions/inventory", }, Icon: models.CreditCardIcon, Title: "Subscriptions", Permissions: []models.WidgetPermission{ models.WidgetPermission{ Method: models.FeatureFlag, Args: []any{ "chrome-service.subscriptions-widget.enabled", true, }, }, models.WidgetPermission{ Method: models.HasPermissions, Args: []any{ []string{"subscriptions:products:read"}, }, }, }, }, }, } )
Functions ¶
func AddVisitedBundle ¶
func AddVisitedBundle(user models.UserIdentity, bundle string) (models.UserIdentity, error)
Set visited bundle
func ChangeDefaultTemplate ¶
func ChangeDefaultTemplate(accountId uint, dashboardId uint) (models.DashboardTemplate, error)
func CheckIfExistsInDB ¶
func CheckIfExistsInDB(allFavoritePages []models.FavoritePage, newFavoritePage models.FavoritePage) bool
func ConvertToJson ¶
func CopyDashboardTemplate ¶
func CopyDashboardTemplate(accountId uint, dashboardTemplateId uint) (models.DashboardTemplate, error)
func CreateIdentity ¶
func CreateIdentity(userId string, skipCache bool) (models.UserIdentity, error)
Create the user object and add the row if not already in DB
func DecodeDashboardTemplate ¶
func DecodeDashboardTemplate(encoded string) (models.DashboardTemplate, error)
func DeleteOrUpdateFavoritePage ¶
func DeleteOrUpdateFavoritePage(favoritePage models.FavoritePage) error
func DeleteTemplate ¶
func EncodeDashboardTemplate ¶
func ForkBaseTemplate ¶
func ForkBaseTemplate(userId uint, dashboard models.AvailableTemplates) (models.DashboardTemplate, error)
func GetAllBaseTemplates ¶
func GetAllBaseTemplates() []models.BaseDashboardTemplate
func GetAllUserDashboardTemplates ¶
func GetAllUserDashboardTemplates(userId uint) ([]models.DashboardTemplate, error)
func GetAllUserFavoritePages ¶
func GetAllUserFavoritePages(userID uint) ([]models.FavoritePage, error)
func GetDashboardTemplate ¶
func GetDashboardTemplate(userId uint, dashboard models.AvailableTemplates) ([]models.DashboardTemplate, error)
func GetDashboardTemplateBase ¶
func GetDashboardTemplateBase(dashboard models.AvailableTemplates) (models.BaseDashboardTemplate, error)
func GetSelfReport ¶
func GetSelfReport(accountID uint) (models.SelfReport, error)
func GetUserActiveFavoritePages ¶
func GetUserActiveFavoritePages(userID uint) ([]models.FavoritePage, error)
func GetUserArchivedFavoritePages ¶
func GetUserArchivedFavoritePages(userID uint) ([]models.FavoritePage, error)
func GetUserDashboardTemplate ¶
func GetUserDashboardTemplate(userId uint, dashboard models.AvailableTemplates) ([]models.DashboardTemplate, error)
func GetUserIdentityData ¶
func GetUserIdentityData(user models.UserIdentity) (models.UserIdentity, error)
Get user data complete with it's related tables.
func GetVisitedBundles ¶
func GetVisitedBundles(user models.UserIdentity) (map[string]bool, error)
func HandleNewSelfReport ¶
func HandleNewSelfReport(accountID uint, newSelfReport *models.SelfReport) error
func HandlePostLastVisitedPages ¶
func HandlePostLastVisitedPages(recentPages []models.VisitedPage, user *models.UserIdentity) error
HandlePostLastVisitedPages inserts the most recent pages from chrome. Once they are added, all older entries are removed from the table.
func LoadBaseLayout ¶
func LoadBaseLayout()
func ResetDashboardTemplate ¶
func ResetDashboardTemplate(accountId uint, dashboardId uint) (models.DashboardTemplate, error)
func SaveUserFavoritePage ¶
func SaveUserFavoritePage(userID uint, accountId string, newFavoritePage models.FavoritePage) error
func UpdateDashboardTemplate ¶
func UpdateDashboardTemplate(templateId uint, userId uint, dashboardTemplate models.DashboardTemplate) (models.DashboardTemplate, error)
func UpdateUserPreview ¶
func UpdateUserPreview(identity *models.UserIdentity, preview bool) error
Types ¶
type IntercomApp ¶
type IntercomApp string
const ( OpenShift IntercomApp = "openshift" HacCore IntercomApp = "hacCore" Acs IntercomApp = "acs" Ansible IntercomApp = "ansible" AnsibleDashboard IntercomApp = "ansibleDashboard" AutomationHub IntercomApp = "automationHub" AutomationAnalytics IntercomApp = "automationAnalytics" DBAAS IntercomApp = "dbaas" )
func (IntercomApp) IsValidApp ¶
func (ib IntercomApp) IsValidApp() error
type IntercomPayload ¶
type IntercomPayload struct { Prod string `json:"prod,omitempty"` Dev string `json:"dev,omitempty"` }
func GetUserIntercomHash ¶
func GetUserIntercomHash(userId string, namespace IntercomApp) (IntercomPayload, error)
Click to show internal directories.
Click to hide internal directories.