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 2022/08/31 08:28:35 UTC
[isis] 03/07: ISIS-3043 Version upgrade: kotlin=1.7.0, warnings cleaned
This is an automated email from the ASF dual-hosted git repository.
joergrade pushed a commit to branch ISIS-3171
in repository https://gitbox.apache.org/repos/asf/isis.git
commit a4d5e0a73acb36b3569e52621aa752f187941a77
Author: Jörg Rade <jo...@kuehne-nagel.com>
AuthorDate: Tue Aug 23 17:51:00 2022 +0200
ISIS-3043 Version upgrade: kotlin=1.7.0, warnings cleaned
---
incubator/clients/kroviz/build.gradle.kts | 3 +-
.../kroviz/core/aggregator/RestfulDispatcher.kt | 13 ++---
.../client/kroviz/core/event/CorsHttpRequest.kt | 57 ----------------------
.../isis/client/kroviz/core/event/EventStore.kt | 39 +++++----------
.../isis/client/kroviz/core/event/LogEntry.kt | 12 ++---
.../isis/client/kroviz/core/event/ResourceProxy.kt | 2 +-
.../isis/client/kroviz/handler/TObjectHandler.kt | 2 +-
.../isis/client/kroviz/ui/core/FormPanelFactory.kt | 6 ++-
.../apache/isis/client/kroviz/ui/core/RoMenuBar.kt | 2 +-
.../isis/client/kroviz/ui/dialog/ActionPrompt.kt | 2 +-
.../client/kroviz/ui/kv/override/RoTabPanel.kt | 56 +++------------------
.../apache/isis/client/kroviz/ui/panel/GeoMap.kt | 18 +++----
.../apache/isis/client/kroviz/ui/panel/SvgMap.kt | 1 +
.../apache/isis/client/kroviz/utils/StringUtils.kt | 8 +--
.../isis/client/kroviz/handler/IconHandlerTest.kt | 2 +-
15 files changed, 50 insertions(+), 173 deletions(-)
diff --git a/incubator/clients/kroviz/build.gradle.kts b/incubator/clients/kroviz/build.gradle.kts
index 40f3d44b85..0b4c1b2210 100644
--- a/incubator/clients/kroviz/build.gradle.kts
+++ b/incubator/clients/kroviz/build.gradle.kts
@@ -108,8 +108,7 @@ kotlin {
implementation(npm("xterm", "4.15.0", false))
implementation(npm("pdfjs", "2.4.7", false))
implementation(npm("vega", "5.22.1", false))
- implementation(npm("vega-lite", "5.4.0", false))
- implementation(npm("vega-lite-api", "5.0.0", true))
+ implementation(npm("vega-lite", "5.4.0", true))
implementation(npm("element-resize-event", "3.0.6", false))
}
sourceSets["test"].dependencies {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/RestfulDispatcher.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/RestfulDispatcher.kt
index 70a928e160..feccb1112f 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/RestfulDispatcher.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/aggregator/RestfulDispatcher.kt
@@ -18,14 +18,12 @@
*/
package org.apache.isis.client.kroviz.core.aggregator
-import org.apache.isis.client.kroviz.core.event.CorsHttpRequest
import org.apache.isis.client.kroviz.core.event.LogEntry
import org.apache.isis.client.kroviz.to.Link
import org.apache.isis.client.kroviz.to.Relation
import org.apache.isis.client.kroviz.to.Restful
-import org.apache.isis.client.kroviz.ui.core.SessionManager
-class RestfulDispatcher() : BaseAggregator() {
+class RestfulDispatcher : BaseAggregator() {
override fun update(logEntry: LogEntry, subType: String?) {
val restful = logEntry.getTransferObject() as Restful
@@ -36,8 +34,8 @@ class RestfulDispatcher() : BaseAggregator() {
rel.endsWith("/menuBars") -> invokeNavigation(it)
rel.endsWith("/services") -> {}
rel.endsWith("/logout") -> {}
- rel.endsWith("/brand-logo-signin") -> invokeDisgustingCorsWorkaround(it)
- rel.endsWith("/brand-logo-header") -> invokeDisgustingCorsWorkaround(it)
+// rel.endsWith("/brand-logo-signin") -> invokeDisgustingCorsWorkaround(it)
+// rel.endsWith("/brand-logo-header") -> invokeDisgustingCorsWorkaround(it)
else -> invokeSystem(it)
}
}
@@ -51,9 +49,4 @@ class RestfulDispatcher() : BaseAggregator() {
invoke(link, SystemAggregator(), referrer = "")
}
- private fun invokeDisgustingCorsWorkaround(link: Link) {
- val credentials = SessionManager.getCredentials()!!
- CorsHttpRequest().invoke(link.href, credentials)
- }
-
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/CorsHttpRequest.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/CorsHttpRequest.kt
deleted file mode 100644
index 30d4aaa2ee..0000000000
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/CorsHttpRequest.kt
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.apache.isis.client.kroviz.core.event
-
-import kotlinx.browser.document
-import org.w3c.dom.Document
-import org.w3c.dom.HTMLIFrameElement
-
-// https://stackoverflow.com/questions/33143776/ajax-request-refused-to-set-unsafe-header
-class CorsHttpRequest {
- private val scriptStr = """
- function sendWithoutOrigin(url, credentials) {
- console.log("[CHR.script]");
- var xhr = new XMLHttpRequest();
- xhr.open('GET', url);
- xhr.withCredentials = true;
- xhr.setRequestHeader('Authorization', 'Basic '+ credentials);
- xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8')
- xhr.setRequestHeader('Accept', 'image/svg+xml');
- xhr.responseType = 'blob';
- xhr.onloadend = function() {
- if (xhr.readyState === XMLHttpRequest.DONE) {
- console.log('GET succeeded.');
- console.log(xhr.response);
- return xhr.response;
- }
- };
- xhr.send();
- }"""
- private var iframe: HTMLIFrameElement = document.getElementById("iframe") as HTMLIFrameElement
- private var iframeWin: Document? = iframe.contentDocument //?: iframe) as Document?
-
- init {
- val iframeDoc = iframe.contentDocument!! //?: iframeWin?.ownerDocument
- val script = iframeDoc.createElement("SCRIPT")
- script.append(scriptStr);
- iframeDoc.documentElement?.appendChild(script);
- }
-
- //https://stackoverflow.com/questions/3076414/ways-to-circumvent-the-same-origin-policy
-/* iframeDoc.domain = "about:blank"
- val newDoc = Document();
- newDoc.domain = "about:blank"
- iframeDoc.append(newDoc)
- val script = newDoc.createElement("SCRIPT")
- newDoc.documentElement?.appendChild(script);
-*/
- fun invoke(url: String, credentials: String): String {
- val answer = js("""
- var iframe = document.getElementById('iframe');
- var iframeWin = iframe.contentWindow;
- return iframeWin.sendWithoutOrigin(url, credentials);
- """)
- console.log("[CHR]")
- console.log(answer as String)
- return answer
- }
-
-}
\ No newline at end of file
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt
index 5758573d3e..cb4aaa67c5 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/EventStore.kt
@@ -24,7 +24,6 @@ import org.apache.isis.client.kroviz.core.aggregator.BaseAggregator
import org.apache.isis.client.kroviz.core.aggregator.SvgDispatcher
import org.apache.isis.client.kroviz.to.TObject
import org.apache.isis.client.kroviz.to.mb.Menubars
-import org.apache.isis.client.kroviz.ui.core.SessionManager
import org.apache.isis.client.kroviz.ui.core.ViewManager
import org.apache.isis.client.kroviz.utils.StringUtils
import org.apache.isis.client.kroviz.utils.UUID
@@ -66,21 +65,21 @@ class EventStore {
}
entry.runningAtStart = countRunning()
log(entry)
- updateStatus(entry)
+ updateStatus()
return entry
}
fun add(reSpec: ResourceSpecification) {
val entry = LogEntry(reSpec)
log(entry)
- updateStatus(entry)
+ updateStatus()
}
fun addView(title: String, aggregator: BaseAggregator, panel: SimplePanel) {
val entry = LogEntry(title = title, aggregator = aggregator)
entry.panel = panel
log(entry)
- updateStatus(entry)
+ updateStatus()
}
fun closeView(title: String) {
@@ -88,7 +87,7 @@ class EventStore {
if (null != logEntry) {
logEntry.setClose()
logEntry.getAggregator()?.reset()
- updateStatus(logEntry)
+ updateStatus()
}
}
@@ -105,30 +104,18 @@ class EventStore {
entry.response = response
entry.setSuccess()
entry.runningAtEnd = countRunning()
- updateStatus(entry)
+ updateStatus()
}
return entry
}
fun end(reSpec: ResourceSpecification, pumlCode: String, response: Any?): LogEntry? {
val entry: LogEntry? = findBy(reSpec, pumlCode)
- val credentials: String = SessionManager.getCredentials()!!
if (entry != null) {
when (response) {
is String -> {
- if (response.isEmpty()) {
- console.log("[ES.end]")
- console.log(reSpec)
- val rebound = CorsHttpRequest().invoke(reSpec.url, credentials)
- if (rebound.isEmpty()) {
- throw IllegalStateException("CORS issue while accessing layout xml")
- } else {
- entry.response = rebound
- }
- } else {
- entry.response = response
- }
+ entry.response = response
}
is Blob -> entry.blob = response
else -> {
@@ -136,7 +123,7 @@ class EventStore {
}
entry.setSuccess()
entry.runningAtEnd = countRunning()
- updateStatus(entry)
+ updateStatus()
}
return entry
}
@@ -145,10 +132,10 @@ class EventStore {
val entry: LogEntry? = findBy(reSpec)
entry!!.setError(fault)
entry.runningAtEnd = countRunning()
- updateStatus(entry)
+ updateStatus()
}
- internal fun updateStatus(entry: LogEntry) {
+ internal fun updateStatus() {
val successCnt = log.count { le -> le.isSuccess() }
val runningCnt = countRunning()
val errorCnt = log.count { le -> le.isError() }
@@ -173,7 +160,7 @@ class EventStore {
}
fun findBy(rs: ResourceSpecification, body: String): LogEntry? {
- return log.firstOrNull() {
+ return log.firstOrNull {
it.url == rs.url
&& it.subType == rs.subType
&& it.request == body
@@ -181,7 +168,7 @@ class EventStore {
}
fun findBy(tObject: TObject): LogEntry? {
- return log.firstOrNull() {
+ return log.firstOrNull {
it.obj is TObject && (it.obj as TObject).instanceId == tObject.instanceId
}
}
@@ -207,13 +194,13 @@ class EventStore {
}
fun findMenuBars(): LogEntry? {
- return log.firstOrNull() {
+ return log.firstOrNull {
it.obj is Menubars
}
}
fun findMenuBarsBy(baseUrl: String): LogEntry? {
- return log.firstOrNull() {
+ return log.firstOrNull {
it.obj is Menubars && it.url.startsWith(baseUrl)
}
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/LogEntry.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/LogEntry.kt
index d0cfbb3301..6debc649f5 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/LogEntry.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/LogEntry.kt
@@ -202,14 +202,10 @@ data class LogEntry(
this.type = Represention.ERROR.type
}
is TObject -> {
- when {
- to == null -> {
- this.state = EventState.MISSING
- this.type = Represention.ERROR.type
- console.log("to == null for response:")
- console.log(response)
- }
- }
+ this.state = EventState.MISSING
+ this.type = Represention.ERROR.type
+ console.log("to == null for response:")
+ console.log(response)
}
else -> {
console.log(to)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/ResourceProxy.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/ResourceProxy.kt
index ec1f90f4fc..4cbec754f4 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/ResourceProxy.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/core/event/ResourceProxy.kt
@@ -118,7 +118,7 @@ class ResourceProxy {
aggregator.update(le, le.subType)
}
le.setCached()
- es.updateStatus(le)
+ es.updateStatus()
}
fun invokeKroki(pumlCode: String, aggregator: SvgDispatcher) {
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/TObjectHandler.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/TObjectHandler.kt
index 36806fd719..0106694fc0 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/TObjectHandler.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/handler/TObjectHandler.kt
@@ -28,7 +28,7 @@ class TObjectHandler : BaseHandler() {
override fun canHandle(response: String): Boolean {
val urlPath = logEntry.url.split("restful")
val path = urlPath[1]
- if (path != null && path.length > 1) {
+ if (path.length > 1) {
return super.canHandle(response)
}
return false
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/FormPanelFactory.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/FormPanelFactory.kt
index 1110b9e47c..87063d3f1f 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/FormPanelFactory.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/FormPanelFactory.kt
@@ -168,8 +168,10 @@ class FormPanelFactory(items: List<FormItem>) : VPanel() {
private fun createImage(fi: FormItem): VPanel {
val panel = VPanel {
when (val fc = fi.content) {
- fc is Image -> fc
- fc is String -> {
+ (fc is Image) -> {
+ console.log(fc)
+ }
+ (fc is String) -> {
// interpret as (file) URL and load locally
console.log("[FPF.createImage]")
console.log(fc)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoMenuBar.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoMenuBar.kt
index 6c6879f02b..0a73b7cea2 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoMenuBar.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/core/RoMenuBar.kt
@@ -232,7 +232,7 @@ class RoMenuBar : SimplePanel() {
fun executeAllMenuBarActions() {
val menuBars = SessionManager.getEventStore().findMenuBars()!!.obj as Menubars
menuBars.primary.menu.forEach { m ->
- m.section.forEachIndexed { index, section ->
+ m.section.forEachIndexed { _, section ->
section.serviceAction.forEach { sa ->
ResourceProxy().fetch(sa.link!!, ActionDispatcher())
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/ActionPrompt.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/ActionPrompt.kt
index 0239cfbfd5..e883227db6 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/ActionPrompt.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/dialog/ActionPrompt.kt
@@ -96,7 +96,7 @@ class ActionPrompt(val action: Action) : Controller() {
is SimpleSelect -> {
key = i.label!!
value = i.getValue()!!
- val p: Parameter = action.findParameterByName(key.toLowerCase())!!
+ val p: Parameter = action.findParameterByName(key.lowercase())!!
val href = p.getHrefByTitle(value)!!
value = href
}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt
index 57ba297c62..16e4cc7b62 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/kv/override/RoTabPanel.kt
@@ -23,11 +23,13 @@ package org.apache.isis.client.kroviz.ui.kv.override
* * add IconMenu to (Ro)Tab
*/
-import io.kvision.snabbdom.VNode
-import io.kvision.core.*
+import io.kvision.core.Component
+import io.kvision.core.CssSize
+import io.kvision.core.UNIT
+import io.kvision.core.WidgetWrapper
import io.kvision.panel.SimplePanel
-import io.kvision.panel.VPanel
import io.kvision.routing.RoutingManager
+import io.kvision.snabbdom.VNode
import io.kvision.utils.auto
import io.kvision.utils.obj
import org.apache.isis.client.kroviz.ui.core.ViewManager
@@ -74,7 +76,7 @@ open class RoTabPanel(
val scrollableTabs: Boolean = true,
val draggableTabs: Boolean = false,
className: String? = null,
- init: (RoTabPanel.() -> Unit)? = null
+ init: (RoTabPanel.() -> Unit)? = null,
) : SimplePanel((className?.let { "$it " } ?: "") + "kv-tab-panel") {
protected val navClasses = when (tabPosition) {
@@ -151,13 +153,6 @@ open class RoTabPanel(
}
}
- /**
- * Returns the number of tabs.
- */
- open fun getSize(): Int {
- return tabs.size
- }
-
/**
* Returns the list of tabs.
*/
@@ -301,25 +296,6 @@ open class RoTabPanel(
return this
}
- /**
- * Creates and adds new tab component.
- * @param title title of the tab
- * @param panel child component
- * @param icon icon of the tab
- * @param image image of the tab
- * @param closable determines if this tab is closable
- * @param route JavaScript route to activate given child
- * @return current container
- */
- open fun addTab(
- title: String, panel: Component, icon: String? = null,
- image: ResString? = null, closable: Boolean = false, route: String? = null
- ): RoTabPanel {
- addTab(RoTab(title, panel, icon, image, closable, route))
- refresh()
- return this
- }
-
override fun addAll(children: List<Component>): RoTabPanel {
children.forEach(::addChild)
refresh()
@@ -367,7 +343,7 @@ open class RoTabPanel(
fun findTab(title: String): Int? {
getTabs().forEachIndexed { index, component ->
- if ((component is VPanel) && (component.title == title)) {
+ if (component.title == title) {
return index
}
}
@@ -402,21 +378,3 @@ open class RoTabPanel(
}
}
-
-/**
- * DSL builder extension function.
- *
- * It takes the same parameters as the constructor of the built component.
- */
-fun Container.tabPanel(
- tabPosition: TabPosition = TabPosition.TOP,
- sideTabSize: SideTabSize = SideTabSize.SIZE_3,
- scrollableTabs: Boolean = false,
- draggableTabs: Boolean = false,
- className: String? = null,
- init: (RoTabPanel.() -> Unit)? = null
-): RoTabPanel {
- val tabPanel = RoTabPanel(tabPosition, sideTabSize, scrollableTabs, draggableTabs, className, init)
- this.add(tabPanel)
- return tabPanel
-}
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/GeoMap.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/GeoMap.kt
index 21fc5cf504..460fe0b84e 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/GeoMap.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/GeoMap.kt
@@ -23,9 +23,7 @@ import io.kvision.core.UNIT
import io.kvision.html.Button
import io.kvision.html.ButtonStyle
import io.kvision.maps.Maps
-import io.kvision.maps.maps
import io.kvision.panel.HPanel
-import io.kvision.utils.pc
import org.apache.isis.client.kroviz.ui.core.Constants
import org.apache.isis.client.kroviz.ui.core.ViewManager
import org.apache.isis.client.kroviz.utils.IconManager
@@ -42,10 +40,10 @@ class GeoMap : HPanel() {
margin = CssSize(10, UNIT.px)
}
- val home = LatLng(53.65425, 10.1545)
+// val home = LatLng(53.65425, 10.1545)
m.addMarker(s = "Home")
- val office = LatLng(53.5403735, 10.0008355)
+// val office = LatLng(53.5403735, 10.0008355)
m.addMarker(s = "Work<br><a href='https://en.wikipedia.org/wiki/Kuehne_%2B_Nagel'>KN</a>")
ViewManager.getRoIconBar().add(createLocationIcon())
@@ -74,22 +72,22 @@ class GeoMap : HPanel() {
private fun parseMarker(id: String): Marker? {
val raw = id.split("#")
return if (raw.isNotEmpty()) {
- val lat = raw[0].toDouble()
- val lng = raw[1].toDouble()
+// val lat = raw[0].toDouble()
+// val lng = raw[1].toDouble()
//TODO implement extension function and adopt new version of kvision.maps
- val latLng = LatLng(lat, lng)
+ // val latLng = LatLng(lat, lng)
val title = if (raw.size >= 2) raw[2] else "no title set"
Marker(title)
} else null
}
- private fun LatLng(lat: Double, lng: Double): Any {
+ private fun LatLng(): Any {
return { }
}
}
-private fun Maps.addMarker(latLang: Any? = null, s: String) {
-
+private fun Maps.addMarker(s: String) {
+ this.title = s
}
class Marker(val title: String)
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/SvgMap.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/SvgMap.kt
index a423a705cb..17f329c314 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/SvgMap.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/ui/panel/SvgMap.kt
@@ -447,6 +447,7 @@ Country: US
svg.scaleHorizontally()
val svgDoc = svg.document
val svgElement = svgDoc.documentElement
+ console.log("[SvgMap]$svgElement")
//TODO implement extension function and adopt new version of kvsion.maps
/* val bounds = LatLngBounds(
diff --git a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/StringUtils.kt b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/StringUtils.kt
index 8589845705..d819e9df63 100644
--- a/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/StringUtils.kt
+++ b/incubator/clients/kroviz/src/main/kotlin/org/apache/isis/client/kroviz/utils/StringUtils.kt
@@ -37,7 +37,7 @@ object StringUtils {
@OptIn(ExperimentalStdlibApi::class)
fun capitalize(input: String): String {
- return if (input != null && input.length > 0) {
+ return if (input.length > 0) {
val output = input.substring(1, input.length)
input.first().uppercaseChar() + output
} else {
@@ -215,9 +215,9 @@ object StringUtils {
(1..pad.length).forEach { raw += 0.toChar() }
return StringBuilder().apply {
(0 until raw.length step 3).forEach {
- val n: Int = (0xFF.and(raw[it].toInt()) shl 16) +
- (0xFF.and(raw[it + 1].toInt()) shl 8) +
- 0xFF.and(raw[it + 2].toInt())
+ val n: Int = (0xFF.and(raw[it].code) shl 16) +
+ (0xFF.and(raw[it + 1].code) shl 8) +
+ 0xFF.and(raw[it + 2].code)
listOf<Int>(
(n shr 18) and 0x3F,
(n shr 12) and 0x3F,
diff --git a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/handler/IconHandlerTest.kt b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/handler/IconHandlerTest.kt
index 8f3743257f..87a9618848 100644
--- a/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/handler/IconHandlerTest.kt
+++ b/incubator/clients/kroviz/src/test/kotlin/org/apache/isis/client/kroviz/handler/IconHandlerTest.kt
@@ -73,7 +73,7 @@ IHDR�w=�sBIT|d� pHYs��~�tEXtSoftwareAdobe Fireworks
"""
val ba = ByteArray(str.length)
str.forEachIndexed { index, char ->
- ba.set(index, char.toByte())
+ ba.set(index, char.code.toByte())
}
console.log(ba.toString())
val options = BlobPropertyBag()