You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by jo...@apache.org on 2021/11/12 17:09:02 UTC
[isis] 01/07: ISIS-2348 Handle blob error, upgrade to kvision 5.5.1,
minor cleanup
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit 81c610277c805173fefb9443f6950b391be63182
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Wed Nov 10 17:44:15 2021 +0100
ISIS-2348 Handle blob error, upgrade to kvision 5.5.1, minor cleanup
---
incubator/clients/kroviz/gradle.properties | 2 +-
.../isis/client/kroviz/core/event/RoXmlHttpRequest.kt | 16 +++++++++++-----
.../apache/isis/client/kroviz/ui/panel/DropdownSearch.kt | 2 +-
.../apache/isis/client/kroviz/ui/panel/EventLogTable.kt | 2 +-
4 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/incubator/clients/kroviz/gradle.properties b/incubator/clients/kroviz/gradle.properties
index c035209..4c532c0 100644
--- a/incubator/clients/kroviz/gradle.properties
+++ b/incubator/clients/kroviz/gradle.properties
@@ -21,7 +21,7 @@ javaVersion=1.8
systemProp.kotlinVersion=1.5.31
serializationVersion=1.3.0
#Dependencies
-systemProp.kvisionVersion=5.4.3
+systemProp.kvisionVersion=5.5.1
coroutinesVersion=1.5.2
kotlin.mpp.stability.nowarn=true
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/RoXmlHttpRequest.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/RoXmlHttpRequest.kt
index 5f77a1e..2a0b544 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/RoXmlHttpRequest.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/RoXmlHttpRequest.kt
@@ -29,6 +29,7 @@ import org.apache.isis.client.kroviz.ui.core.UiManager
import org.apache.isis.client.kroviz.utils.StringUtils
import org.apache.isis.client.kroviz.utils.UrlUtils
import org.w3c.xhr.BLOB
+import org.w3c.xhr.TEXT
import org.w3c.xhr.XMLHttpRequest
import org.w3c.xhr.XMLHttpRequestResponseType
@@ -112,9 +113,10 @@ class RoXmlHttpRequest(val aggregator: BaseAggregator?) {
}
private fun buildResourceSpecificationAndSetupHandler(
- url: String,
- subType: String,
- body: String): ResourceSpecification {
+ url: String,
+ subType: String,
+ body: String
+ ): ResourceSpecification {
val rs = ResourceSpecification(url, subType)
xhr.onload = { _ -> handleResult(rs, body) }
xhr.onerror = { _ -> handleError(rs) }
@@ -136,8 +138,12 @@ class RoXmlHttpRequest(val aggregator: BaseAggregator?) {
}
private fun handleError(rs: ResourceSpecification) {
- val responseText = xhr.responseText
- UiManager.getEventStore().fault(rs, responseText)
+ val error = when (xhr.responseType) {
+ XMLHttpRequestResponseType.BLOB -> "blob error"
+ XMLHttpRequestResponseType.TEXT -> xhr.responseText
+ else -> "neither text nor blob"
+ }
+ UiManager.getEventStore().fault(rs, error)
}
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/DropdownSearch.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/DropdownSearch.kt
index a933d42..3cc1332 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/DropdownSearch.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/DropdownSearch.kt
@@ -40,7 +40,7 @@ class DropdownSearch() : SimplePanel() {
this.marginTop = 10.px
this.marginLeft = 40.px
this.width = 100.pc
- val formPanel = formPanel<Form> {
+ formPanel<Form> {
add(
Form::select, Select(
options = cachedValues,
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventLogTable.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventLogTable.kt
index d5ce222..2cb133e 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventLogTable.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/EventLogTable.kt
@@ -108,7 +108,7 @@ class EventLogTable(val model: List<LogEntry>) : VPanel() {
b.onClick {
kotlinx.browser.window.open(data.title) //IMPROVE should be URL
}
- val tto = TooltipOptions(title = data.title)
+ //val tto = TooltipOptions(title = data.title)
// tabulator tooltip is buggy: often the tooltip doesn't go away and the color is not settable
//b.enableTooltip(tto)
if (data.obj is TObject) b.setDragDropData(Constants.stdMimeType, data.url)