Skip to content

armgit / core

Public Imported from GitHub
0

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

Filter or-rule-list based on allowedLanguages

Robin Dekkers443ae555d62e
diff --git a/ui/component/or-rules/src/or-rule-list.ts b/ui/component/or-rules/src/or-rule-list.ts
index da7a98bc9..d15ff1cfc 100644
--- a/ui/component/or-rules/src/or-rule-list.ts
+++ b/ui/component/or-rules/src/or-rule-list.ts
@@ -415,9 +415,12 @@ export class OrRuleList extends translate(i18next)(LitElement) {
protected _loadRulesets() {
const sortFunction = this._getSortFunction();
- manager.rest.api.RulesResource.getTenantRulesets(this._getRealm() || manager.config.realm, {
- fullyPopulate: true
- }).then((response: any) => {
+ const params = {
+ fullyPopulate: true,
+ language: this._allowedLanguages
+ }
+
+ manager.rest.api.RulesResource.getTenantRulesets(this._getRealm() || manager.config.realm, params).then((response: any) => {
if (response && response.data) {
this._buildTreeNodes(response.data, sortFunction);
}
@@ -436,7 +439,7 @@ export class OrRuleList extends translate(i18next)(LitElement) {
ruleset: ruleset
} as RulesetNode;
});
-
+
nodes.sort(sortFunction);
this._nodes = nodes;
diff --git a/ui/component/or-survey-results/src/index.ts b/ui/component/or-survey-results/src/index.ts
index a4040b826..4a5b77a9b 100644
--- a/ui/component/or-survey-results/src/index.ts
+++ b/ui/component/or-survey-results/src/index.ts
@@ -48,6 +48,11 @@ class OrSurveyResults extends LitElement {
};
manager.addListener(this._initCallback);
} else {
+ }
+ }
+
+ updated(_changedProperties: PropertyValues) {
+ if(_changedProperties.has('surveyId')) {
this.getSurvey();
}
}
@@ -149,15 +154,7 @@ class OrSurveyResults extends LitElement {
}
const surveyQuery: AssetQuery = {
- select: {
- excludeAttributeMeta: false,
- excludeAttributes: false,
- excludeAttributeValue: false,
- excludeAttributeTimestamp: false,
- excludeAttributeType: false
- },
- ids: [surveyId],
- types: [{predicateType: "string", value: "urn:openremote:asset:eindhoven:survey"}]
+ ids: [surveyId]
};
manager.rest.api.AssetResource.queryPublicAssets(surveyQuery).then((response) => {
diff --git a/ui/component/or-survey-results/src/style.ts b/ui/component/or-survey-results/src/style.ts
index ace9eaa10..4123f0a3f 100644
--- a/ui/component/or-survey-results/src/style.ts
+++ b/ui/component/or-survey-results/src/style.ts
@@ -5,7 +5,7 @@ export const surveyResultStyle = html`
:host {
width: 100%;
background-color: #FFFFFF;
- --internal-or-survey-results-max-width: var(--or-survey-results-max-width, 0);
+ --internal-or-survey-results-max-width: var(--or-survey-results-max-width, none);
}
.flex {