-
Notifications
You must be signed in to change notification settings - Fork 534
feat(experimentation): rollout configuration step in experiment wizard #7859
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
Open
Zaimwa9
wants to merge
13
commits into
main
Choose a base branch
from
feat/implement-audience-gradual-rollout
base: main
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.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
05c2d62
feat: add rollout config util and types
Zaimwa9 722ebb8
feat: add experiment_rollout to create experiment request type
Zaimwa9 2b0f0b5
feat: add rollout slider component
Zaimwa9 299c639
feat: add editable rollout variation split editor
Zaimwa9 4f8ef9d
feat: wire rollout configuration step into experiment wizard
Zaimwa9 2a51d8b
feat: show rollout summary in experiment review step
Zaimwa9 220dd2d
feat: refine rollout step to match design
Zaimwa9 d03b4ed
feat: polish rollout step from design review
Zaimwa9 5d63fa5
Merge branch 'main' of github.com:Flagsmith/flagsmith into feat/imple…
Zaimwa9 a73e021
feat: bold variant name and control in experiment recommendation
Zaimwa9 0db2d28
feat: load experiment variation weights from live environment feature…
Zaimwa9 81675db
feat: add traffic distribution preview to rollout summary
Zaimwa9 f327728
feat: map experiment rollout control value to backend contract
Zaimwa9 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ type ContentCardProps = { | |
| action?: ReactNode | ||
| className?: string | ||
| compact?: boolean | ||
| white?: boolean | ||
| children: ReactNode | ||
| } | ||
|
|
||
|
|
@@ -18,12 +19,14 @@ const ContentCard: FC<ContentCardProps> = ({ | |
| compact, | ||
| description, | ||
| title, | ||
| white, | ||
|
Contributor
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. Do you mind giving me a bit more context on this prop ?
Contributor
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. Do you mind giving me a bit more context on this prop ? |
||
| }) => { | ||
| return ( | ||
| <div | ||
| className={cn( | ||
| 'content-card', | ||
| compact && 'content-card--compact', | ||
| white && 'content-card--white', | ||
| className, | ||
| )} | ||
| > | ||
|
|
||
This file contains hidden or 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
23 changes: 23 additions & 0 deletions
23
frontend/web/components/experiments/DistributionBar/DistributionBar.scss
This file contains hidden or 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,23 @@ | ||
| .distribution-bar { | ||
| display: flex; | ||
| height: 10px; | ||
| width: 100%; | ||
| border-radius: var(--radius-full); | ||
| overflow: hidden; | ||
| background: var(--color-surface-emphasis); | ||
|
|
||
| &__segment { | ||
| height: 100%; | ||
| transition: width var(--duration-fast) var(--easing-standard); | ||
| } | ||
|
|
||
| &__segment--hatched { | ||
| background: repeating-linear-gradient( | ||
| 45deg, | ||
| var(--color-surface-emphasis), | ||
| var(--color-surface-emphasis) 5px, | ||
| var(--color-surface-default) 5px, | ||
| var(--color-surface-default) 10px | ||
| ); | ||
| } | ||
| } |
36 changes: 36 additions & 0 deletions
36
frontend/web/components/experiments/DistributionBar/DistributionBar.tsx
This file contains hidden or 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,36 @@ | ||
| import { FC } from 'react' | ||
| import cn from 'classnames' | ||
| import './DistributionBar.scss' | ||
|
|
||
| export type DistributionBarSegment = { | ||
| key: string | ||
| weight: number | ||
| colour?: string | ||
| hatched?: boolean | ||
| } | ||
|
|
||
| type DistributionBarProps = { | ||
| segments: DistributionBarSegment[] | ||
| className?: string | ||
| } | ||
|
|
||
| const DistributionBar: FC<DistributionBarProps> = ({ className, segments }) => ( | ||
| <div className={cn('distribution-bar', className)}> | ||
| {segments.map((segment) => | ||
| segment.weight > 0 ? ( | ||
| <div | ||
| key={segment.key} | ||
| className={cn('distribution-bar__segment', { | ||
| 'distribution-bar__segment--hatched': segment.hatched, | ||
| })} | ||
| style={{ | ||
| background: segment.hatched ? undefined : segment.colour, | ||
| width: `${segment.weight}%`, | ||
| }} | ||
| /> | ||
| ) : null, | ||
| )} | ||
| </div> | ||
| ) | ||
|
|
||
| export default DistributionBar |
This file contains hidden or 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,2 @@ | ||
| export { default } from './DistributionBar' | ||
| export type { DistributionBarSegment } from './DistributionBar' |
Oops, something went wrong.
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.
nit:
display: flex; flex-direction: column; gap: 6pxisd-flex flex-column gap-2(8px) as utilities on the element.6pxis off the spacing scale, butgap-2might close enough and lets the rule go.