@@ -7,6 +7,11 @@ import get from 'es-toolkit/compat/get';
77import { ExtendedEntitiesTypeDict } from '@/api/entitycore/types/extended-entity-type' ;
88
99import type { TExtendedEntitiesTypeDict } from '@/api/entitycore/types/extended-entity-type' ;
10+ import {
11+ FeatureFlags ,
12+ FlagKey ,
13+ inifiedSingleNeuronSimulationFlowFlag ,
14+ } from '@/features/feature-flags/flags' ;
1015
1116export const WorkflowSessionIdSearchParam = 'sessionId' ;
1217export const EntityScopeDict = {
@@ -56,6 +61,7 @@ export const EntityWorkflowConfiguration: Partial<
5661 group : TEntityScopeValue ;
5762 label : string ;
5863 properties : Partial < Record < TActivityValue , EntityTypeProperties > > ;
64+ requiredFeatures ?: Array < FlagKey > ;
5965 }
6066 >
6167> = {
@@ -117,7 +123,8 @@ export const EntityWorkflowConfiguration: Partial<
117123 } ,
118124 [ ExtendedEntitiesTypeDict . MemodelCircuit ] : {
119125 group : EntityScopeDict . Cellular ,
120- label : 'ME-model circuit' ,
126+ label : 'Single neuron [circuit]' ,
127+ requiredFeatures : [ inifiedSingleNeuronSimulationFlowFlag . key ] ,
121128 properties : {
122129 build : {
123130 disabled : true ,
@@ -253,12 +260,19 @@ export type TEntityDropdownOptionsGrouped = Array<{
253260 options : Array < EntityDropdownOption > ;
254261} > ;
255262
256- export function getDropdownOptionsByCategory ( category : TActivityValue ) : {
263+ export function getDropdownOptionsByCategory (
264+ category : TActivityValue ,
265+ featureFlags ?: FeatureFlags
266+ ) : {
257267 allOptions : Array < EntityTypeGroupedOptions > ;
258268 enabledOptions : Array < EntityTypeGroupedOptions > ;
259269} {
260270 const options = Object . values ( EntityWorkflowConfiguration )
261271 . filter ( ( config ) : config is NonNullable < typeof config > => config !== undefined )
272+ . filter (
273+ ( config ) =>
274+ ! config . requiredFeatures || config . requiredFeatures . every ( ( flag ) => featureFlags ?. [ flag ] )
275+ )
262276 . map ( ( config ) => ( {
263277 group : config . group ,
264278 label : config . label ,
@@ -300,9 +314,16 @@ export function getDropdownOptionsByCategory(category: TActivityValue): {
300314 } ;
301315}
302316
303- export function getAllOptionsOrdered ( category : TActivityValue ) : Array < EntityTypeOption > {
317+ export function getAllOptionsOrdered (
318+ category : TActivityValue ,
319+ featureFlags : FeatureFlags
320+ ) : Array < EntityTypeOption > {
304321 const options = Object . values ( EntityWorkflowConfiguration )
305322 . filter ( ( config ) : config is NonNullable < typeof config > => config !== undefined )
323+ . filter (
324+ ( config ) =>
325+ ! config . requiredFeatures || config . requiredFeatures . every ( ( flag ) => featureFlags ?. [ flag ] )
326+ )
306327 . map ( ( config ) => ( {
307328 group : config . group ,
308329 label : config . label ,
0 commit comments