Fix identification of ruby scripts in editor (#1458)
moduleError is not used, so don't even bother setting it, and just always assign the script if it's set up in the module's configuration. this makes it easier for different scripting tools to expose their data in the editor Signed-off-by: Cody Cutrer <cody@cutrer.us>pull/1459/head
parent
c387337c19
commit
420c3ed0dd
|
@ -137,7 +137,6 @@ export default {
|
|||
currentModuleConfig: {},
|
||||
scriptModuleType: null,
|
||||
languages: null,
|
||||
moduleError: null,
|
||||
script: '',
|
||||
mode: '',
|
||||
eventSource: null,
|
||||
|
@ -257,15 +256,13 @@ export default {
|
|||
this.currentModule = this.rule.actions.concat(this.rule.conditions).find((m) => m.id === this.moduleId)
|
||||
} else {
|
||||
this.currentModule = this.rule.actions.find((m) => m.id === 'script')
|
||||
if (!this.currentModule) {
|
||||
this.currentModule = this.rule.actions.find((m) => m.configuration.script)
|
||||
}
|
||||
this.isScriptRule = true
|
||||
}
|
||||
|
||||
if (!this.currentModule ||
|
||||
this.currentModule.type.indexOf('script') !== 0 ||
|
||||
(this.currentModule.type === 'jsr223.ScriptedAction' &&
|
||||
this.currentModule.configuration.type === 'application/x-ruby')) {
|
||||
this.moduleError = true
|
||||
} else {
|
||||
if (this.currentModule) {
|
||||
this.mode = this.currentModule.configuration.type
|
||||
this.script = this.currentModule.configuration.script
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue