Skip to content

Commit

Permalink
leds: hide activation id when not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
paradajz committed Apr 8, 2024
1 parent 0e4010f commit e035855
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/definitions/block/led/led.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Block,
LedControlMode,
HideLedActivationValueOnControlTypes,
HideLedActivationIdOnControlTypes,
HideLedMidiChannelOnControlTypes,
HideLedRgbEnableOnControlTypes,
} from "../../interface";
Expand Down Expand Up @@ -67,8 +68,10 @@ export const sections: Dictionary<ISectionDefinition> = {
helpText: ``,
block: Block.Led,
},
ActivationNote: {
key: "activationNote",
ActivationId: {
showIf: (formState: FormState): boolean =>
!HideLedActivationIdOnControlTypes.includes(formState.controlType),
key: "activationId",
type: SectionType.Value,
section: 3,
component: FormInputComponent.Input,
Expand Down
4 changes: 4 additions & 0 deletions src/definitions/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ export const HideLedActivationValueOnControlTypes = [
LedControlMode.Static,
];

export const HideLedActivationIdOnControlTypes = [
LedControlMode.Static,
];

export const HideLedMidiChannelOnControlTypes = [
LedControlMode.PresetChange,
LedControlMode.Static,
Expand Down

0 comments on commit e035855

Please sign in to comment.