Skip to content
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
1 change: 1 addition & 0 deletions frontend/common/stores/config-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ flagsmith
? {
evaluationAnalyticsConfig: {
analyticsServerUrl: Project.evaluationAnalyticsServerUrl,
autoTrackEvaluations: false,
},
}
: {}),
Expand Down
36 changes: 23 additions & 13 deletions frontend/common/stores/feature-list-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ const controller = {
createFlag(projectId, environmentId, flag) {
store.saving()
API.trackEvent(Constants.events.CREATE_FEATURE)
if (
const featureType =
flag.multivariate_options && flag.multivariate_options.length
? 'MULTIVARIATE'
: 'STANDARD'
const isFirstFeature =
!createdFirstFeature &&
!flagsmith.getTrait('first_feature') &&
AccountStore.model &&
Expand All @@ -92,12 +96,6 @@ const controller = {
OrganisationStore.model.projects.length === 1 &&
store.model &&
(!store.model.features || !store.model.features.length)
) {
createdFirstFeature = true
flagsmith.setTrait('first_feature', 'true')
API.trackEvent(Constants.events.CREATE_FIRST_FEATURE)
window.lintrk?.('track', { conversion_id: 16798354 })
}

createProjectFlag(getStore(), {
body: Object.assign({}, flag, {
Expand Down Expand Up @@ -162,6 +160,22 @@ const controller = {
)

store.saved({ createdFlag: flag.name })
if (isFirstFeature) {
createdFirstFeature = true
flagsmith.setTrait('first_feature', 'true')
API.trackEvent(Constants.events.CREATE_FIRST_FEATURE)
flagsmith.trackEvent('first_feature_created', flag.name, {
feature_type: featureType,
project_id: projectId,
})
window.lintrk?.('track', { conversion_id: 16798354 })
} else {
flagsmith.trackEvent('feature_created', flag.name, {
feature_type: featureType,
project_id: projectId,
total_feature_count: store.model?.features?.length ?? 0,
})
}
Comment thread
Zaimwa9 marked this conversation as resolved.
}),
)
.catch((e) => API.ajaxHandler(store, e))
Expand Down Expand Up @@ -393,8 +407,7 @@ const controller = {
`${Project.api}environments/${environmentId}/featurestates/${environmentFlag.id}/`,
Object.assign({}, environmentFlag, {
enabled: flag.default_enabled,
feature_state_value:
typedValue === '' ? null : typedValue,
feature_state_value: typedValue === '' ? null : typedValue,
}),
)
})
Expand Down Expand Up @@ -934,10 +947,7 @@ const controller = {

store.model = {
features: features.results.map(controller.parseFlag),
keyedEnvironmentFeatures: keyBy(
environmentFeatures,
'feature',
),
keyedEnvironmentFeatures: keyBy(environmentFeatures, 'feature'),
}
store.loaded()
})
Expand Down
8 changes: 4 additions & 4 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@dnd-kit/abstract": "^0.3.2",
"@dnd-kit/helpers": "^0.3.2",
"@dnd-kit/react": "^0.3.2",
"@flagsmith/flagsmith": "11.0.0-internal.7",
"@flagsmith/flagsmith": "11.0.0-internal.9",
"@ionic/react": "^7.5.3",
"@react-oauth/google": "^0.2.8",
"@reduxjs/toolkit": "1.9.1",
Expand Down
Loading