-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(flags): add CTA to flag drawer #87354
Open
aliu39
wants to merge
23
commits into
master
Choose a base branch
from
aliu/ff-dist-cta
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+165
−9
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
b43e3e7
feat(flags): add feature flag audit log table to tags dist drawer
michellewzhang ec89ac0
:white_check_mark: tests
michellewzhang d4f2631
:twisted_rightwards_arrows: merge master
michellewzhang db8a3ac
:twisted_rightwards_arrows: merge fix
michellewzhang f8e8f6a
:pencil2: wording
michellewzhang 31e352b
:recycle: pr comments 1
michellewzhang e28485f
:sparkles: add back button for empty state
michellewzhang 5a9488f
:art: simplify props
michellewzhang fe137fd
:lipstick: style comments
michellewzhang 50dc510
:recycle: simplify tags path
michellewzhang e73a5c4
:fire: rm location params
michellewzhang 2ab9e7a
:art: clear cursor on drawer close & new link component
michellewzhang 551bd35
:bug: ugh copy and paste
michellewzhang 24d9343
:bug: add div
michellewzhang e3c6f06
feat(flags): add CTA to flag drawer
aliu39 2555714
Merge branch 'mz/add-flags-audit-log-drawer' of github.com:getsentry/…
aliu39 0d45275
Fix setup sidebar analytics event
aliu39 ddd6256
Don't check cta ff
aliu39 d02d4e3
Style
aliu39 62e7f9f
Rename CardContent
aliu39 0c0ddfa
Update inline cta style and reword drawer cta
aliu39 67c84f6
Merge branch 'master' into aliu/ff-dist-cta
aliu39 103e983
:hammer_and_wrench: apply pre-commit fixes
getsantry[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
static/app/views/issueDetails/groupFeatureFlags/flagDrawerCTA.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
import onboardingInstall from 'sentry-images/spot/onboarding-install.svg'; | ||
|
||
import {Button, LinkButton} from 'sentry/components/core/button'; | ||
import {useFeatureFlagOnboarding} from 'sentry/components/events/featureFlags/useFeatureFlagOnboarding'; | ||
import {useDrawerContentContext} from 'sentry/components/globalDrawer/components'; | ||
import {t} from 'sentry/locale'; | ||
import {space} from 'sentry/styles/space'; | ||
import {trackAnalytics} from 'sentry/utils/analytics'; | ||
import useOrganization from 'sentry/utils/useOrganization'; | ||
|
||
export default function FlagDrawerCTA() { | ||
const organization = useOrganization(); | ||
const {activateSidebar} = useFeatureFlagOnboarding(); | ||
const {onClose: closeDrawer} = useDrawerContentContext(); | ||
|
||
function handleSetupButtonClick(e: any) { | ||
trackAnalytics('flags.setup_sidebar_opened', { | ||
organization, | ||
surface: 'issue_details.flags_drawer', | ||
}); | ||
trackAnalytics('flags.cta_setup_button_clicked', {organization}); | ||
closeDrawer?.(); | ||
setTimeout(() => { | ||
// Wait for global drawer state to update | ||
activateSidebar(e); | ||
}, 100); | ||
} | ||
|
||
return ( | ||
<BannerWrapper> | ||
<BannerContent> | ||
<BannerTitle>{t('Set Up Feature Flags')}</BannerTitle> | ||
<BannerDescription> | ||
{t( | ||
'Want to know which feature flags were associated with this issue? Set up your feature flag integration.' | ||
)} | ||
</BannerDescription> | ||
<ActionButton> | ||
<Button onClick={handleSetupButtonClick} priority="primary"> | ||
{t('Set Up Now')} | ||
</Button> | ||
<LinkButton | ||
priority="default" | ||
href="https://docs.sentry.io/product/explore/feature-flags/" | ||
external | ||
> | ||
{t('Read More')} | ||
</LinkButton> | ||
</ActionButton> | ||
</BannerContent> | ||
<BannerIllustration src={onboardingInstall} alt="Install" /> | ||
</BannerWrapper> | ||
); | ||
} | ||
|
||
const ActionButton = styled('div')` | ||
display: flex; | ||
gap: ${space(1)}; | ||
`; | ||
|
||
const BannerTitle = styled('div')` | ||
font-size: ${p => p.theme.fontSizeExtraLarge}; | ||
margin-bottom: ${space(1)}; | ||
font-weight: ${p => p.theme.fontWeightBold}; | ||
`; | ||
|
||
const BannerDescription = styled('div')` | ||
margin-bottom: ${space(1.5)}; | ||
max-width: 340px; | ||
`; | ||
|
||
const BannerContent = styled('div')` | ||
padding: ${space(2)}; | ||
|
||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
`; | ||
|
||
const BannerIllustration = styled('img')` | ||
height: 100%; | ||
object-fit: contain; | ||
max-width: 30%; | ||
margin-right: 10px; | ||
margin-bottom: -${space(2)}; | ||
padding: ${space(2)}; | ||
`; | ||
|
||
const BannerWrapper = styled('div')` | ||
position: relative; | ||
border: 1px solid ${p => p.theme.border}; | ||
border-radius: ${p => p.theme.borderRadius}; | ||
margin: ${space(1)} 0; | ||
background: linear-gradient( | ||
90deg, | ||
${p => p.theme.backgroundSecondary}00 0%, | ||
${p => p.theme.backgroundSecondary}FF 70%, | ||
${p => p.theme.backgroundSecondary}FF 100% | ||
); | ||
display: flex; | ||
flex-direction: row; | ||
align-items: flex-end; | ||
justify-content: space-between; | ||
gap: ${space(1)}; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -2,9 +2,13 @@ import {useMemo} from 'react'; | |||||
|
||||||
import LoadingError from 'sentry/components/loadingError'; | ||||||
import LoadingIndicator from 'sentry/components/loadingIndicator'; | ||||||
import {featureFlagOnboardingPlatforms} from 'sentry/data/platformCategories'; | ||||||
import {t} from 'sentry/locale'; | ||||||
import type {Group} from 'sentry/types/group'; | ||||||
import useOrganization from 'sentry/utils/useOrganization'; | ||||||
import useProjectFromSlug from 'sentry/utils/useProjectFromSlug'; | ||||||
import FlagDetailsLink from 'sentry/views/issueDetails/groupFeatureFlags/flagDetailsLink'; | ||||||
import FlagDrawerCTA from 'sentry/views/issueDetails/groupFeatureFlags/flagDrawerCTA'; | ||||||
import useGroupFeatureFlags from 'sentry/views/issueDetails/groupFeatureFlags/useGroupFeatureFlags'; | ||||||
import { | ||||||
Container, | ||||||
|
@@ -61,6 +65,18 @@ export default function GroupFeatureFlagsDrawerContent({ | |||||
return searchedTags; | ||||||
}, [data, search, tagValues]); | ||||||
|
||||||
const organization = useOrganization(); | ||||||
const project = useProjectFromSlug({organization, projectSlug: group.project?.slug}); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does simply
Suggested change
|
||||||
|
||||||
if ( | ||||||
data.length === 0 && | ||||||
project && | ||||||
!project.hasFlags && | ||||||
featureFlagOnboardingPlatforms.includes(project.platform ?? 'other') | ||||||
) { | ||||||
return <FlagDrawerCTA />; | ||||||
} | ||||||
|
||||||
return isPending ? ( | ||||||
<LoadingIndicator /> | ||||||
) : isError ? ( | ||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can any of this file &
featureFlagInlineCTA.tsx
be refactored into a reusable component?