Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Remove Flow rules from global rules

Robin Dekkerscfa87abfcb78
diff --git a/ui/component/or-rules/src/or-rule-list.ts b/ui/component/or-rules/src/or-rule-list.ts
index 88689c682..edb2ad4bb 100644
--- a/ui/component/or-rules/src/or-rule-list.ts
+++ b/ui/component/or-rules/src/or-rule-list.ts
@@ -154,11 +154,15 @@ export class OrRuleList extends translate(i18next)(LitElement) {
protected get _allowedLanguages(): RulesetLang[] | undefined {
const languages = this.config && this.config.controls && this.config.controls.allowedLanguages ? [...this.config.controls.allowedLanguages] : OrRuleList.DEFAULT_ALLOWED_LANGUAGES;
const groovyIndex = languages.indexOf(RulesetLang.GROOVY);
+ const flowIndex = languages.indexOf(RulesetLang.FLOW);
if(!manager.isSuperUser()) {
- if(groovyIndex > 0) languages.splice(groovyIndex);
+ if(groovyIndex > 0) languages.splice(groovyIndex,1);
} else if (groovyIndex < 0) {
languages.push(RulesetLang.GROOVY);
}
+ if(this._globalRulesets) {
+ if(flowIndex > 0) languages.splice(flowIndex, 1);
+ }
return languages;
}