From 206935b68a2c6b4790f5c8b77cc5419dad973438 Mon Sep 17 00:00:00 2001 From: Michael Leisch Date: Thu, 3 Oct 2024 09:59:45 +0200 Subject: [PATCH] #117 device set tag edit functionallity --- .../src/main/resources/application.properties | 2 +- .../app/edit/deviceSetEditEntry.component.ts | 15 ++++++++++++--- .../app/edit/editDeviceSetModal.component.ts | 19 +++++++++++++------ .../components/app/edit/editModal.styles.scss | 16 ++++++++++++++++ 4 files changed, 42 insertions(+), 10 deletions(-) diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index a3d033ba..424e22a1 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -3,7 +3,7 @@ quarkus.http.cors.origins=* quarkus.http.cors.methods=GET, POST, PUT, DELETE quarkus.http.cors.headers=Content-Type, Authorization -quarkus.hibernate-orm.database.generation=drop-and-create +quarkus.hibernate-orm.database.generation=update quarkus.hibernate-orm.log.sql=false #added dont-import.qsl because quarkus will crash wehen fed a completly commented out sql script.. or maybe just our sql script quarkus.hibernate-orm.sql-load-script=import.sql diff --git a/frontend/web/src/components/app/edit/deviceSetEditEntry.component.ts b/frontend/web/src/components/app/edit/deviceSetEditEntry.component.ts index f3d4d438..34dded42 100644 --- a/frontend/web/src/components/app/edit/deviceSetEditEntry.component.ts +++ b/frontend/web/src/components/app/edit/deviceSetEditEntry.component.ts @@ -9,7 +9,7 @@ import {EditPageEnum, ObservedProperty} from "../../../model" import {AppState} from "../../../AppState" import {model} from "../../../index" import PopupEngine from "../../../util/PopupEngine" -import DeviceSetService, {DeviceSet} from "../../../service/deviceSet.service" +import DeviceSetService, {DeviceSet, DeviceSetCreateDTO} from "../../../service/deviceSet.service" @customElement('cc-device-set-edit-entry') export class DeviceSetEditEntryComponent extends LitElement { @@ -37,15 +37,24 @@ export class DeviceSetEditEntryComponent extends LitElement {
${ this.deviceSet.device_types?.map((deviceType, index) => { - return html`${deviceType.name} ${this.deviceSet.device_types.length - 1 <= index ? '' : ','}` + return html`${deviceType.name} ${this.deviceSet.device_types.length - 1 <= index ? '' : ' • '}` }) }
`, () => {}) + model.appState.value.openOverlay(html``, () => {}) event.stopPropagation() }}">
diff --git a/frontend/web/src/components/app/edit/editDeviceSetModal.component.ts b/frontend/web/src/components/app/edit/editDeviceSetModal.component.ts index 71558fc5..5f3ac991 100644 --- a/frontend/web/src/components/app/edit/editDeviceSetModal.component.ts +++ b/frontend/web/src/components/app/edit/editDeviceSetModal.component.ts @@ -25,7 +25,7 @@ import {ChipType} from "../../basic/chip.component"; import DeviceService, {Device, DeviceStatus} from "../../../service/device.service"; import {unsafeSVG} from "lit/directives/unsafe-svg.js"; import {icon} from "@fortawesome/fontawesome-svg-core"; -import {faTag} from "@fortawesome/free-solid-svg-icons"; +import {faTag, faTrash} from "@fortawesome/free-solid-svg-icons"; import PopupEngine from "../../../util/PopupEngine" import UrlHandler from "../../../util/UrlHandler" import DeviceSetService, {DeviceSetCreateDTO, DeviceSet} from "../../../service/deviceSet.service" @@ -127,7 +127,7 @@ export class EditDeviceSetModalComponent extends LitElement { .onInput="${text => { this.element.description = text; this.updateDeviceSet(this.element); - }}" maxLength="30"> + }}">
@@ -162,10 +162,17 @@ export class EditDeviceSetModalComponent extends LitElement { >
-
-

${this.deviceTypes.map(deviceType => html`${deviceType.name}`)}

- -
+ ${this.deviceTypes.map(deviceType => html` +
+

${deviceType.name}

+ + ${unsafeSVG(icon(faTrash).html[0])} +
` + )}
`; diff --git a/frontend/web/styles/components/app/edit/editModal.styles.scss b/frontend/web/styles/components/app/edit/editModal.styles.scss index 5f98d83e..e66f4fd4 100644 --- a/frontend/web/styles/components/app/edit/editModal.styles.scss +++ b/frontend/web/styles/components/app/edit/editModal.styles.scss @@ -80,4 +80,20 @@ div.selectType{ } } } +} + +div.entries{ + display: flex; + flex-direction: column; + + div{ + display: flex; + justify-content: space-between; + border-bottom: 1px solid $gray500; + padding: .5rem; + + icon-cta svg *{ + fill: $gray700; + } + } } \ No newline at end of file