Skip to content
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: Click Segment Overrides icon doesnt open the segment override tab #2887

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 24 additions & 18 deletions frontend/web/components/FeatureRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ class TheComponent extends Component {
history.replaceState(
{},
null,
`${document.location.pathname}?feature=${projectFlag.id}${
tab ? `&tab=${tab}` : ''
}`,
`${document.location.pathname}?feature=${projectFlag.id}`,
)
openModal(
`${this.props.permission ? 'Edit Feature' : 'Feature'}: ${
Expand All @@ -75,6 +73,7 @@ class TheComponent extends Component {
projectFlag={projectFlag}
noPermissions={!this.props.permission}
environmentFlag={environmentFlag}
tab={tab}
flagId={environmentFlag.id}
/>,
'side-modal create-feature-modal',
Expand Down Expand Up @@ -222,22 +221,29 @@ class TheComponent extends Component {
</span>

{!!projectFlag.num_segment_overrides && (
<Tooltip
title={
<span
className='chip me-2 chip--xs bg-primary text-white'
style={{ border: 'none' }}
>
<SegmentsIcon className='chip-svg-icon' />
<span>{projectFlag.num_segment_overrides}</span>
</span>
}
place='top'
<div
onClick={(e) => {
e.stopPropagation()
this.editFeature(projectFlag, environmentFlags[id], 1)
}}
>
{`${projectFlag.num_segment_overrides} Segment Override${
projectFlag.num_segment_overrides !== 1 ? 's' : ''
}`}
</Tooltip>
<Tooltip
title={
<span
className='chip me-2 chip--xs bg-primary text-white'
style={{ border: 'none' }}
>
<SegmentsIcon className='chip-svg-icon' />
<span>{projectFlag.num_segment_overrides}</span>
</span>
}
place='top'
>
{`${projectFlag.num_segment_overrides} Segment Override${
projectFlag.num_segment_overrides !== 1 ? 's' : ''
}`}
</Tooltip>
</div>
)}
{!!projectFlag.num_identity_overrides && (
<Tooltip
Expand Down
4 changes: 2 additions & 2 deletions frontend/web/components/modals/CreateFlag.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const CreateFlag = class extends Component {
: {
multivariate_options: [],
}
const { allowEditDescription } = this.props
const { allowEditDescription, tab } = this.props
if (this.props.projectFlag) {
this.userOverridesPage(1)
}
Expand Down Expand Up @@ -84,7 +84,7 @@ const CreateFlag = class extends Component {
name,
period: 30,
selectedIdentity: null,
tab: Utils.fromParam().tab || 0,
tab: tab || 0,
tags: tags || [],
}
AppActions.getGroups(AccountStore.getOrganisation().id)
Expand Down