Skip to content

Commit 919e332

Browse files
committed
fix: cohort key modal polish, identities env pre-fill and env-scoped override segments
1 parent 114b160 commit 919e332

5 files changed

Lines changed: 23 additions & 10 deletions

File tree

frontend/web/components/PanelSearch.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,12 @@ const PanelSearch = <T,>(props: PanelSearchProps<T>): ReactElement => {
319319
</Row>
320320
)}
321321
{onRefresh && (
322-
<Button theme='text' size='xSmall' onClick={onRefresh}>
322+
<Button
323+
theme='text'
324+
size='xSmall'
325+
className='mr-2'
326+
onClick={onRefresh}
327+
>
323328
<Icon name='refresh' fill='#6837FC' width={16} /> Refresh
324329
</Button>
325330
)}

frontend/web/components/SegmentOverrides.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,12 @@ class TheComponent extends Component {
739739
const filter = (segment) => {
740740
if (segment.feature && segment.feature !== this.props.feature)
741741
return false
742+
// A cohort-managed segment only has members in its own environment.
743+
if (
744+
segment.cohort &&
745+
segment.cohort.environment_api_key !== this.props.environmentId
746+
)
747+
return false
742748
if (this.props.id && this.props.id !== segment.id) return null
743749
const foundSegment = find(value, (v) => v.segment === segment.id)
744750
return !value || !foundSegment || (foundSegment && foundSegment.toRemove)

frontend/web/components/modals/ConnectCohortProviderModal/CohortSyncKeyStep.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const CohortSyncKeyStep: FC<CohortSyncKeyStepProps> = ({
8181
if (createdKey) return 'Synchronisation key'
8282
if (hasKeys && !isCreateFormOpen) return 'Use your existing key'
8383
if (!canManage) return 'Synchronisation key'
84-
return 'Create a synchronisation key'
84+
return 'Generate a synchronisation key'
8585
}
8686

8787
const renderBody = () => {
@@ -97,10 +97,9 @@ const CohortSyncKeyStep: FC<CohortSyncKeyStepProps> = ({
9797
className='font-monospace'
9898
data-test='connect-provider-key-value'
9999
/>
100-
<WarningMessage
101-
warningMessage='This key is shown only once. Store it securely — you will not be able to see it again.'
102-
warningMessageClass='mt-4'
103-
/>
100+
<div className='mt-4'>
101+
<WarningMessage warningMessage='This key is shown only once. Store it securely — you will not be able to see it again.' />
102+
</div>
104103
</>
105104
)
106105
}
@@ -119,6 +118,7 @@ const CohortSyncKeyStep: FC<CohortSyncKeyStepProps> = ({
119118
return (
120119
<form onSubmit={handleSubmit}>
121120
<InputGroup
121+
title='Name'
122122
value={name}
123123
data-test='connect-provider-key-name'
124124
inputProps={{

frontend/web/components/modals/CreateSegment.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,9 @@ const LoadingCreateSegment: FC<LoadingCreateSegmentType> = (props) => {
827827
useEffect(() => {
828828
if (segmentData) {
829829
props.onSegmentRetrieved?.(segmentData)
830+
if (segmentData.cohort?.environment_api_key) {
831+
setEnvironmentId(segmentData.cohort.environment_api_key)
832+
}
830833
}
831834
//eslint-disable-next-line
832835
}, [segmentData])

frontend/web/components/pages/environment-settings/tabs/cohort-sync-tab/CreateCohortSyncKeyModal.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,9 @@ const CreateCohortSyncKeyModal: FC<CreateCohortSyncKeyModalProps> = ({
3939
className='font-monospace'
4040
data-test='cohort-sync-key-value'
4141
/>
42-
<WarningMessage
43-
warningMessage='This key is shown only once. Store it securely — you will not be able to see it again.'
44-
warningMessageClass='mt-4'
45-
/>
42+
<div className='mt-4'>
43+
<WarningMessage warningMessage='This key is shown only once. Store it securely — you will not be able to see it again.' />
44+
</div>
4645
</div>
4746
<ModalHR />
4847
<div className='modal-footer'>

0 commit comments

Comments
 (0)