-
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(select): Add "Expose as" option for Listening mode in select node
- Loading branch information
Showing
6 changed files
with
111 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import ExposeAsMixin from '../../common/controllers/ExposeAsMixin'; | ||
import OutputController from '../../common/controllers/OutputController'; | ||
import ValueEntityIntegration from '../../common/integration/ValueEntityIntegration'; | ||
import { NodeMessage } from '../../types/nodes'; | ||
import { SelectNode } from '.'; | ||
|
||
const ExposeAsController = ExposeAsMixin(OutputController<SelectNode>); | ||
export default class SelectOutputController extends ExposeAsController { | ||
protected integration?: ValueEntityIntegration; | ||
|
||
public async onValueChange(value: string, previousValue?: string) { | ||
if (!this.isEnabled) return; | ||
|
||
const message: NodeMessage = {}; | ||
await this.setCustomOutputs( | ||
this.node.config.outputProperties, | ||
message, | ||
{ | ||
config: this.node.config, | ||
value, | ||
previousValue, | ||
}, | ||
); | ||
|
||
this.status.setSuccess(value); | ||
this.node.send(message); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters