Home: add setup guide tab under home tab (#92947)

* feat: add setup guide in home tab

* chore: add feature toggle for setup guide

* chore: add feature toggle for sub menu

* chore: run pretier

* chore: run i18n

* chore: run generated files again

* chore: update description

* chore: update comment to trigger test flow

* chore: trigger test

* chore: fix styling
This commit is contained in:
Serena 2024-09-25 13:20:04 -04:00 committed by GitHub
parent 26a3e70cfa
commit c822feff9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 54 additions and 1 deletions

View File

@ -201,6 +201,7 @@ Experimental features might be changed or removed without prior notice.
| `exploreLogsShardSplitting` | Used in Explore Logs to split queries into multiple queries based on the number of shards | | `exploreLogsShardSplitting` | Used in Explore Logs to split queries into multiple queries based on the number of shards |
| `exploreLogsAggregatedMetrics` | Used in Explore Logs to query by aggregated metrics | | `exploreLogsAggregatedMetrics` | Used in Explore Logs to query by aggregated metrics |
| `exploreLogsLimitedTimeRange` | Used in Explore Logs to limit the time range | | `exploreLogsLimitedTimeRange` | Used in Explore Logs to limit the time range |
| `homeSetupGuide` | Used in Home for users who want to return to the onboarding flow or quickly find popular config pages |
| `appSidecar` | Enable the app sidecar feature that allows rendering 2 apps at the same time | | `appSidecar` | Enable the app sidecar feature that allows rendering 2 apps at the same time |
## Development feature toggles ## Development feature toggles

View File

@ -209,6 +209,7 @@ export interface FeatureToggles {
exploreLogsShardSplitting?: boolean; exploreLogsShardSplitting?: boolean;
exploreLogsAggregatedMetrics?: boolean; exploreLogsAggregatedMetrics?: boolean;
exploreLogsLimitedTimeRange?: boolean; exploreLogsLimitedTimeRange?: boolean;
homeSetupGuide?: boolean;
appPlatformAccessTokens?: boolean; appPlatformAccessTokens?: boolean;
appSidecar?: boolean; appSidecar?: boolean;
groupAttributeSync?: boolean; groupAttributeSync?: boolean;

View File

@ -28,4 +28,5 @@ const (
enterpriseDatasourcesSquad codeowner = "@grafana/enterprise-datasources" enterpriseDatasourcesSquad codeowner = "@grafana/enterprise-datasources"
grafanaSharingSquad codeowner = "@grafana/sharing-squad" grafanaSharingSquad codeowner = "@grafana/sharing-squad"
grafanaDatabasesFrontend codeowner = "@grafana/databases-frontend" grafanaDatabasesFrontend codeowner = "@grafana/databases-frontend"
growthAndOnboarding codeowner = "@grafana/growth-and-onboarding"
) )

View File

@ -1438,6 +1438,13 @@ var (
FrontendOnly: true, FrontendOnly: true,
Owner: grafanaObservabilityLogsSquad, Owner: grafanaObservabilityLogsSquad,
}, },
{
Name: "homeSetupGuide",
Description: "Used in Home for users who want to return to the onboarding flow or quickly find popular config pages",
Stage: FeatureStageExperimental,
FrontendOnly: true,
Owner: growthAndOnboarding,
},
{ {
Name: "appPlatformAccessTokens", Name: "appPlatformAccessTokens",
Description: "Enables the use of access tokens for the App Platform", Description: "Enables the use of access tokens for the App Platform",

View File

@ -190,6 +190,7 @@ singleTopNav,experimental,@grafana/grafana-frontend-platform,false,false,true
exploreLogsShardSplitting,experimental,@grafana/observability-logs,false,false,true exploreLogsShardSplitting,experimental,@grafana/observability-logs,false,false,true
exploreLogsAggregatedMetrics,experimental,@grafana/observability-logs,false,false,true exploreLogsAggregatedMetrics,experimental,@grafana/observability-logs,false,false,true
exploreLogsLimitedTimeRange,experimental,@grafana/observability-logs,false,false,true exploreLogsLimitedTimeRange,experimental,@grafana/observability-logs,false,false,true
homeSetupGuide,experimental,@grafana/growth-and-onboarding,false,false,true
appPlatformAccessTokens,experimental,@grafana/identity-access-team,false,false,false appPlatformAccessTokens,experimental,@grafana/identity-access-team,false,false,false
appSidecar,experimental,@grafana/explore-squad,false,false,false appSidecar,experimental,@grafana/explore-squad,false,false,false
groupAttributeSync,experimental,@grafana/identity-access-team,false,false,false groupAttributeSync,experimental,@grafana/identity-access-team,false,false,false

1 Name Stage Owner requiresDevMode RequiresRestart FrontendOnly
190 exploreLogsShardSplitting experimental @grafana/observability-logs false false true
191 exploreLogsAggregatedMetrics experimental @grafana/observability-logs false false true
192 exploreLogsLimitedTimeRange experimental @grafana/observability-logs false false true
193 homeSetupGuide experimental @grafana/growth-and-onboarding false false true
194 appPlatformAccessTokens experimental @grafana/identity-access-team false false false
195 appSidecar experimental @grafana/explore-squad false false false
196 groupAttributeSync experimental @grafana/identity-access-team false false false

View File

@ -771,6 +771,10 @@ const (
// Used in Explore Logs to limit the time range // Used in Explore Logs to limit the time range
FlagExploreLogsLimitedTimeRange = "exploreLogsLimitedTimeRange" FlagExploreLogsLimitedTimeRange = "exploreLogsLimitedTimeRange"
// FlagHomeSetupGuide
// Used in Home for users who want to return to the onboarding flow or quickly find popular config pages
FlagHomeSetupGuide = "homeSetupGuide"
// FlagAppPlatformAccessTokens // FlagAppPlatformAccessTokens
// Enables the use of access tokens for the App Platform // Enables the use of access tokens for the App Platform
FlagAppPlatformAccessTokens = "appPlatformAccessTokens" FlagAppPlatformAccessTokens = "appPlatformAccessTokens"

View File

@ -1433,6 +1433,22 @@
"hideFromAdminPage": true "hideFromAdminPage": true
} }
}, },
{
"metadata": {
"name": "homeSetupGuide",
"resourceVersion": "1726258153467",
"creationTimestamp": "2024-09-10T15:46:32Z",
"annotations": {
"grafana.app/updatedTimestamp": "2024-09-13 20:09:13.467989 +0000 UTC"
}
},
"spec": {
"description": "Used in Home for users who want to return to the onboarding flow or quickly find popular config pages",
"stage": "experimental",
"codeowner": "@grafana/growth-and-onboarding",
"frontend": true
}
},
{ {
"metadata": { "metadata": {
"name": "idForwarding", "name": "idForwarding",

View File

@ -202,6 +202,18 @@ func (s *ServiceImpl) getHomeNode(c *contextmodel.ReqContext, prefs *pref.Prefer
Icon: "home-alt", Icon: "home-alt",
SortWeight: navtree.WeightHome, SortWeight: navtree.WeightHome,
} }
ctx := c.Req.Context()
if s.features.IsEnabled(ctx, featuremgmt.FlagHomeSetupGuide) {
var children []*navtree.NavLink
// setup guide (a submenu item under Home)
children = append(children, &navtree.NavLink{
Id: "home-setup-guide",
Text: "Setup guide",
Url: homeUrl + "/setup-guide",
SortWeight: navtree.WeightHome,
})
homeNode.Children = children
}
return homeNode return homeNode
} }

View File

@ -123,7 +123,7 @@ export const MegaMenu = memo(
<CustomScrollbar showScrollIndicators hideHorizontalTrack> <CustomScrollbar showScrollIndicators hideHorizontalTrack>
<ul className={styles.itemList} aria-label={t('navigation.megamenu.list-label', 'Navigation')}> <ul className={styles.itemList} aria-label={t('navigation.megamenu.list-label', 'Navigation')}>
{navItems.map((link, index) => ( {navItems.map((link, index) => (
<Stack key={link.text} direction={index === 0 ? 'row-reverse' : 'row'} alignItems="center"> <Stack key={link.text} direction={index === 0 ? 'row-reverse' : 'row'} alignItems="start">
{index === 0 && ( {index === 0 && (
<IconButton <IconButton
id="dock-menu-button" id="dock-menu-button"
@ -187,6 +187,8 @@ const getStyles = (theme: GrafanaTheme2) => ({
}), }),
dockMenuButton: css({ dockMenuButton: css({
display: 'none', display: 'none',
position: 'relative',
top: theme.spacing(1),
[theme.breakpoints.up('xl')]: { [theme.breakpoints.up('xl')]: {
display: 'inline-flex', display: 'inline-flex',

View File

@ -11,6 +11,8 @@ export function getNavTitle(navId: string | undefined) {
switch (navId) { switch (navId) {
case 'home': case 'home':
return t('nav.home.title', 'Home'); return t('nav.home.title', 'Home');
case 'home-setup-guide':
return t('nav.setup-guide.title', 'Setup guide');
case 'new': case 'new':
return t('nav.new.title', 'New'); return t('nav.new.title', 'New');
case 'create': case 'create':

View File

@ -1745,6 +1745,9 @@
"subtitle": "Use service accounts to run automated workloads in Grafana", "subtitle": "Use service accounts to run automated workloads in Grafana",
"title": "Service accounts" "title": "Service accounts"
}, },
"setup-guide": {
"title": "Setup guide"
},
"shared-dashboard": { "shared-dashboard": {
"subtitle": "Manage your organization's externally shared dashboards", "subtitle": "Manage your organization's externally shared dashboards",
"title": "Shared dashboards" "title": "Shared dashboards"

View File

@ -1745,6 +1745,9 @@
"subtitle": "Ůşę şęřvįčę äččőūʼnŧş ŧő řūʼn äūŧőmäŧęđ ŵőřĸľőäđş įʼn Ğřäƒäʼnä", "subtitle": "Ůşę şęřvįčę äččőūʼnŧş ŧő řūʼn äūŧőmäŧęđ ŵőřĸľőäđş įʼn Ğřäƒäʼnä",
"title": "Ŝęřvįčę äččőūʼnŧş" "title": "Ŝęřvįčę äččőūʼnŧş"
}, },
"setup-guide": {
"title": "Ŝęŧūp ģūįđę"
},
"shared-dashboard": { "shared-dashboard": {
"subtitle": "Mäʼnäģę yőūř őřģäʼnįžäŧįőʼn'ş ęχŧęřʼnäľľy şĥäřęđ đäşĥþőäřđş", "subtitle": "Mäʼnäģę yőūř őřģäʼnįžäŧįőʼn'ş ęχŧęřʼnäľľy şĥäřęđ đäşĥþőäřđş",
"title": "Ŝĥäřęđ đäşĥþőäřđş" "title": "Ŝĥäřęđ đäşĥþőäřđş"