Skip to content

armgit / core

Public Imported from GitHub
0

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

UI: Remove or-survey and or-survey-results components (#2465)

Martin Peeterseabbccc18a36
diff --git a/ui/component/or-asset-viewer/src/index.ts b/ui/component/or-asset-viewer/src/index.ts
index fe12a1916..8badbd3f4 100644
--- a/ui/component/or-asset-viewer/src/index.ts
+++ b/ui/component/or-asset-viewer/src/index.ts
@@ -48,7 +48,7 @@ import {progressCircular} from "@openremote/or-mwc-components/style";
import { when } from "lit/directives/when.js";
export interface PanelConfig {
- type: "info" | "setup" | "history" | "group" | "survey" | "survey-results" | "linkedUsers" | "alarm.linkedAlarms";
+ type: "info" | "setup" | "history" | "group" | "linkedUsers" | "alarm.linkedAlarms";
title?: string;
hide?: boolean;
column?: number;
diff --git a/ui/component/or-survey-results/.npmignore b/ui/component/or-survey-results/.npmignore
deleted file mode 100644
index b2544e0f1..000000000
--- a/ui/component/or-survey-results/.npmignore
+++ /dev/null
@@ -1,9 +0,0 @@
-build/
-build.gradle
-test/
-src/
-webpack.config.js
-rspack.config.js
-tsconfig.json
-dist/*.map
-*.tsbuildinfo
diff --git a/ui/component/or-survey-results/README.md b/ui/component/or-survey-results/README.md
deleted file mode 100644
index 1115fee6c..000000000
--- a/ui/component/or-survey-results/README.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# @openremote/or-survey-results \<or-survey-results\>
-[![NPM Version][npm-image]][npm-url]
-[![Linux Build][travis-image]][travis-url]
-[![Test Coverage][coveralls-image]][coveralls-url]
-
-Web Component for displaying survey results
-
-## Install
-```bash
-npm i @openremote/or-survey-results
-yarn add @openremote/or-survey-results
-```
-
-## Usage
-For a full list of properties, methods and options refer to the TypeDoc generated [documentation]().
-
-
-## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
-
-
-## License
-[GNU AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html)
-
-[npm-image]: https://img.shields.io/npm/v/live-xxx.svg
-[npm-url]: https://npmjs.org/package/@openremote/or-header
-[travis-image]: https://img.shields.io/travis/live-js/live-xxx/master.svg
-[travis-url]: https://travis-ci.org/live-js/live-xxx
-[coveralls-image]: https://img.shields.io/coveralls/live-js/live-xxx/master.svg
-[coveralls-url]: https://coveralls.io/r/live-js/live-xxx?branch=master
diff --git a/ui/component/or-survey-results/build.gradle b/ui/component/or-survey-results/build.gradle
deleted file mode 100644
index 715a0847b..000000000
--- a/ui/component/or-survey-results/build.gradle
+++ /dev/null
@@ -1,26 +0,0 @@
-buildDir = "dist"
-
-tasks.register('clean') {
- doLast {
- delete "dist"
- delete "lib"
- }
-}
-
-tasks.register('npmAnalyze', Exec) {
- mustRunAfter npmClean
- dependsOn getYarnInstallTask()
- commandLine npmCommand("yarn"), "run", "analyze"
-}
-
-tasks.register('installDist') {
- dependsOn npmAnalyze
-}
-
-tasks.register('prepareUi') {
- dependsOn clean, npmAnalyze, npmPrepare
-}
-
-tasks.register('publishUi') {
- dependsOn clean, npmPublish
-}
diff --git a/ui/component/or-survey-results/package.json b/ui/component/or-survey-results/package.json
deleted file mode 100644
index 4e99b3e6c..000000000
--- a/ui/component/or-survey-results/package.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "name": "@openremote/or-survey-results",
- "version": "1.14.0-snapshot",
- "description": "Displays survey results",
- "customElements": "custom-elements.json",
- "main": "dist/umd/index.bundle.js",
- "module": "lib/index.js",
- "exports": {
- ".": "./lib/index.js",
- "./*": "./lib/*.js",
- "./jsx": {
- "types": "./custom-elements-jsx.d.ts"
- }
- },
- "types": "lib/index.d.ts",
- "scripts": {
- "analyze": "npx cem analyze --config ../custom-elements-manifest.config.mjs",
- "test": "echo \"No tests\" && exit 0",
- "prepack": "npx rspack"
- },
- "author": "OpenRemote",
- "license": "AGPL-3.0-or-later",
- "dependencies": {
- "@openremote/core": "workspace:*",
- "@openremote/model": "workspace:*",
- "lit": "^3.3.1"
- },
- "publishConfig": {
- "access": "public"
- }
-}
diff --git a/ui/component/or-survey-results/rspack.config.js b/ui/component/or-survey-results/rspack.config.js
deleted file mode 100644
index cd4bc1144..000000000
--- a/ui/component/or-survey-results/rspack.config.js
+++ /dev/null
@@ -1,13 +0,0 @@
-const util = require("@openremote/util");
-
-bundles = {
- "index": {
- excludeOr: true
- },
- "index.bundle": {
- excludeOr: true,
- },
- "index.orbundle": undefined
-};
-
-module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-survey-results/src/index.ts b/ui/component/or-survey-results/src/index.ts
deleted file mode 100644
index d1cf3b6a7..000000000
--- a/ui/component/or-survey-results/src/index.ts
+++ /dev/null
@@ -1,213 +0,0 @@
-import {html, LitElement, PropertyValues} from "lit";
-import {customElement, property} from "lit/decorators.js";
-import {Asset, AssetQuery} from "@openremote/model";
-import {surveyResultStyle} from "./style";
-import manager from "@openremote/core";
-
-export interface ProcessedResultAnswer {
- name: string,
- count: number
-}
-
-export interface ProcessedResult {
- name: string,
- value: ProcessedResultAnswer[]
-}
-
-export interface ProcessedResults {
- name: string;
- result: ProcessedResult[]
-}
-
-@customElement("or-survey-results")
-class OrSurveyResults extends LitElement {
-
- @property({type: Object})
- public survey?: Asset;
-
- @property({type: Array})
- public questions?: Asset[];
-
- @property({type: String})
- public surveyId?: string;
-
- @property({type: Number})
- public activeResult?: number;
-
- @property({type: Number})
- public maxAmount?: number;
-
- updated(_changedProperties: PropertyValues) {
- if(_changedProperties.has('surveyId')) {
- this.getSurvey();
- }
- }
-
- protected render() {
- if (!this.survey) {
- return html``;
- }
-
-
- let activeResult: ProcessedResults;
- let results: any = [];
- let maxAmount = 0;
-
- if (this.survey.attributes && this.survey.attributes.processedResults) {
- results = this.computeResults(this.survey.attributes.processedResults.value);
- }
-
- if (!this.activeResult) {
- activeResult = {...results[0]};
- } else {
- activeResult = {...results[this.activeResult]};
- }
-
- if (this.survey.attributes) {
- maxAmount = this.survey.attributes.responseAmount.value;
- }
-
- return html`
- ${surveyResultStyle}
- <div id="surveyResults" class="layout vertical">
-
- <div class="layout horizontal">
- ${results ? results.map((item: ProcessedResult, index: number) => {
- return html`
- <div class="button-default flex ${item.name === activeResult.name ? 'active' : ''}" @click="${() => this.changeActiveResult(index)}"> ${item.name}</div>
- `
- }) : ``}
- </div>
-
- <h4>Aantal deelnemers: ${maxAmount}</h4>
-
-
- ${activeResult && activeResult.result ? html`
- <div id="chart-container" class="layout vertical">
- <div class="chart-child layout horizontal">
- <div class="layout vertical border-right">
- <span class="flex label-y">100%</span>
- <span class="flex label-y">75%</span>
- <span class="flex label-y">50%</span>
- <span class="flex label-y">25%</span>
- </div>
-
- ${activeResult.result.map((item: ProcessedResult) => {
- return html`
- <div class="flex">
- <div class="chart">
- ${item.value.map((bar: ProcessedResultAnswer) => {
- return html`
- <div class="bar">
- <span style="height:${this.computeHeight(bar.count)};">
- <div class="bar-top-label">${this.computeHeight(bar.count)}</div>
- <label>${bar.name} (${bar.count})</label>
- </span>
- </div>
- `
- })}
- </div>
- </div>
- `
- })}
-
- </div>
-
- <div class="chart-child labels layout horizontal">
- ${activeResult.result.map((item: ProcessedResult) => {
- return html`
- <div class="flex label">
- <span class="label-x">${item.name}</span>
- </div>
- `
- })}
- </div>
- </div>
-
- ` : ``}
-
- </div>
-
-
- `;
- }
- getSurvey() {
- let surveyId: string;
- if(this.surveyId){
- surveyId = this.surveyId;
- } else {
- return;
- }
-
- const surveyQuery: AssetQuery = {
- ids: [surveyId]
- };
-
- manager.rest.api.AssetResource.queryAssets(surveyQuery).then((response) => {
- if (response && response.data) {
- this.survey = response.data[0];
- this.requestUpdate();
- }
- }).catch((reason) => {
- console.error("Error: " + reason);
- });
-
- const surveyQuestQuery: AssetQuery = {
- parents: [{id:surveyId}]
- };
-
- manager.rest.api.AssetResource.queryAssets(surveyQuestQuery).then((response) => {
- if (response && response.data) {
- this.questions = response.data;
- this.requestUpdate();
- }
- }).catch((reason) => {
- console.error("Error: " + reason);
- });
-
- }
-
- computeHeight(barAmount: number) {
- if (barAmount && this.survey && this.survey.attributes) {
- const maxAmount = this.survey.attributes.responseAmount.value;
- return Math.round((barAmount / maxAmount) * 100)+"%";
- } else {
- return "0%";
- }
- }
-
- computeResults(results: ProcessedResult[]) {
- if (!results) {
- return;
- }
- const computedResults = results.map((category: any) => {
- const categoryName = Object.keys(category)[0];
- return {
- name: categoryName,
- result: category[categoryName].map((question: any) => {
- const questionId = Object.keys(question)[0];
- const assetQuestion = this.questions ? this.questions.find((question)=> question.id === questionId) : null
- return {
- name: assetQuestion ? assetQuestion.name : "",
- value: question[questionId].map((answer: any) => {
- const answerName = Object.keys(answer)[0];
- const amount = answer[answerName];
- if (typeof amount === "number" &&
- isFinite(amount) &&
- Math.floor(amount) === amount) {
- return {name: answerName, count: amount}
- }
- })
- }
- })
- }
- });
-
- return computedResults;
- }
-
- changeActiveResult(index: number) {
- this.activeResult = index;
- }
-
-}
diff --git a/ui/component/or-survey-results/src/style.ts b/ui/component/or-survey-results/src/style.ts
deleted file mode 100644
index 2960b60e1..000000000
--- a/ui/component/or-survey-results/src/style.ts
+++ /dev/null
@@ -1,181 +0,0 @@
-import { html } from "lit";
-
-export const surveyResultStyle = html`
-<style>
- :host {
- width: 100%;
- background-color: #FFFFFF;
- --internal-or-survey-results-max-width: var(--or-survey-results-max-width, none);
- }
-
- .flex {
- -ms-flex: 1 1 0.000000001px;
- -webkit-flex: 1;
- flex: 1;
- -webkit-flex-basis: 0.000000001px;
- flex-basis: 0.000000001px;
- }
- .layout.horizontal,
- .layout.vertical {
- display: -ms-flexbox;
- display: -webkit-flex;
- display: flex;
- }
- .layout.horizontal {
- -ms-flex-direction: row;
- -webkit-flex-direction: row;
- flex-direction: row;
- }
- .layout.vertical {
- -ms-flex-direction: column;
- -webkit-flex-direction: column;
- flex-direction: column;
- }
-
- .button-default {
- cursor: pointer;
- margin: auto 1px;
- background-color: #EF9091;
- padding: 10px 20px;
- border-radius: 0;
- color: #FFFFFF;
- }
-
- .button-default.active {
- background-color: var(--or-survey-color-button, var(--app-primary-color))
- }
-
- .bar span {
- background-color: #F3C11F;
- }
-
- .bar:nth-child(2n+2) span {
- background-color: #4A99BA;
- }
-
- .bar:nth-child(3n+3) span {
- background-color: #23B099;
- }
-
- .bar:nth-child(4n+4) span {
- background-color: #EA8D31;
- }
-
- .bar:nth-child(5n+5) span {
- background-color: #e32527;
- }
-
- .label {
- }
-
- .label-x {
- display: block;
- margin: 0 10px;
- }
-
- #chart-container {
- padding-top: 20px;
- margin: auto;
- width: 100%;
- max-width: var(--internal-or-survey-results-max-width);
- overflow-x: scroll;
- }
-
- .chart {
- display: table;
- table-layout: fixed;
-
- width: 200px;
- height: 300px;
- margin: 0 auto;
- border-right: 1px solid grey;
- }
-
- .bar {
- position: relative;
- vertical-align: bottom;
- height: 300px;
- width: 25px;
- float: left;
- }
-
- .bar span {
- box-sizing: border-box;
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
-
- position: absolute;
- bottom: 0;
- display: block;
- min-height: 5px;
- height: 50%;
- width: 90%;
- animation: draw 1s ease-in-out;
-
- -moz-transition: height 1s ease-in-out;
- -webkit-transition: height 1s ease-in-out;
- -o-transition: height 1s ease-in-out;
- transition: height 1s ease-in-out;
- }
-
- .bar span label {
- z-index: 1;
- position: absolute;
- left: 0;
- right: 0;
- top: 50%;
- width: 150px;
- padding: 5px 1em 0;
- display: none;
- }
-
- .bar:hover span label {
- display: block;
- }
-
- .labels .label {
- padding-top: 20px;
- border-top: 1px solid var(--app-darkgrey);
- min-width: 200px;
- margin-bottom: 20px;
- }
-
- .labels .label:first-child {
- margin-left: 46px;
- }
-
- .label-y {
- position: relative;
- margin-right: 10px;
- font-size: 14px;
- border-top: 1px solid grey;
- }
-
- .label-y:after {
- display: block;
- content: '';
- position: absolute;
- }
-
- .border-right {
- border-right: 1px solid var(--app-darkgrey);
- margin-right: 10px;
- }
-
- .bar-top-label {
- text-align: center;
- position: relative;
- margin-top: -16px;
- line-height: 12px;
- font-size: 11px;
- }
-
- @keyframes draw {
- 0% {
- height: 0;
- }
- }
-
-
-</style>
-`;
\ No newline at end of file
diff --git a/ui/component/or-survey-results/tsconfig.json b/ui/component/or-survey-results/tsconfig.json
deleted file mode 100644
index 36a7c304b..000000000
--- a/ui/component/or-survey-results/tsconfig.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "extends": "../../tsconfig",
- "compilerOptions": {
- "outDir": "./lib",
- "rootDir": "src"
- },
- "include": [
- "./src"
- ],
- "references": [
- { "path": "../core" },
- { "path": "../rest" }
- ]
-}
diff --git a/ui/component/or-survey/.npmignore b/ui/component/or-survey/.npmignore
deleted file mode 100644
index b2544e0f1..000000000
--- a/ui/component/or-survey/.npmignore
+++ /dev/null
@@ -1,9 +0,0 @@
-build/
-build.gradle
-test/
-src/
-webpack.config.js
-rspack.config.js
-tsconfig.json
-dist/*.map
-*.tsbuildinfo
diff --git a/ui/component/or-survey/README.md b/ui/component/or-survey/README.md
deleted file mode 100644
index 1b8d4c65b..000000000
--- a/ui/component/or-survey/README.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# @openremote/or-survey \<or-survey\>
-[![NPM Version][npm-image]][npm-url]
-[![Linux Build][travis-image]][travis-url]
-[![Test Coverage][coveralls-image]][coveralls-url]
-
-Web Component for displaying a survey.
-
-## Install
-```bash
-npm i @openremote/or-survey
-yarn add @openremote/or-survey
-```
-
-## Usage
-For a full list of properties, methods and options refer to the TypeDoc generated [documentation]().
-
-
-## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
-
-
-## License
-[GNU AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html)
-
-[npm-image]: https://img.shields.io/npm/v/live-xxx.svg
-[npm-url]: https://npmjs.org/package/@openremote/or-header
-[travis-image]: https://img.shields.io/travis/live-js/live-xxx/master.svg
-[travis-url]: https://travis-ci.org/live-js/live-xxx
-[coveralls-image]: https://img.shields.io/coveralls/live-js/live-xxx/master.svg
-[coveralls-url]: https://coveralls.io/r/live-js/live-xxx?branch=master
diff --git a/ui/component/or-survey/build.gradle b/ui/component/or-survey/build.gradle
deleted file mode 100644
index 715a0847b..000000000
--- a/ui/component/or-survey/build.gradle
+++ /dev/null
@@ -1,26 +0,0 @@
-buildDir = "dist"
-
-tasks.register('clean') {
- doLast {
- delete "dist"
- delete "lib"
- }
-}
-
-tasks.register('npmAnalyze', Exec) {
- mustRunAfter npmClean
- dependsOn getYarnInstallTask()
- commandLine npmCommand("yarn"), "run", "analyze"
-}
-
-tasks.register('installDist') {
- dependsOn npmAnalyze
-}
-
-tasks.register('prepareUi') {
- dependsOn clean, npmAnalyze, npmPrepare
-}
-
-tasks.register('publishUi') {
- dependsOn clean, npmPublish
-}
diff --git a/ui/component/or-survey/package.json b/ui/component/or-survey/package.json
deleted file mode 100644
index 0d3b323c3..000000000
--- a/ui/component/or-survey/package.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "name": "@openremote/or-survey",
- "version": "1.14.0-snapshot",
- "description": "Displays survey",
- "customElements": "custom-elements.json",
- "main": "dist/umd/index.bundle.js",
- "module": "lib/index.js",
- "exports": {
- ".": "./lib/index.js",
- "./*": "./lib/*.js",
- "./jsx": {
- "types": "./custom-elements-jsx.d.ts"
- }
- },
- "types": "lib/index.d.ts",
- "scripts": {
- "analyze": "npx cem analyze --config ../custom-elements-manifest.config.mjs",
- "test": "echo \"No tests\" && exit 0",
- "prepack": "npx rspack"
- },
- "author": "OpenRemote",
- "license": "AGPL-3.0-or-later",
- "dependencies": {
- "@openremote/core": "workspace:*",
- "@openremote/model": "workspace:*",
- "@openremote/or-translate": "workspace:*",
- "@types/lodash-es": "^4.17.5",
- "lit": "^3.3.1",
- "lodash-es": "^4.17.15",
- "moment": "2.29.4"
- },
- "publishConfig": {
- "access": "public"
- }
-}
diff --git a/ui/component/or-survey/rspack.config.js b/ui/component/or-survey/rspack.config.js
deleted file mode 100644
index e726d4269..000000000
--- a/ui/component/or-survey/rspack.config.js
+++ /dev/null
@@ -1,13 +0,0 @@
-const util = require("@openremote/util");
-
-bundles = {
- "index": {
- excludeOr: true
- },
- "index.bundle": {
- excludeOr: true,
- },
- "index.orbundle": undefined
-};
-
-module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-survey/src/index.ts b/ui/component/or-survey/src/index.ts
deleted file mode 100644
index 08fe3a56c..000000000
--- a/ui/component/or-survey/src/index.ts
+++ /dev/null
@@ -1,452 +0,0 @@
-import {html, LitElement, PropertyValues} from "lit";
-import {customElement, property} from "lit/decorators.js";
-import {Asset, AssetQuery} from "@openremote/model";
-import {surveyLayoutStyle, surveySectionStyle} from "./style";
-import set from "lodash-es/set";
-import get from "lodash-es/get";
-import orderBy from "lodash-es/orderBy";
-
-import * as momentImported from 'moment';
-import manager, {EventCallback} from "@openremote/core";
-import filter from "lodash-es/filter";
-import "@openremote/or-translate";
-
-const moment = momentImported;
-
-export interface OrComputeGridEventDetail {
-}
-
-export class OrComputeGridEvent extends CustomEvent<OrComputeGridEventDetail> {
-
- public static readonly NAME = "or-asset-viewer-compute-grid-event";
-
- constructor() {
- super(OrComputeGridEvent.NAME, {
- bubbles: true,
- composed: true
- });
- }
-}
-export interface AnswerOption {
- value: string
-}
-
-export interface SurveyAnswers {
- [key: string]: string | string[]
-}
-
-@customElement("or-survey")
-class OrSurvey extends LitElement {
-
- @property({type: Object})
- public survey?: Asset;
-
- @property({type: String})
- public surveyId?: string;
-
- @property({type: Boolean})
- public isAddingQuestion?: boolean;
-
- @property({type: Boolean})
- public hasIntroQuestion?: boolean;
-
- @property({type: Object})
- public question?: Asset;
-
- @property({type: Object})
- public surveyAnswers?: SurveyAnswers;
-
- @property({type: Array})
- public questions?: Asset[];
-
- public readonly?: boolean;
-
- public questionIndex?: number;
- public questionIndexLabel?: number;
-
- public nextButtonLabel?: string;
-
- @property({type: Boolean})
- public saveanswers?: boolean;
-
- @property({type: Boolean})
- public completed?: boolean;
-
- @property({type: Boolean})
- public hasSubmission?: boolean;
-
- @property({type: Boolean})
- public previousButton?: boolean;
-
- @property({type: Boolean})
- public nextButton?: boolean;
-
- public questionAnimation?: string;
-
- protected _initCallback?: EventCallback;
-
- constructor() {
- super();
-
- this.resetSurvey();
- this.questions = [];
- this.completed = false;
- }
-
- protected render() {
- if (!this.survey) {
- return html``;
- }
-
- const orderedQuestions = orderBy(this.questions, ['attributes.order.value'],['asc']);
- const status = this.checkAssetPeriode(this.survey);
- let currentAnswer:string | string[];
-
- if(this.questions && this.questionIndex && this.questions[this.questionIndex]) {
- const currentQuestion = this.questions[this.questionIndex];
- if(currentQuestion && currentQuestion.id && this.surveyAnswers) {
- currentAnswer = this.surveyAnswers[currentQuestion.id];
- }
- }
-
- return html`
- ${surveySectionStyle}
- ${surveyLayoutStyle}
- <div id="surveyQuestions">
- ${this.completed || this.hasSubmission ? html`
- <p>${this.survey.attributes ? this.survey.attributes.thankYouMessage.value : ''}</p>
- ${!this.saveanswers ? html`
- <button visible="${this.previousButton}" class="previous" @click="${this.resetSurvey}"
- aria-label="To survey"><or-translate value="To survey"></or-translate>
- <svg viewBox="0 0 32 32" class="icon icon-chevron-left" viewBox="0 0 32 32" aria-hidden="true"><path d="M14.19 16.005l7.869 7.868-2.129 2.129-9.996-9.997L19.937 6.002l2.127 2.129z"/></svg>
- </button>
- ` : ``}
- ` : html`
- ${status === 'before' ? html`
- <p>${this.survey.attributes ? this.survey.attributes.beforeValidMessage.value : ''}</p>
- ` : ``}
-
- ${status === 'after' ? html`
- <p>${this.survey.attributes ? this.survey.attributes.afterValidMessage.value : ''}</p>
- ` : ``}
-
- ${status === 'live' || (status === 'not_published' && !this.saveanswers) ? html`
- ${orderedQuestions.map((question: Asset, index:number) => {
-
- return html`
- ${get(question, 'attributes.active.value') && index === this.questionIndex ? html`
- <div class="${this.questionAnimation}">
- <p>${question.name}</p>
-
- <div id="survey-container" style="flex-wrap: wrap;" class="layout horizontal ${this.questionAnimation}">
-
- ${this.getType(question.type) === 'text' ? html`
- <textarea rows="4" class="text-input" type="${this.getInputType(question.type)}" id="${question.id}" name="${question.id}_${index}">${currentAnswer}</textarea>
- ` : html`
- ${question.attributes && question.attributes.answerOptions.value.map((answer:AnswerOption, index:number) => {
- return html`
- <div class="answer-card ${this.getType(question.type)}">
-
- ${!currentAnswer ? html`
- <input type="${this.getInputType(question.type)}" id="${question.id}_${index}"
- name="${question.id}" value="${answer.value}"
- autofocus />
- `: html`
- ${this.getType(question.type) === 'multiSelect' ? html`
- <input type="${this.getInputType(question.type)}" id="${question.id}_${index}"
- name="${question.id}" value="${answer.value}"
- ?checked="${currentAnswer.includes(answer.value)}"
- autofocus />
- ` : html`
- <input type="${this.getInputType(question.type)}" id="${question.id}_${index}"
- name="${question.id}" value="${answer.value}"
- ?checked="${currentAnswer === answer.value}"
- autofocus />
- `}
- `}
- <label class="flex-grow" @click="${(e:Event) => this.onAnswer(e, answer)}" for="${question.id}_${index}">
- ${answer.value}
- </label>
- </div>
- `})}
- `}
-
- </div>
- </div>
-
- ` : ``}
- `})}
-
- <div style="margin-top:20px;" class="layout horizontal justified center-center">
- <button ?visible="${this.previousButton}" class="previous" @click="${this.previousQuestion}"
- aria-label="Previous">
- <or-translate value="Previous"></or-translate>
- <svg viewBox="0 0 32 32" class="icon icon-chevron-left" viewBox="0 0 32 32" aria-hidden="true"><path d="M14.19 16.005l7.869 7.868-2.129 2.129-9.996-9.997L19.937 6.002l2.127 2.129z"/></svg>
- </button>
- <div style="line-height: 40px;" class="flex-grow t-center">${this.questionIndexLabel} / ${this.questions ? this.questions.length : 0}</div>
- <button ?visible="${this.nextButton}" class="next" @click="${this.onAnswer}" data-autoforward="true"
- aria-label="${this.nextButtonLabel}">
- <or-translate value="${this.nextButtonLabel}"></or-translate>
- <svg viewBox="0 0 32 32" class="icon icon-chevron-right" viewBox="0 0 32 32" aria-hidden="true"><path d="M18.629 15.997l-7.083-7.081L13.462 7l8.997 8.997L13.457 25l-1.916-1.916z"/></svg>
- </button>
- </div>
-
- ` : ``}
- `}
- </div>
-
-
- `;
- }
-
- protected firstUpdated(_changedProperties: PropertyValues): void {
- super.firstUpdated(_changedProperties);
- this.getSurvey();
- }
-
- protected updated(_changedProperties: PropertyValues): void {
- super.updated(_changedProperties);
- if(_changedProperties.has('survey') || _changedProperties.has('surveyId')) {
- this.resetSurvey();
- }
-
- this.dispatchEvent(new OrComputeGridEvent())
- }
-
- checkAssetPeriode(asset:Asset) {
- const today = moment();
- const startDate = get(asset, 'attributes.validity.value.start');
- const endDate = get(asset, 'attributes.validity.value.end');
- // not published
- if(get(asset, 'attributes.published.value') === false) {
- return 'not_published';
- } else if(today.diff(startDate) > 0 && today.diff(endDate) < 0) {
- // between dates
- return 'live';
- } else if (today.diff(startDate) < 0) {
- // before start date
- return 'before';
- } else if (today.diff(endDate) > 0) {
- // after end date
- return 'after';
- } else {
- return 'not_published'
- }
- }
-
- getInputType(type:string|undefined) {
- if (type) {
- if (type.includes('singleSelect') || type.includes('rating')) {
- return "radio";
- }
- else if (type.includes('multiSelect')) {
- return "checkbox";
- }
- else if (type.includes('text')) {
- return "text";
- }
- }
- }
-
- getType(type:string|undefined) {
- if (type) {
- const parts = type.split(':');
- const label = parts[parts.length - 1];
- return label;
- }
- }
-
- checkButtons() {
- if(!this.survey || !this.questions || typeof this.questionIndex === "undefined") {
- return;
- }
-
- this.questions.sort((a, b) => a.attributes && b.attributes ? a.attributes.order.value - b.attributes.order.value : 0);
- this.questions = [...this.questions];
-
- if (this.questionIndex > 0) {
- this.previousButton = true;
- this.nextButton = true;
- } else {
- if(this.questions[0]) {
- if(this.questions[0].attributes && !this.questions[0].attributes.categorizeInResult.value) {
- this.nextButton = true;
- }else{
- this.nextButton = false;
- }
- }
- this.previousButton = false;
- }
-
- if (this.questionIndex + 1 === this.questions.length) {
- this.nextButtonLabel= 'Send';
- } else {
- this.nextButtonLabel= 'Next';
- }
-
- if(this.questionIndex === this.questions.length && this.questions.length !== 0) {
- this.completed = true;
- if (this.survey.attributes && this.survey.attributes.published.value && this.saveanswers) {
- localStorage.setItem('survey'+this.survey.id, "set");
-
- const xhttp = new XMLHttpRequest();
- const url = manager.managerUrl ? manager.managerUrl+"/rest/survey/" : window.location.origin+"/rest/survey/";
- xhttp.open("POST", url + this.survey.id, true);
- xhttp.setRequestHeader("Content-type", "application/json");
- xhttp.send(JSON.stringify(this.surveyAnswers));
- }
- }
-
- this.requestUpdate();
- }
-
- nextQuestion() {
- if(typeof this.questionIndex === 'undefined' || typeof this.questionIndexLabel === 'undefined' ) {
- return;
- }
-
- this.questionAnimation = 'moveIn';
- this.questionIndex = this.questionIndex + 1;
- this.questionIndexLabel = this.questionIndexLabel + 1;
- this.checkButtons();
- }
-
- resetSurvey() {
- this.questionIndex = 0;
- this.questionIndexLabel = 1;
- this.nextButtonLabel = "Next";
- this.completed = false;
- this.surveyAnswers = {};
- this.checkButtons();
- }
-
- previousQuestion() {
- if(typeof this.questionIndex === 'undefined' || typeof this.questionIndexLabel === 'undefined' ) {
- return;
- }
-
- this.questionAnimation = 'moveOut';
- this.questionIndex = this.questionIndex - 1;
- this.questionIndexLabel = this.questionIndexLabel - 1;
- this.checkButtons();
- }
-
- onAnswer(e: Event, answer:AnswerOption) {
- if(!this.questions || typeof this.questionIndex === 'undefined' || typeof this.questionIndexLabel === 'undefined' ) {
- return;
- }
- const target = e.currentTarget;
- const surveyAnswers = this.surveyAnswers;
- const currQuestion = this.questions[this.questionIndex];
- if (this.getType(currQuestion.type) === "singleSelect" || this.getType(currQuestion.type) === "rating") {
- if (!(target instanceof HTMLButtonElement) && !(target instanceof HTMLLabelElement)) {
- return;
- }
- if (target && target.dataset.autoforward === "true") {
- this.nextQuestion();
- } else {
- if(currQuestion && currQuestion.id && surveyAnswers){
- surveyAnswers[currQuestion.id] = answer.value;
- this.surveyAnswers = surveyAnswers;
- this.nextQuestion();
- }
- }
-
- }
- else if (this.getType(currQuestion.type) === "text") {
- const id = this.questions[this.questionIndex].id;
- if(this.shadowRoot && id) {
- const element = this.shadowRoot.getElementById(id) as HTMLInputElement;
- if (element && currQuestion && currQuestion.id && surveyAnswers) {
- const value = element.value;
- surveyAnswers[currQuestion.id] = value;
- }
- }
- this.nextQuestion();
- }
- else if (this.getType(currQuestion.type) === "multiSelect") {
- if (!(target instanceof HTMLButtonElement) && !(target instanceof HTMLLabelElement)) {
- return;
- }
-
- if (target.dataset.autoforward === "true") {
- this.nextQuestion();
- } else {
- if(currQuestion && currQuestion.id && surveyAnswers && target instanceof HTMLLabelElement) {
- if (!surveyAnswers[currQuestion.id]) {
- surveyAnswers[currQuestion.id] = [];
- }
- const array = surveyAnswers[currQuestion.id];
- if(this.shadowRoot && Array.isArray(array)) {
- const input = this.shadowRoot.getElementById(target.htmlFor) as HTMLInputElement;
- if (!input.checked) {
- array.push(answer.value);
- } else {
- // Delete answer from array
- const index = surveyAnswers[currQuestion.id].indexOf(answer.value);
- array.splice(index, 1);
- }
- this.surveyAnswers = surveyAnswers;
- }
- }
- }
- }
- }
-
- getSurvey() {
- let surveyId: string;
- if (location.hash.indexOf('survey') !== -1) {
- surveyId = location.hash.split('/')[1];
- if(!surveyId) {
- this.checkButtons();
- return;
- }
- } else if(this.surveyId){
- surveyId = this.surveyId;
- } else {
- this.checkButtons();
- return;
- }
-
- const surveyQuery: AssetQuery = {
- ids: [surveyId],
- types: ["SurveyAsset"]
- };
- manager.rest.api.AssetResource.queryAssets(surveyQuery).then((response) => {
- if (response && response.data) {
- this.survey = response.data[0];
- this.requestUpdate();
- }
- }).catch((reason) => {
- console.error("Error: " + reason);
- });
-
- if(localStorage.getItem('survey'+surveyId) && this.saveanswers){
- this.hasSubmission = true;
- return;
- }
-
- const questionQuery: AssetQuery = {
- types: ["SurveyQuestionAsset"]
- };
-
- manager.rest.api.AssetResource.queryAssets(questionQuery).then((response) => {
- if (response && response.data) {
- const questions = response.data;
- questions.sort((a, b) => a.attributes && b.attributes ? a.attributes.order.value - b.attributes.order.value : 0);
- this.questions = [...questions];
-
- if(this.survey){
- this.questions = filter(this.questions, ['parentId', this.survey.id]);
- }
-
- this.checkButtons();
- this.requestUpdate();
-
- }
- }).catch((reason) => {
- console.error("Error: " + reason);
- });
- }
-
-}
diff --git a/ui/component/or-survey/src/style.ts b/ui/component/or-survey/src/style.ts
deleted file mode 100644
index 155bc137d..000000000
--- a/ui/component/or-survey/src/style.ts
+++ /dev/null
@@ -1,573 +0,0 @@
-import { html, unsafeCSS } from "lit";
-import {DefaultColor1, DefaultColor2,DefaultColor3, DefaultColor4, DefaultColor5, DefaultColor6, DefaultColor7} from "@openremote/core";
-
-export const surveySectionStyle = html`
-<style>
- :host {
- display: flex;
- flex-direction: column;
-
- --internal-or-survey-color-button: var(--or-survey-color-button, var(--or-app-color1, ${unsafeCSS(DefaultColor1)}));
- --internal-or-survey-color-button-color: var(--or-survey-color-button-icon, #FFFFFF);
- --internal-or-survey-color-lightgrey: var(--or-survey-color, var(--or-app-color1, ${unsafeCSS(DefaultColor1)}));
- --internal-or-survey-color-grey: var(--or-survey-color, var(--or-app-color1, ${unsafeCSS(DefaultColor1)}));
-
- --internal-or-survey-color: var(--or-survey-color1, var(--or-app-color1, ${unsafeCSS(DefaultColor1)}));
- --internal-or-survey-color2: var(--or-survey-color2, var(--or-app-color2, ${unsafeCSS(DefaultColor2)}));
- --internal-or-survey-color3: var(--or-survey-color3, var(--or-app-color3, ${unsafeCSS(DefaultColor3)}));
- --internal-or-survey-color4: var(--or-survey-color4, var(--or-app-color4, ${unsafeCSS(DefaultColor4)}));
- --internal-or-survey-color5: var(--or-survey-color5, var(--or-app-color5, ${unsafeCSS(DefaultColor5)}));
- --internal-or-survey-color6: var(--or-survey-color6, var(--or-app-color6, ${unsafeCSS(DefaultColor6)}));
- --internal-or-survey-color7: var(--or-survey-color7, var(--or-app-color7, ${unsafeCSS(DefaultColor7)}));
-
-
- }
-
- .shadow {
- -webkit-box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.21);
- -moz-box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.21);
- box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.21);
- }
-
- .layout.horizontal {
- display: flex;
- flex-direction: row;
- }
-
- .layout.vertical {
- display: flex;
- flex-direction: column;
- }
-
- .center {
- justify-content: center;
- align-items: center;
- }
-
- .t-center {
- text-align: center;
- }
-
- .flex-grow {
- flex: 1 1 0;
- }
-
- :host input {
- margin-bottom: 20px;
- }
-
- label {
- font-size: 14px;
- background-color: var(--internal-or-survey-color-grey);
- }
-
-
- button {
- font-size: 14px;
- height: 40px;
- background-color: var(--internal-or-survey-color-button);
- margin-left: auto;
- color: #FFF;
- font-weight: bold;
- cursor: pointer;
- padding: 0 20px;
- border-width: initial;
- border-style: none;
- border-color: initial;
- border-image: initial;
- border-radius: 5px;
- }
-
- .square-button {
- padding: 10px;
- background-color: var(--internal-or-survey-color-lightgrey);
- }
-
- .square-button or-icon {
- --or-icon-height: 16px;
- --or-icon-width: 16px;
- --or-icon-fill: var(--internal-or-survey-color-grey);
- }
-
- .square-button:hover {
- background-color: var(--internal-or-survey-color2);
- }
-
- .square-button:hover or-icon {
- --or-icon-fill: #FFFFFF;
- }
-
- .button-text {
- font-weight: bold;
- color: var(--internal-or-survey-color2);
- margin-bottom: 20px;
- }
-
- .button-text or-icon {
- --or-icon-height: 20px;
- --or-icon-width: 20px;
- }
-
- a {
- cursor: pointer;
- }
-
- or-icon {
- --or-icon-width: 24px;
- --or-icon-height: 24px;
- --or-icon-fill: var(--internal-or-survey-color-grey);
- }
-
- button or-icon {
- --or-icon-fill: #FFF;
- }
-
- a:hover > or-icon {
- --or-icon-fill: var(--internal-or-survey-color2);
- }
-
- .option-item .draggable,
- .option-item .delete-button {
- opacity: 0;
- }
-
- .option-item {
- margin: 0 -30px;
- padding: 0 30px;
- }
-
- .indented {
- margin-left: 40px;
- }
-
- .add-answer-option {
- margin-left: 70px;
- }
-
- .option-item:hover {
- background-color: #f2f2f2;
- }
-
- .option-item:hover .draggable,
- .option-item:hover .delete-button {
- opacity: 1;
- }
-
- .draggable-container {
- position: relative;
- }
-
- .question-item {
- position: relative;
- width: 100%;
- display: grid;
- align-items: center;
- box-sizing: border-box;
- user-select: none;
-
- transition: none;
- z-index: 1;
-
- background: white;
- font-family: sans-serif;
- }
-
- .question-item.nudgeDown:not(.dragged) {
- transform: translate3d(0, 48px, 0);
- }
-
- .question-item.nudgeUp:not(.dragged) {
- transform: translate3d(0, -48px, 0);
- }
-
- .question-item.dragged {
- box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
- transition: none;
- }
-
- .dragging > .question-item:not(.dragged) {
- transition: transform 0.2s ease-out;
- }
-
- .draggable {
- cursor: pointer;
- position: absolute;
- left: -24px;
- z-index: 1;
- }
- .draggable or-icon {
- margin-top: 10px;
- --or-icon-fill: var(--app-grey-color);
- }
-
- input {
- padding: 5px 0 8px;
- margin-bottom: 30px;
- color: #333333;
- font-size: 16px;
- border-color: #f2f2f2;
- }
-
- input[disabled] {
- background-color: var(--app-lightgrey-color);
- color: var(--app-grey-color);
- }
- label {
- color: #808080;
- font-size: 12px;
- font-weight: bold;
- }
-</style>
-`;
-
-export const surveyLayoutStyle =html`
-<style>
- :host {
- width: 100%;
- background-color: #FFFFFF;
- }
-
-
-
- #surveyQuestions {
- width: 100%;
- overflow: hidden;
- }
-
- button-default > *:focus {
- background-color: transparent
- }
-
- p {
- text-align: center;
- }
-
- input {
- display: none;
- }
-
- input.text-input {
- display: block;
- }
-
- .answer-card {
- flex: 1;
- flex-grow: 1;
- flex-basis: 0;
- }
-
- .answer-card {
- background-color: var(--internal-or-survey-color1, #F3C11F);
- margin-left: 5px;
- border: 3px solid white;
-
- box-sizing: border-box;
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- }
-
- .answer-card:first-child {
- margin-left: 0;
- }
-
- .answer-card:nth-of-type(1),
- .answer-card:nth-of-type(5),
- .answer-card:nth-of-type(9){
- background-color: var(--internal-or-survey-color1, #F3C11F);
- }
-
- .answer-card:nth-of-type(2),
- .answer-card:nth-of-type(6),
- .answer-card:nth-of-type(10){
- background-color: var(--internal-or-survey-color2, #4A99BA);
- }
-
- .answer-card:nth-of-type(3),
- .answer-card:nth-of-type(7),
- .answer-card:nth-of-type(11){
- background-color: var(--internal-or-survey-color3, #23B099);
- }
-
- .answer-card:nth-of-type(4),
- .answer-card:nth-of-type(8),
- .answer-card:nth-of-type(12){
- background-color: var(--internal-or-survey-color4, #EA8D31);
- }
-
-
- .answer-card.rating {
- border: none;
- background-color: transparent;
- }
-
- .answer-card.rating label {
- border-radius: 50%;
- background-color: var(--or-survey-color-button, #e32527);
-
- line-height: 30px;
- width: 30px;
- height: 30px;
- padding: 10px;
- }
-
- button {
- cursor: pointer;
- visibility: hidden;
- position: relative;
- -moz-appearance: none;
- -webkit-appearance: none;
- -moz-border-radius: 2px;
- -webkit-border-radius: 2px;
- border-radius: 2px;
- font-family: Arial, "Open Sans", sans-serif;
- text-align: center;
- border: 0;
- color: #fff;
- text-decoration: none;
- padding: .625rem calc(2.5rem + 10px) .625rem 1.25rem;
- background-color: var(--or-survey-color-button, #e32527);
- font-size: 18px;
- font-weight: 300;
-
- }
-
-
- button or-icon {
- margin-right: 20px;
- }
-
- button[visible] {
- visibility: visible;
- }
-
- button.previous {
- padding: .625rem 1.25rem .625rem calc(2.5rem + 10px);
- }
-
- button.previous .icon {
- width: 2.5rem;
- fill: var(--internal-or-survey-color-button-color);
- color: var(--internal-or-survey-color-button-color);
-
- position: absolute;
- left: 0;
- top: 0;
- height: 20px;
- padding: 10px 0;
- }
-
- button.next .icon {
- width: 2.5rem;
- fill: var(--internal-or-survey-color-button-color);
- color: var(--internal-or-survey-color-button-color);
-
- position: absolute;
- right: 0;
- top: 0;
- height: 20px;
- padding: 10px 0;
- }
-
- input {
- margin: 0 0 20px;
- padding: 8px;
- }
-
- input + label {
- font-size: 18px;
- color: #FFFFFF;
- display: block;
- text-align: center;
- opacity: 0.87;
- margin: 10px;
- padding: 40px;
-
- height: calc(100% - 60px);
- cursor: pointer;
- -ms-transform: scale(0.8);
- -webkit-transform: scale(0.8);
- transform: scale(0.8);
-
- -webkit-transition: transform 0.15s;
- -moz-transition: transform 0.15s;
- -o-transition: transform 0.15s;
- transition: transform 0.15s;
- background-color: transparent;
- }
-
- input + label:hover {
- opacity: 1;
- -ms-transform: scale(1);
- -webkit-transform: scale(1);
- transform: scale(1);
- }
-
-
-
- input[type="checkbox"]:checked + label,
- input[type="radio"]:checked + label {
- opacity: 1;
- -ms-transform: scale(1);
- -webkit-transform: scale(1);
- transform: scale(1);
- },
-
- input[type="radio"]:checked + label,
- input[type="checkbox"]:checked {
- border: 3px solid white;
- }
-
- textarea {
- flex-grow: 1;
- border: 1px solid var(--or-app-color3);
- height: 4em;
- line-height: 16px;
- }
-
- .answer-icon {
- width: 20px;
- height: 20px;
- display: block;
- margin: auto;
- font-size: 16px;
- line-height: 20px;
- font-weight: bold;
- border: 3px solid var(--app-white);
- border-radius: 5px;
- margin-bottom: 5px;
- }
-
- #survey-container {
- -ms-flex-pack: center;
- -webkit-justify-content: center;
- justify-content: center;
- }
- .answer-card {
- width: 25%;
- min-width: 25%;
- max-width: 25%;
- flex-grow: 1;
- flex-basis: auto;
- margin-left: 0px;
- }
- @media (max-width: 1480px) {
- .answer-card {
- width: 50%;
- min-width: 50%;
- max-width: 50%;
- flex-grow: 1;
- flex-basis: auto;
- margin-left: 0px;
- }
- }
- input + label {
- padding: 20px;
- }
-
- .answer-card.rating {
- width: 20%;
- min-width: 20%;
- max-width: 20%;
- }
- textarea {
- height: 4em;
- line-height: 16px;
- }
-
- #survey-container.moveIn {
- -webkit-animation: moveIn .6s 1 forwards;
- animation: moveIn .6s 1 forwards;
- }
- #survey-container.moveOut {
- -webkit-animation: moveOut .6s 1 forwards;
- animation: moveOut .6s 1 forwards;
- }
- @-webkit-keyframes moveIn {
- 0% {
- -webkit-transform: translate(100%);
- -moz-transform: translate(100%);
- -ms-transform: translate(100%);
- -o-transform: translate(100%);
- transform: translate(100%);
- }
- 100% {
- -webkit-transform: translate(0%);
- -moz-transform: translate(0%);
- -ms-transform: translate(0%);
- -o-transform: translate(0%);
- transform: translate(0%);
- }
- }
- @keyframes moveIn {
- 0% {
- -webkit-transform: translate(100%);
- -moz-transform: translate(100%);
- -ms-transform: translate(100%);
- -o-transform: translate(100%);
- transform: translate(100%);
- }
- 100% {
- -webkit-transform: translate(0%);
- -moz-transform: translate(0%);
- -ms-transform: translate(0%);
- -o-transform: translate(0%);
- transform: translate(0%);
- }
- }
-
- @-webkit-keyframes moveOut {
- 0% {
- -webkit-transform: translate(-100%);
- -moz-transform: translate(-100%);
- -ms-transform: translate(-100%);
- -o-transform: translate(-100%);
- transform: translate(-100%);
- }
- 100% {
- -webkit-transform: translate(0%);
- -moz-transform: translate(0%);
- -ms-transform: translate(0%);
- -o-transform: translate(0%);
- transform: translate(0%);
- }
- }
- @keyframes moveOut {
- 0% {
- -webkit-transform: translate(-100%);
- -moz-transform: translate(-100%);
- -ms-transform: translate(-100%);
- -o-transform: translate(-100%);
- transform: translate(-100%);
- }
- 100% {
- -webkit-transform: translate(0%);
- -moz-transform: translate(0%);
- -ms-transform: translate(0%);
- -o-transform: translate(0%);
- transform: translate(0%);
- }
- }
-
-
- @media (max-width: 769px) {
- input[type="color"],
- input[type="date"],
- input[type="datetime"],
- input[type="datetime-local"],
- input[type="email"],
- input[type="month"],
- input[type="number"],
- input[type="password"],
- input[type="search"],
- input[type="tel"],
- input[type="text"],
- input[type="time"],
- input[type="url"],
- input[type="week"],
- select:focus,
- textarea {
- font-size: 16px;
- }
- }
-</style>
-`;
diff --git a/ui/component/or-survey/tsconfig.json b/ui/component/or-survey/tsconfig.json
deleted file mode 100644
index 36a7c304b..000000000
--- a/ui/component/or-survey/tsconfig.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "extends": "../../tsconfig",
- "compilerOptions": {
- "outDir": "./lib",
- "rootDir": "src"
- },
- "include": [
- "./src"
- ],
- "references": [
- { "path": "../core" },
- { "path": "../rest" }
- ]
-}
diff --git a/ui/util/package.json b/ui/util/package.json
index 00bc085c7..a2c4b2793 100644
--- a/ui/util/package.json
+++ b/ui/util/package.json
@@ -12,6 +12,7 @@
"@custom-elements-manifest/analyzer": "^0.10.4",
"@rspack/cli": "~1.7.1",
"@rspack/core": "~1.7.1",
+ "@types/lodash": "^4.17.21",
"@types/react": "^18",
"@typescript-eslint/eslint-plugin": "^5.9.0",
"@typescript-eslint/parser": "^5.9.0",
diff --git a/yarn.lock b/yarn.lock
index 455a2ae7b..06ce6aa64 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2196,30 +2196,6 @@ __metadata:
languageName: unknown
linkType: soft
-"@openremote/or-survey-results@workspace:ui/component/or-survey-results":
- version: 0.0.0-use.local
- resolution: "@openremote/or-survey-results@workspace:ui/component/or-survey-results"
- dependencies:
- "@openremote/core": "workspace:*"
- "@openremote/model": "workspace:*"
- lit: "npm:^3.3.1"
- languageName: unknown
- linkType: soft
-
-"@openremote/or-survey@workspace:ui/component/or-survey":
- version: 0.0.0-use.local
- resolution: "@openremote/or-survey@workspace:ui/component/or-survey"
- dependencies:
- "@openremote/core": "workspace:*"
- "@openremote/model": "workspace:*"
- "@openremote/or-translate": "workspace:*"
- "@types/lodash-es": "npm:^4.17.5"
- lit: "npm:^3.3.1"
- lodash-es: "npm:^4.17.15"
- moment: "npm:2.29.4"
- languageName: unknown
- linkType: soft
-
"@openremote/or-thermostat@workspace:ui/component/or-thermostat":
version: 0.0.0-use.local
resolution: "@openremote/or-thermostat@workspace:ui/component/or-thermostat"
@@ -2339,6 +2315,7 @@ __metadata:
"@custom-elements-manifest/analyzer": "npm:^0.10.4"
"@rspack/cli": "npm:~1.7.1"
"@rspack/core": "npm:~1.7.1"
+ "@types/lodash": "npm:^4.17.21"
"@types/react": "npm:^18"
"@typescript-eslint/eslint-plugin": "npm:^5.9.0"
"@typescript-eslint/parser": "npm:^5.9.0"
@@ -3418,19 +3395,10 @@ __metadata:
languageName: node
linkType: hard
-"@types/lodash-es@npm:^4.17.5":
- version: 4.17.12
- resolution: "@types/lodash-es@npm:4.17.12"
- dependencies:
- "@types/lodash": "npm:*"
- checksum: 10c0/5d12d2cede07f07ab067541371ed1b838a33edb3c35cb81b73284e93c6fd0c4bbeaefee984e69294bffb53f62d7272c5d679fdba8e595ff71e11d00f2601dde0
- languageName: node
- linkType: hard
-
-"@types/lodash@npm:*":
- version: 4.14.202
- resolution: "@types/lodash@npm:4.14.202"
- checksum: 10c0/6064d43c8f454170841bd67c8266cc9069d9e570a72ca63f06bceb484cb4a3ee60c9c1f305c1b9e3a87826049fd41124b8ef265c4dd08b00f6766609c7fe9973
+"@types/lodash@npm:^4.17.21":
+ version: 4.17.23
+ resolution: "@types/lodash@npm:4.17.23"
+ checksum: 10c0/9d9cbfb684e064a2b78aab9e220d398c9c2a7d36bc51a07b184ff382fa043a99b3d00c16c7f109b4eb8614118f4869678dbae7d5c6700ed16fb9340e26cc0bf6
languageName: node
linkType: hard
@@ -8344,13 +8312,6 @@ __metadata:
languageName: node
linkType: hard
-"lodash-es@npm:^4.17.15":
- version: 4.17.21
- resolution: "lodash-es@npm:4.17.21"
- checksum: 10c0/fb407355f7e6cd523a9383e76e6b455321f0f153a6c9625e21a8827d10c54c2a2341bd2ae8d034358b60e07325e1330c14c224ff582d04612a46a4f0479ff2f2
- languageName: node
- linkType: hard
-
"lodash.camelcase@npm:^4.3.0":
version: 4.3.0
resolution: "lodash.camelcase@npm:4.3.0"
@@ -8769,13 +8730,6 @@ __metadata:
languageName: node
linkType: hard
-"moment@npm:2.29.4":
- version: 2.29.4
- resolution: "moment@npm:2.29.4"
- checksum: 10c0/844c6f3ce42862ac9467c8ca4f5e48a00750078682cc5bda1bc0e50cc7ca88e2115a0f932d65a06e4a90e26cb78892be9b3ca3dd6546ca2c4d994cebb787fc2b
- languageName: node
- linkType: hard
-
"moment@npm:^2.29.4":
version: 2.30.1
resolution: "moment@npm:2.30.1"