@@ -9,7 +9,7 @@ export const eventMap = <T extends RuntimeEventClass>(klass: EventClass<T>): Eve
99
1010 const identifier : string = Reflect . getMetadata ( 'hercules:identifier' , klass ) ;
1111 const signature : string = Reflect . getMetadata ( 'hercules:signature' , klass ) ;
12- const settings : EventSettingProps [ ] = Reflect . getMetadata ( 'hercules:flow_settings' , klass ) || [ ] ;
12+ const settings : EventSettingProps [ ] = Reflect . getOwnMetadata ( 'hercules:flow_settings' , klass ) || [ ] ;
1313 const name : Translation [ ] = Reflect . getMetadata ( 'hercules:name' , klass ) ;
1414 const description : Translation [ ] = Reflect . getMetadata ( 'hercules:description' , klass ) ;
1515 const documentation : Translation [ ] = Reflect . getMetadata ( 'hercules:documentation' , klass ) ;
@@ -26,12 +26,12 @@ export const eventMap = <T extends RuntimeEventClass>(klass: EventClass<T>): Eve
2626 }
2727 }
2828
29- const mergedSettings : EventSettingProps [ ] = [ ... settings ] ;
30- for ( const rs of runtimeEvent . settings ?? [ ] ) {
31- if ( ! mergedSettings . find ( s => s . identifier === rs . identifier ) ) {
32- mergedSettings . push ( { ... rs } ) ;
33- }
34- }
29+ // Settings come from the runtime event (in its order); the event class only overrides
30+ // individual properties (e.g. defaultValue, hidden) per identifier.
31+ const mergedSettings : EventSettingProps [ ] = ( runtimeEvent . settings ?? [ ] ) . map ( rs => {
32+ const override = settings . find ( s => s . identifier === rs . identifier ) ;
33+ return override ? { ... rs , ... override } : { ... rs } ;
34+ } ) ;
3535
3636 return {
3737 runtimeIdentifier : runtimeEvent . identifier ,
0 commit comments