Skip to content

Commit

Permalink
feat: Click Segment Overrides icon doesnt open the segment override t…
Browse files Browse the repository at this point in the history
…ab (#2887)
  • Loading branch information
novakzaballa committed Oct 25, 2023
1 parent ba72f2c commit 96f3b22
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
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

3 comments on commit 96f3b22

@vercel
Copy link

@vercel vercel bot commented on 96f3b22 Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./docs

docs-git-main-flagsmith.vercel.app
docs-flagsmith.vercel.app
docs.flagsmith.com
docs.bullet-train.io

@vercel
Copy link

@vercel vercel bot commented on 96f3b22 Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 96f3b22 Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.